Rediff for latest GIT

This commit is contained in:
Andreas Gruenbacher 2007-05-09 12:51:20 +00:00
parent 9467d933df
commit 9e0fe0ef90
42 changed files with 291 additions and 236 deletions

View file

@ -6,9 +6,9 @@ Signed-off-by: Andreas Gruenbacher <agruen@suse.de>
---
security/Kconfig | 1 +
security/Makefile | 3 ++-
security/Makefile | 1 +
security/apparmor/Kconfig | 3 ++-
3 files changed, 5 insertions(+), 2 deletions(-)
3 files changed, 4 insertions(+), 1 deletion(-)
--- a/security/Kconfig
+++ b/security/Kconfig

View file

@ -1,33 +1,3 @@
With the lkml patches currently in svn, there is a dentry refcounting
bug somewhere. Unloading the apparmor module ends up leaving around the
/sys/kernel/security/apparmor/ directory and files in place. Followup
attempts to reload the module fail because because the securityfs files
exist which causes the apparmorfs registration attempt to fail[1].
Attempts to read from the leftover files (e.g. by the rcapparmor script
looking to see if profiles are already loaded) would of course cause an
oops because the backing operations no longer exist.
Closer examination showed that the reference count on each dentry/file
in the apparmor/ directory was at 2 *after* securityfs_remove() had been
called. The apparmor/ directory itself could not be removed because all
of its member entries still existed. Diagnostic printk()s also showed that
the reference count on the dentries is also 2 immediately after
creation.
I'm not quite sure where the extra references come from, or why things
worked before (and they definitely do work in a 2.6.18 era kernel). The
following patch adjusts the reference counts in such a way that they go
to zero on unloading, but I'm not sure they're the *right* fixes, it may
just be papering over a refcounting bug elsewhere.
Any comments? (This patch is checked in to subversion.)
[1] There's also a *really* annoying bug with modprobe exposed here;
when module_init(1) fails with -EEXIST returned, modprobe silently
ignores it and returns success. We end up propogating the -EEXIST
error from the apparmorfs creation, so it looks initially like module
reloading succeeded when it didn't.
---
security/apparmor/apparmorfs.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)

View file

@ -17,7 +17,7 @@ Reviewed-by: John Johansen <jjohansen@suse.de>
--- a/fs/dcache.c
+++ b/fs/dcache.c
@@ -1750,9 +1750,9 @@ shouldnt_be_hashed:
@@ -1779,9 +1779,9 @@ shouldnt_be_hashed:
*
* Returns the buffer or an error code.
*/
@ -32,7 +32,7 @@ Reviewed-by: John Johansen <jjohansen@suse.de>
--- a/fs/namespace.c
+++ b/fs/namespace.c
@@ -1877,3 +1877,30 @@ void __put_mnt_ns(struct mnt_namespace *
@@ -1868,3 +1868,30 @@ void __put_mnt_ns(struct mnt_namespace *
release_mounts(&umount_list);
kfree(ns);
}
@ -65,9 +65,9 @@ Reviewed-by: John Johansen <jjohansen@suse.de>
+EXPORT_SYMBOL(d_namespace_path);
--- a/include/linux/dcache.h
+++ b/include/linux/dcache.h
@@ -293,6 +293,8 @@ extern struct dentry * d_hash_and_lookup
/* validate "insecure" dentry pointer */
extern int d_validate(struct dentry *, struct dentry *);
@@ -299,6 +299,8 @@ extern int d_validate(struct dentry *, s
*/
extern char *dynamic_dname(struct dentry *, char *, int, const char *, ...);
+extern char *__d_path(struct dentry *, struct vfsmount *, struct dentry *,
+ struct vfsmount *, char *, int, int);

View file

@ -12,7 +12,7 @@ Signed-off-by: Andreas Gruenbacher <agruen@suse.de>
--- a/fs/namei.c
+++ b/fs/namei.c
@@ -1131,25 +1131,24 @@ static int fastcall do_path_lookup(int d
@@ -1130,25 +1130,24 @@ static int fastcall do_path_lookup(int d
nd->dentry = dget(fs->pwd);
read_unlock(&fs->lock);
} else {

View file

@ -64,7 +64,7 @@ Cc: Miklos Szeredi <mszeredi@suse.cz>
}
--- a/fs/open.c
+++ b/fs/open.c
@@ -520,6 +520,8 @@ asmlinkage long sys_fchmod(unsigned int
@@ -522,6 +522,8 @@ asmlinkage long sys_fchmod(unsigned int
mode = inode->i_mode;
newattrs.ia_mode = (mode & S_IALLUGO) | (inode->i_mode & ~S_IALLUGO);
newattrs.ia_valid = ATTR_MODE | ATTR_CTIME;
@ -73,7 +73,7 @@ Cc: Miklos Szeredi <mszeredi@suse.cz>
err = notify_change(dentry, file->f_path.mnt, &newattrs);
mutex_unlock(&inode->i_mutex);
@@ -570,7 +572,7 @@ asmlinkage long sys_chmod(const char __u
@@ -572,7 +574,7 @@ asmlinkage long sys_chmod(const char __u
}
static int chown_common(struct dentry * dentry, struct vfsmount *mnt,
@ -82,7 +82,7 @@ Cc: Miklos Szeredi <mszeredi@suse.cz>
{
struct inode * inode;
int error;
@@ -598,6 +600,10 @@ static int chown_common(struct dentry *
@@ -600,6 +602,10 @@ static int chown_common(struct dentry *
}
if (!S_ISDIR(inode->i_mode))
newattrs.ia_valid |= ATTR_KILL_SUID|ATTR_KILL_SGID;
@ -93,7 +93,7 @@ Cc: Miklos Szeredi <mszeredi@suse.cz>
mutex_lock(&inode->i_mutex);
error = notify_change(dentry, mnt, &newattrs);
mutex_unlock(&inode->i_mutex);
@@ -613,7 +619,7 @@ asmlinkage long sys_chown(const char __u
@@ -615,7 +621,7 @@ asmlinkage long sys_chown(const char __u
error = user_path_walk(filename, &nd);
if (error)
goto out;
@ -102,7 +102,7 @@ Cc: Miklos Szeredi <mszeredi@suse.cz>
path_release(&nd);
out:
return error;
@@ -633,7 +639,7 @@ asmlinkage long sys_fchownat(int dfd, co
@@ -635,7 +641,7 @@ asmlinkage long sys_fchownat(int dfd, co
error = __user_walk_fd(dfd, filename, follow, &nd);
if (error)
goto out;
@ -111,7 +111,7 @@ Cc: Miklos Szeredi <mszeredi@suse.cz>
path_release(&nd);
out:
return error;
@@ -647,7 +653,7 @@ asmlinkage long sys_lchown(const char __
@@ -649,7 +655,7 @@ asmlinkage long sys_lchown(const char __
error = user_path_walk_link(filename, &nd);
if (error)
goto out;
@ -120,7 +120,7 @@ Cc: Miklos Szeredi <mszeredi@suse.cz>
path_release(&nd);
out:
return error;
@@ -666,7 +672,7 @@ asmlinkage long sys_fchown(unsigned int
@@ -668,7 +674,7 @@ asmlinkage long sys_fchown(unsigned int
dentry = file->f_path.dentry;
audit_inode(NULL, dentry->d_inode);
@ -131,7 +131,7 @@ Cc: Miklos Szeredi <mszeredi@suse.cz>
return error;
--- a/include/linux/fs.h
+++ b/include/linux/fs.h
@@ -349,6 +349,9 @@ struct iattr {
@@ -351,6 +351,9 @@ struct iattr {
* Not an attribute, but an auxilary info for filesystems wanting to
* implement an ftruncate() like method. NOTE: filesystem should
* check for (ia_valid & ATTR_FILE), and not for (ia_file != NULL).

View file

@ -13,7 +13,7 @@ Signed-off-by: Andreas Gruenbacher <agruen@suse.de>
--- a/fs/namei.c
+++ b/fs/namei.c
@@ -297,7 +297,13 @@ int vfs_permission(struct nameidata *nd,
@@ -296,7 +296,13 @@ int vfs_permission(struct nameidata *nd,
*/
int file_permission(struct file *file, int mask)
{

View file

@ -0,0 +1,21 @@
From: Andreas Gruenbacher <agruen@suse.de>
Subject: Compile fix for CONFIG_MMC_DEBUG
Signed-off-by: Andreas Gruenbacher <agruen@suse.de>
diff --git a/drivers/mmc/core/core.c b/drivers/mmc/core/core.c
index b6c1670..7385acf 100644
--- a/drivers/mmc/core/core.c
+++ b/drivers/mmc/core/core.c
@@ -501,9 +501,9 @@ void mmc_detect_change(struct mmc_host *
{
#ifdef CONFIG_MMC_DEBUG
unsigned long flags;
- spin_lock_irqsave(host->lock, flags);
+ spin_lock_irqsave(&host->lock, flags);
BUG_ON(host->removed);
- spin_unlock_irqrestore(host->lock, flags);
+ spin_unlock_irqrestore(&host->lock, flags);
#endif
mmc_schedule_delayed_work(&host->detect, delay);

View file

@ -15,7 +15,7 @@ Signed-off-by: Andreas Gruenbacher <agruen@suse.de>
--- a/fs/namei.c
+++ b/fs/namei.c
@@ -2048,6 +2048,10 @@ int vfs_rmdir(struct inode *dir, struct
@@ -2036,6 +2036,10 @@ int vfs_rmdir(struct inode *dir, struct
if (!dir->i_op || !dir->i_op->rmdir)
return -EPERM;
@ -26,7 +26,7 @@ Signed-off-by: Andreas Gruenbacher <agruen@suse.de>
DQUOT_INIT(dir);
mutex_lock(&dentry->d_inode->i_mutex);
@@ -2055,12 +2059,9 @@ int vfs_rmdir(struct inode *dir, struct
@@ -2043,12 +2047,9 @@ int vfs_rmdir(struct inode *dir, struct
if (d_mountpoint(dentry))
error = -EBUSY;
else {

View file

@ -7,7 +7,7 @@
--- a/fs/namei.c
+++ b/fs/namei.c
@@ -1428,6 +1428,10 @@ static int may_delete(struct inode *dir,
@@ -1416,6 +1416,10 @@ static int may_delete(struct inode *dir,
BUG_ON(victim->d_parent->d_inode != dir);
audit_inode_child(victim->d_name.name, victim->d_inode, dir);
@ -18,7 +18,7 @@
error = permission(dir,MAY_WRITE | MAY_EXEC, NULL);
if (error)
return error;
@@ -1465,6 +1469,8 @@ static inline int may_create(struct inod
@@ -1453,6 +1457,8 @@ static inline int may_create(struct inod
return -EEXIST;
if (IS_DEADDIR(dir))
return -ENOENT;

View file

@ -19,7 +19,7 @@ Signed-off-by: Andreas Gruenbacher <agruen@suse.de>
--- a/fs/dcache.c
+++ b/fs/dcache.c
@@ -1754,7 +1754,7 @@ static char *__d_path(struct dentry *den
@@ -1783,7 +1783,7 @@ static char *__d_path(struct dentry *den
struct dentry *root, struct vfsmount *rootmnt,
char *buffer, int buflen, int fail_deleted)
{
@ -28,7 +28,7 @@ Signed-off-by: Andreas Gruenbacher <agruen@suse.de>
if (buflen < 2)
return ERR_PTR(-ENAMETOOLONG);
@@ -1777,14 +1777,14 @@ static char *__d_path(struct dentry *den
@@ -1806,14 +1806,14 @@ static char *__d_path(struct dentry *den
struct dentry * parent;
if (dentry == vfsmnt->mnt_root || IS_ROOT(dentry)) {
@ -48,7 +48,7 @@ Signed-off-by: Andreas Gruenbacher <agruen@suse.de>
continue;
}
parent = dentry->d_parent;
@@ -1803,6 +1803,8 @@ static char *__d_path(struct dentry *den
@@ -1832,6 +1832,8 @@ static char *__d_path(struct dentry *den
*--buffer = '/';
out:

View file

@ -23,7 +23,7 @@ Signed-off-by: John Johansen <jjohansen@suse.de>
--- a/fs/ntfs/file.c
+++ b/fs/ntfs/file.c
@@ -2162,7 +2162,7 @@ static ssize_t ntfs_file_aio_write_noloc
@@ -2146,7 +2146,7 @@ static ssize_t ntfs_file_aio_write_noloc
goto out;
if (!count)
goto out;
@ -34,7 +34,7 @@ Signed-off-by: John Johansen <jjohansen@suse.de>
file_update_time(file);
--- a/fs/ocfs2/file.c
+++ b/fs/ocfs2/file.c
@@ -1157,14 +1157,14 @@ out:
@@ -1158,14 +1158,14 @@ out:
return ret;
}
@ -51,7 +51,7 @@ Signed-off-by: John Johansen <jjohansen@suse.de>
u32 clusters;
loff_t newsize, saved_pos;
@@ -1190,7 +1190,7 @@ static int ocfs2_prepare_inode_for_write
@@ -1191,7 +1191,7 @@ static int ocfs2_prepare_inode_for_write
* inode. There's also the dinode i_size state which
* can be lost via setattr during extending writes (we
* set inode->i_size at the end of a write. */
@ -60,7 +60,7 @@ Signed-off-by: John Johansen <jjohansen@suse.de>
if (meta_level == 0) {
ocfs2_meta_unlock(inode, meta_level);
meta_level = 1;
@@ -1498,7 +1498,7 @@ relock:
@@ -1499,7 +1499,7 @@ relock:
}
can_do_direct = direct_io;
@ -69,7 +69,7 @@ Signed-off-by: John Johansen <jjohansen@suse.de>
iocb->ki_left, appending,
&can_do_direct);
if (ret < 0) {
@@ -1703,7 +1703,7 @@ static ssize_t ocfs2_file_splice_write(s
@@ -1704,7 +1704,7 @@ static ssize_t ocfs2_file_splice_write(s
goto out;
}
@ -80,7 +80,7 @@ Signed-off-by: John Johansen <jjohansen@suse.de>
mlog_errno(ret);
--- a/fs/reiserfs/file.c
+++ b/fs/reiserfs/file.c
@@ -1353,7 +1353,7 @@ static ssize_t reiserfs_file_write(struc
@@ -1352,7 +1352,7 @@ static ssize_t reiserfs_file_write(struc
if (count == 0)
goto out;
@ -91,7 +91,7 @@ Signed-off-by: John Johansen <jjohansen@suse.de>
--- a/fs/splice.c
+++ b/fs/splice.c
@@ -797,7 +797,7 @@ generic_file_splice_write_nolock(struct
@@ -796,7 +796,7 @@ generic_file_splice_write_nolock(struct
ssize_t ret;
int err;
@ -100,7 +100,7 @@ Signed-off-by: John Johansen <jjohansen@suse.de>
if (unlikely(err))
return err;
@@ -843,10 +843,10 @@ generic_file_splice_write(struct pipe_in
@@ -842,10 +842,10 @@ generic_file_splice_write(struct pipe_in
ssize_t ret;
int err;
@ -115,18 +115,18 @@ Signed-off-by: John Johansen <jjohansen@suse.de>
return err;
--- a/fs/xfs/linux-2.6/xfs_lrw.c
+++ b/fs/xfs/linux-2.6/xfs_lrw.c
@@ -799,7 +799,7 @@ start:
@@ -798,7 +798,7 @@ start:
!capable(CAP_FSETID)) {
error = xfs_write_clear_setuid(xip);
if (likely(!error))
- error = -remove_suid(file->f_path.dentry);
+ error = -remove_suid(&file->f_path);
if (unlikely(error)) {
xfs_iunlock(xip, iolock);
goto out_unlock_mutex;
goto out_unlock_internal;
}
--- a/include/linux/fs.h
+++ b/include/linux/fs.h
@@ -1690,9 +1690,9 @@ extern void __iget(struct inode * inode)
@@ -1697,9 +1697,9 @@ extern void __iget(struct inode * inode)
extern void clear_inode(struct inode *);
extern void destroy_inode(struct inode *);
extern struct inode *new_inode(struct super_block *);
@ -141,7 +141,7 @@ Signed-off-by: John Johansen <jjohansen@suse.de>
extern void remove_inode_hash(struct inode *);
--- a/mm/filemap.c
+++ b/mm/filemap.c
@@ -1849,9 +1849,9 @@ repeat:
@@ -1880,9 +1880,9 @@ repeat:
* if suid or (sgid and xgrp)
* remove privs
*/
@ -153,7 +153,7 @@ Signed-off-by: John Johansen <jjohansen@suse.de>
int kill = 0;
/* suid always must be killed */
@@ -1872,20 +1872,20 @@ int should_remove_suid(struct dentry *de
@@ -1903,20 +1903,20 @@ int should_remove_suid(struct dentry *de
}
EXPORT_SYMBOL(should_remove_suid);
@ -179,7 +179,7 @@ Signed-off-by: John Johansen <jjohansen@suse.de>
return 0;
}
@@ -2252,7 +2252,7 @@ __generic_file_aio_write_nolock(struct k
@@ -2267,7 +2267,7 @@ __generic_file_aio_write_nolock(struct k
if (count == 0)
goto out;

View file

@ -16,7 +16,7 @@ Signed-off-by: John Johansen <jjohansen@suse.de>
--- a/fs/namei.c
+++ b/fs/namei.c
@@ -1535,7 +1535,7 @@ int vfs_create(struct inode *dir, struct
@@ -1523,7 +1523,7 @@ int vfs_create(struct inode *dir, struct
return -EACCES; /* shouldn't it be ENOSYS? */
mode &= S_IALLUGO;
mode |= S_IFREG;
@ -81,7 +81,7 @@ Signed-off-by: John Johansen <jjohansen@suse.de>
}
--- a/security/selinux/hooks.c
+++ b/security/selinux/hooks.c
@@ -2178,7 +2178,8 @@ static int selinux_inode_init_security(s
@@ -2176,7 +2176,8 @@ static int selinux_inode_init_security(s
return 0;
}

View file

@ -16,7 +16,7 @@ Signed-off-by: John Johansen <jjohansen@suse.de>
--- a/fs/xattr.c
+++ b/fs/xattr.c
@@ -117,7 +117,7 @@ vfs_getxattr(struct dentry *dentry, stru
@@ -116,7 +116,7 @@ vfs_getxattr(struct dentry *dentry, stru
if (error)
return error;
@ -85,7 +85,7 @@ Signed-off-by: John Johansen <jjohansen@suse.de>
}
--- a/security/selinux/hooks.c
+++ b/security/selinux/hooks.c
@@ -2395,7 +2395,8 @@ static void selinux_inode_post_setxattr(
@@ -2393,7 +2393,8 @@ static void selinux_inode_post_setxattr(
return;
}

View file

@ -16,7 +16,7 @@ Signed-off-by: John Johansen <jjohansen@suse.de>
--- a/fs/namei.c
+++ b/fs/namei.c
@@ -2307,7 +2307,8 @@ int vfs_link(struct dentry *old_dentry,
@@ -2295,7 +2295,8 @@ int vfs_link(struct dentry *old_dentry,
if (S_ISDIR(old_dentry->d_inode->i_mode))
return -EPERM;
@ -98,7 +98,7 @@ Signed-off-by: John Johansen <jjohansen@suse.de>
}
--- a/security/selinux/hooks.c
+++ b/security/selinux/hooks.c
@@ -2184,11 +2184,16 @@ static int selinux_inode_create(struct i
@@ -2182,11 +2182,16 @@ static int selinux_inode_create(struct i
return may_create(dir, dentry, SECCLASS_FILE);
}

View file

@ -16,7 +16,7 @@ Signed-off-by: John Johansen <jjohansen@suse.de>
--- a/fs/xattr.c
+++ b/fs/xattr.c
@@ -150,7 +150,7 @@ vfs_listxattr(struct dentry *dentry, str
@@ -149,7 +149,7 @@ vfs_listxattr(struct dentry *dentry, str
struct inode *inode = dentry->d_inode;
ssize_t error;
@ -83,7 +83,7 @@ Signed-off-by: John Johansen <jjohansen@suse.de>
}
--- a/security/selinux/hooks.c
+++ b/security/selinux/hooks.c
@@ -2401,7 +2401,7 @@ static int selinux_inode_getxattr (struc
@@ -2399,7 +2399,7 @@ static int selinux_inode_getxattr (struc
return dentry_has_perm(current, NULL, dentry, FILE__GETATTR);
}

View file

@ -16,7 +16,7 @@ Signed-off-by: John Johansen <jjohansen@suse.de>
--- a/fs/namei.c
+++ b/fs/namei.c
@@ -1960,7 +1960,7 @@ int vfs_mkdir(struct inode *dir, struct
@@ -1948,7 +1948,7 @@ int vfs_mkdir(struct inode *dir, struct
return -EPERM;
mode &= (S_IRWXUGO|S_ISVTX);
@ -80,7 +80,7 @@ Signed-off-by: John Johansen <jjohansen@suse.de>
}
--- a/security/selinux/hooks.c
+++ b/security/selinux/hooks.c
@@ -2209,7 +2209,8 @@ static int selinux_inode_symlink(struct
@@ -2207,7 +2207,8 @@ static int selinux_inode_symlink(struct
return may_create(dir, dentry, SECCLASS_LNK_FILE);
}

View file

@ -16,7 +16,7 @@ Signed-off-by: John Johansen <jjohansen@suse.de>
--- a/fs/namei.c
+++ b/fs/namei.c
@@ -1883,7 +1883,7 @@ int vfs_mknod(struct inode *dir, struct
@@ -1871,7 +1871,7 @@ int vfs_mknod(struct inode *dir, struct
if (!dir->i_op || !dir->i_op->mknod)
return -EPERM;
@ -79,7 +79,7 @@ Signed-off-by: John Johansen <jjohansen@suse.de>
}
--- a/security/selinux/hooks.c
+++ b/security/selinux/hooks.c
@@ -2220,11 +2220,12 @@ static int selinux_inode_rmdir(struct in
@@ -2218,11 +2218,12 @@ static int selinux_inode_rmdir(struct in
return may_link(dir, dentry, MAY_RMDIR);
}

View file

@ -16,7 +16,7 @@ Signed-off-by: John Johansen <jjohansen@suse.de>
--- a/fs/stat.c
+++ b/fs/stat.c
@@ -307,7 +307,7 @@ asmlinkage long sys_readlinkat(int dfd,
@@ -306,7 +306,7 @@ asmlinkage long sys_readlinkat(int dfd,
error = -EINVAL;
if (inode->i_op && inode->i_op->readlink) {
@ -82,7 +82,7 @@ Signed-off-by: John Johansen <jjohansen@suse.de>
}
--- a/security/selinux/hooks.c
+++ b/security/selinux/hooks.c
@@ -2239,7 +2239,7 @@ static int selinux_inode_rename(struct i
@@ -2237,7 +2237,7 @@ static int selinux_inode_rename(struct i
return may_rename(old_inode, old_dentry, new_inode, new_dentry);
}

View file

@ -17,7 +17,7 @@ Signed-off-by: John Johansen <jjohansen@suse.de>
--- a/fs/xattr.c
+++ b/fs/xattr.c
@@ -178,7 +178,7 @@ vfs_removexattr(struct dentry *dentry, s
@@ -177,7 +177,7 @@ vfs_removexattr(struct dentry *dentry, s
if (error)
return error;
@ -77,7 +77,7 @@ Signed-off-by: John Johansen <jjohansen@suse.de>
static inline const char *security_inode_xattr_getsuffix (void)
--- a/security/commoncap.c
+++ b/security/commoncap.c
@@ -201,7 +201,8 @@ int cap_inode_setxattr(struct dentry *de
@@ -200,7 +200,8 @@ int cap_inode_setxattr(struct dentry *de
return 0;
}
@ -101,7 +101,7 @@ Signed-off-by: John Johansen <jjohansen@suse.de>
sizeof(XATTR_SECURITY_PREFIX) - 1) &&
--- a/security/selinux/hooks.c
+++ b/security/selinux/hooks.c
@@ -2406,7 +2406,8 @@ static int selinux_inode_listxattr (stru
@@ -2404,7 +2404,8 @@ static int selinux_inode_listxattr (stru
return dentry_has_perm(current, NULL, dentry, FILE__GETATTR);
}

View file

@ -16,7 +16,7 @@ Signed-off-by: John Johansen <jjohansen@suse.de>
--- a/fs/namei.c
+++ b/fs/namei.c
@@ -2431,7 +2431,8 @@ static int vfs_rename_dir(struct inode *
@@ -2419,7 +2419,8 @@ static int vfs_rename_dir(struct inode *
return error;
}
@ -26,7 +26,7 @@ Signed-off-by: John Johansen <jjohansen@suse.de>
if (error)
return error;
@@ -2465,7 +2466,8 @@ static int vfs_rename_other(struct inode
@@ -2453,7 +2454,8 @@ static int vfs_rename_other(struct inode
struct inode *target;
int error;
@ -108,7 +108,7 @@ Signed-off-by: John Johansen <jjohansen@suse.de>
}
--- a/security/selinux/hooks.c
+++ b/security/selinux/hooks.c
@@ -2240,8 +2240,12 @@ static int selinux_inode_mknod(struct in
@@ -2238,8 +2238,12 @@ static int selinux_inode_mknod(struct in
return may_create(dir, dentry, inode_mode_to_security_class(mode));
}

View file

@ -16,7 +16,7 @@ Signed-off-by: John Johansen <jjohansen@suse.de>
--- a/fs/namei.c
+++ b/fs/namei.c
@@ -2055,7 +2055,7 @@ int vfs_rmdir(struct inode *dir, struct
@@ -2043,7 +2043,7 @@ int vfs_rmdir(struct inode *dir, struct
if (d_mountpoint(dentry))
error = -EBUSY;
else {
@ -84,7 +84,7 @@ Signed-off-by: John Johansen <jjohansen@suse.de>
}
--- a/security/selinux/hooks.c
+++ b/security/selinux/hooks.c
@@ -2221,7 +2221,8 @@ static int selinux_inode_mkdir(struct in
@@ -2219,7 +2219,8 @@ static int selinux_inode_mkdir(struct in
return may_create(dir, dentry, SECCLASS_DIR);
}

View file

@ -16,7 +16,7 @@ Signed-off-by: John Johansen <jjohansen@suse.de>
--- a/fs/attr.c
+++ b/fs/attr.c
@@ -145,13 +145,13 @@ int notify_change(struct dentry *dentry,
@@ -144,13 +144,13 @@ int notify_change(struct dentry *dentry,
down_write(&dentry->d_inode->i_alloc_sem);
if (inode->i_op && inode->i_op->setattr) {
@ -88,7 +88,7 @@ Signed-off-by: John Johansen <jjohansen@suse.de>
}
--- a/security/selinux/hooks.c
+++ b/security/selinux/hooks.c
@@ -2269,11 +2269,12 @@ static int selinux_inode_permission(stru
@@ -2267,11 +2267,12 @@ static int selinux_inode_permission(stru
file_mask_to_av(inode->i_mode, mask), NULL);
}

View file

@ -17,7 +17,7 @@ Signed-off-by: John Johansen <jjohansen@suse.de>
--- a/fs/xattr.c
+++ b/fs/xattr.c
@@ -81,7 +81,7 @@ vfs_setxattr(struct dentry *dentry, stru
@@ -80,7 +80,7 @@ vfs_setxattr(struct dentry *dentry, stru
return error;
mutex_lock(&inode->i_mutex);
@ -26,7 +26,7 @@ Signed-off-by: John Johansen <jjohansen@suse.de>
if (error)
goto out;
error = -EOPNOTSUPP;
@@ -89,7 +89,7 @@ vfs_setxattr(struct dentry *dentry, stru
@@ -88,7 +88,7 @@ vfs_setxattr(struct dentry *dentry, stru
error = inode->i_op->setxattr(dentry, name, value, size, flags);
if (!error) {
fsnotify_xattr(dentry);
@ -130,7 +130,7 @@ Signed-off-by: John Johansen <jjohansen@suse.de>
static inline int security_inode_getxattr (struct dentry *dentry, char *name)
--- a/security/commoncap.c
+++ b/security/commoncap.c
@@ -191,8 +191,8 @@ int cap_bprm_secureexec (struct linux_bi
@@ -190,8 +190,8 @@ int cap_bprm_secureexec (struct linux_bi
current->egid != current->gid);
}
@ -168,7 +168,7 @@ Signed-off-by: John Johansen <jjohansen@suse.de>
}
--- a/security/selinux/hooks.c
+++ b/security/selinux/hooks.c
@@ -2307,7 +2307,9 @@ static int selinux_inode_getattr(struct
@@ -2305,7 +2305,9 @@ static int selinux_inode_getattr(struct
return dentry_has_perm(current, mnt, dentry, FILE__GETATTR);
}
@ -179,7 +179,7 @@ Signed-off-by: John Johansen <jjohansen@suse.de>
{
struct task_security_struct *tsec = current->security;
struct inode *inode = dentry->d_inode;
@@ -2367,7 +2369,9 @@ static int selinux_inode_setxattr(struct
@@ -2365,7 +2367,9 @@ static int selinux_inode_setxattr(struct
&ad);
}

View file

@ -16,7 +16,7 @@ Signed-off-by: John Johansen <jjohansen@suse.de>
--- a/fs/namei.c
+++ b/fs/namei.c
@@ -2228,7 +2228,7 @@ int vfs_symlink(struct inode *dir, struc
@@ -2216,7 +2216,7 @@ int vfs_symlink(struct inode *dir, struc
if (!dir->i_op || !dir->i_op->symlink)
return -EPERM;
@ -81,7 +81,7 @@ Signed-off-by: John Johansen <jjohansen@suse.de>
}
--- a/security/selinux/hooks.c
+++ b/security/selinux/hooks.c
@@ -2204,7 +2204,8 @@ static int selinux_inode_unlink(struct i
@@ -2202,7 +2202,8 @@ static int selinux_inode_unlink(struct i
return may_link(dir, dentry, MAY_UNLINK);
}

View file

@ -16,7 +16,7 @@ Signed-off-by: John Johansen <jjohansen@suse.de>
--- a/fs/namei.c
+++ b/fs/namei.c
@@ -2135,7 +2135,7 @@ int vfs_unlink(struct inode *dir, struct
@@ -2123,7 +2123,7 @@ int vfs_unlink(struct inode *dir, struct
if (d_mountpoint(dentry))
error = -EBUSY;
else {
@ -84,7 +84,7 @@ Signed-off-by: John Johansen <jjohansen@suse.de>
}
--- a/security/selinux/hooks.c
+++ b/security/selinux/hooks.c
@@ -2199,11 +2199,12 @@ static int selinux_inode_link(struct den
@@ -2197,11 +2197,12 @@ static int selinux_inode_link(struct den
return may_link(dir, old_dentry, MAY_LINK);
}

View file

@ -10,16 +10,16 @@ Signed-off-by: John Johansen <jjohansen@suse.de>
---
fs/xattr.c | 58 ++++++++++++++++++++++++-----------------------
include/linux/security.h | 37 +++++++++++++++++------------
include/linux/security.h | 53 +++++++++++++++++++++++++-----------------
include/linux/xattr.h | 8 +++---
security/commoncap.c | 4 +--
security/dummy.c | 10 ++++----
security/selinux/hooks.c | 10 ++++----
6 files changed, 70 insertions(+), 57 deletions(-)
6 files changed, 80 insertions(+), 63 deletions(-)
--- a/fs/xattr.c
+++ b/fs/xattr.c
@@ -71,7 +71,7 @@ xattr_permission(struct inode *inode, co
@@ -70,7 +70,7 @@ xattr_permission(struct inode *inode, co
int
vfs_setxattr(struct dentry *dentry, struct vfsmount *mnt, char *name,
@ -28,7 +28,7 @@ Signed-off-by: John Johansen <jjohansen@suse.de>
{
struct inode *inode = dentry->d_inode;
int error;
@@ -81,7 +81,7 @@ vfs_setxattr(struct dentry *dentry, stru
@@ -80,7 +80,7 @@ vfs_setxattr(struct dentry *dentry, stru
return error;
mutex_lock(&inode->i_mutex);
@ -37,7 +37,7 @@ Signed-off-by: John Johansen <jjohansen@suse.de>
if (error)
goto out;
error = -EOPNOTSUPP;
@@ -108,7 +108,7 @@ EXPORT_SYMBOL_GPL(vfs_setxattr);
@@ -107,7 +107,7 @@ EXPORT_SYMBOL_GPL(vfs_setxattr);
ssize_t
vfs_getxattr(struct dentry *dentry, struct vfsmount *mnt, char *name,
@ -46,7 +46,7 @@ Signed-off-by: John Johansen <jjohansen@suse.de>
{
struct inode *inode = dentry->d_inode;
int error;
@@ -117,7 +117,7 @@ vfs_getxattr(struct dentry *dentry, stru
@@ -116,7 +116,7 @@ vfs_getxattr(struct dentry *dentry, stru
if (error)
return error;
@ -55,7 +55,7 @@ Signed-off-by: John Johansen <jjohansen@suse.de>
if (error)
return error;
@@ -145,12 +145,12 @@ EXPORT_SYMBOL_GPL(vfs_getxattr);
@@ -144,12 +144,12 @@ EXPORT_SYMBOL_GPL(vfs_getxattr);
ssize_t
vfs_listxattr(struct dentry *dentry, struct vfsmount *mnt, char *list,
@ -70,7 +70,7 @@ Signed-off-by: John Johansen <jjohansen@suse.de>
if (error)
return error;
error = -EOPNOTSUPP;
@@ -166,7 +166,8 @@ vfs_listxattr(struct dentry *dentry, str
@@ -165,7 +165,8 @@ vfs_listxattr(struct dentry *dentry, str
EXPORT_SYMBOL_GPL(vfs_listxattr);
int
@ -80,7 +80,7 @@ Signed-off-by: John Johansen <jjohansen@suse.de>
{
struct inode *inode = dentry->d_inode;
int error;
@@ -178,7 +179,7 @@ vfs_removexattr(struct dentry *dentry, s
@@ -177,7 +178,7 @@ vfs_removexattr(struct dentry *dentry, s
if (error)
return error;
@ -89,7 +89,7 @@ Signed-off-by: John Johansen <jjohansen@suse.de>
if (error)
return error;
@@ -198,7 +199,7 @@ EXPORT_SYMBOL_GPL(vfs_removexattr);
@@ -197,7 +198,7 @@ EXPORT_SYMBOL_GPL(vfs_removexattr);
*/
static long
setxattr(struct dentry *dentry, struct vfsmount *mnt, char __user *name,
@ -98,7 +98,7 @@ Signed-off-by: John Johansen <jjohansen@suse.de>
{
int error;
void *kvalue = NULL;
@@ -225,7 +226,7 @@ setxattr(struct dentry *dentry, struct v
@@ -224,7 +225,7 @@ setxattr(struct dentry *dentry, struct v
}
}
@ -107,7 +107,7 @@ Signed-off-by: John Johansen <jjohansen@suse.de>
kfree(kvalue);
return error;
}
@@ -240,7 +241,7 @@ sys_setxattr(char __user *path, char __u
@@ -239,7 +240,7 @@ sys_setxattr(char __user *path, char __u
error = user_path_walk(path, &nd);
if (error)
return error;
@ -116,7 +116,7 @@ Signed-off-by: John Johansen <jjohansen@suse.de>
path_release(&nd);
return error;
}
@@ -255,7 +256,7 @@ sys_lsetxattr(char __user *path, char __
@@ -254,7 +255,7 @@ sys_lsetxattr(char __user *path, char __
error = user_path_walk_link(path, &nd);
if (error)
return error;
@ -125,7 +125,7 @@ Signed-off-by: John Johansen <jjohansen@suse.de>
path_release(&nd);
return error;
}
@@ -273,7 +274,7 @@ sys_fsetxattr(int fd, char __user *name,
@@ -272,7 +273,7 @@ sys_fsetxattr(int fd, char __user *name,
return error;
dentry = f->f_path.dentry;
audit_inode(NULL, dentry->d_inode);
@ -134,7 +134,7 @@ Signed-off-by: John Johansen <jjohansen@suse.de>
fput(f);
return error;
}
@@ -283,7 +284,7 @@ sys_fsetxattr(int fd, char __user *name,
@@ -282,7 +283,7 @@ sys_fsetxattr(int fd, char __user *name,
*/
static ssize_t
getxattr(struct dentry *dentry, struct vfsmount *mnt, char __user *name,
@ -143,7 +143,7 @@ Signed-off-by: John Johansen <jjohansen@suse.de>
{
ssize_t error;
void *kvalue = NULL;
@@ -303,7 +304,7 @@ getxattr(struct dentry *dentry, struct v
@@ -302,7 +303,7 @@ getxattr(struct dentry *dentry, struct v
return -ENOMEM;
}
@ -152,7 +152,7 @@ Signed-off-by: John Johansen <jjohansen@suse.de>
if (error > 0) {
if (size && copy_to_user(value, kvalue, error))
error = -EFAULT;
@@ -326,7 +327,7 @@ sys_getxattr(char __user *path, char __u
@@ -325,7 +326,7 @@ sys_getxattr(char __user *path, char __u
error = user_path_walk(path, &nd);
if (error)
return error;
@ -161,7 +161,7 @@ Signed-off-by: John Johansen <jjohansen@suse.de>
path_release(&nd);
return error;
}
@@ -341,7 +342,7 @@ sys_lgetxattr(char __user *path, char __
@@ -340,7 +341,7 @@ sys_lgetxattr(char __user *path, char __
error = user_path_walk_link(path, &nd);
if (error)
return error;
@ -170,7 +170,7 @@ Signed-off-by: John Johansen <jjohansen@suse.de>
path_release(&nd);
return error;
}
@@ -355,7 +356,7 @@ sys_fgetxattr(int fd, char __user *name,
@@ -354,7 +355,7 @@ sys_fgetxattr(int fd, char __user *name,
f = fget(fd);
if (!f)
return error;
@ -179,7 +179,7 @@ Signed-off-by: John Johansen <jjohansen@suse.de>
fput(f);
return error;
}
@@ -365,7 +366,7 @@ sys_fgetxattr(int fd, char __user *name,
@@ -364,7 +365,7 @@ sys_fgetxattr(int fd, char __user *name,
*/
static ssize_t
listxattr(struct dentry *dentry, struct vfsmount *mnt, char __user *list,
@ -188,7 +188,7 @@ Signed-off-by: John Johansen <jjohansen@suse.de>
{
ssize_t error;
char *klist = NULL;
@@ -378,7 +379,7 @@ listxattr(struct dentry *dentry, struct
@@ -377,7 +378,7 @@ listxattr(struct dentry *dentry, struct
return -ENOMEM;
}
@ -197,7 +197,7 @@ Signed-off-by: John Johansen <jjohansen@suse.de>
if (error > 0) {
if (size && copy_to_user(list, klist, error))
error = -EFAULT;
@@ -400,7 +401,7 @@ sys_listxattr(char __user *path, char __
@@ -399,7 +400,7 @@ sys_listxattr(char __user *path, char __
error = user_path_walk(path, &nd);
if (error)
return error;
@ -206,7 +206,7 @@ Signed-off-by: John Johansen <jjohansen@suse.de>
path_release(&nd);
return error;
}
@@ -414,7 +415,7 @@ sys_llistxattr(char __user *path, char _
@@ -413,7 +414,7 @@ sys_llistxattr(char __user *path, char _
error = user_path_walk_link(path, &nd);
if (error)
return error;
@ -215,7 +215,7 @@ Signed-off-by: John Johansen <jjohansen@suse.de>
path_release(&nd);
return error;
}
@@ -428,7 +429,7 @@ sys_flistxattr(int fd, char __user *list
@@ -427,7 +428,7 @@ sys_flistxattr(int fd, char __user *list
f = fget(fd);
if (!f)
return error;
@ -224,7 +224,7 @@ Signed-off-by: John Johansen <jjohansen@suse.de>
fput(f);
return error;
}
@@ -437,7 +438,8 @@ sys_flistxattr(int fd, char __user *list
@@ -436,7 +437,8 @@ sys_flistxattr(int fd, char __user *list
* Extended attribute REMOVE operations
*/
static long
@ -234,7 +234,7 @@ Signed-off-by: John Johansen <jjohansen@suse.de>
{
int error;
char kname[XATTR_NAME_MAX + 1];
@@ -448,7 +450,7 @@ removexattr(struct dentry *dentry, struc
@@ -447,7 +449,7 @@ removexattr(struct dentry *dentry, struc
if (error < 0)
return error;
@ -243,7 +243,7 @@ Signed-off-by: John Johansen <jjohansen@suse.de>
}
asmlinkage long
@@ -460,7 +462,7 @@ sys_removexattr(char __user *path, char
@@ -459,7 +461,7 @@ sys_removexattr(char __user *path, char
error = user_path_walk(path, &nd);
if (error)
return error;
@ -252,7 +252,7 @@ Signed-off-by: John Johansen <jjohansen@suse.de>
path_release(&nd);
return error;
}
@@ -474,7 +476,7 @@ sys_lremovexattr(char __user *path, char
@@ -473,7 +475,7 @@ sys_lremovexattr(char __user *path, char
error = user_path_walk_link(path, &nd);
if (error)
return error;
@ -261,7 +261,7 @@ Signed-off-by: John Johansen <jjohansen@suse.de>
path_release(&nd);
return error;
}
@@ -491,7 +493,7 @@ sys_fremovexattr(int fd, char __user *na
@@ -490,7 +492,7 @@ sys_fremovexattr(int fd, char __user *na
return error;
dentry = f->f_path.dentry;
audit_inode(NULL, dentry->d_inode);
@ -365,6 +365,48 @@ Signed-off-by: John Johansen <jjohansen@suse.de>
}
static inline const char *security_inode_xattr_getsuffix(void)
@@ -2480,9 +2487,10 @@ static inline void security_inode_delete
static inline int security_inode_setxattr (struct dentry *dentry,
struct vfsmount *mnt, char *name,
- void *value, size_t size, int flags)
+ void *value, size_t size, int flags,
+ struct file *file)
{
- return cap_inode_setxattr(dentry, mnt, name, value, size, flags);
+ return cap_inode_setxattr(dentry, mnt, name, value, size, flags, file);
}
static inline void security_inode_post_setxattr (struct dentry *dentry,
@@ -2493,21 +2501,24 @@ static inline void security_inode_post_s
{ }
static inline int security_inode_getxattr (struct dentry *dentry,
- struct vfsmount *mnt, char *name)
+ struct vfsmount *mnt, char *name,
+ struct file *file)
{
return 0;
}
static inline int security_inode_listxattr (struct dentry *dentry,
- struct vfsmount *mnt)
+ struct vfsmount *mnt,
+ struct file *file)
{
return 0;
}
static inline int security_inode_removexattr (struct dentry *dentry,
- struct vfsmount *mnt, char *name)
+ struct vfsmount *mnt, char *name,
+ struct file *file)
{
- return cap_inode_removexattr(dentry, mnt, name);
+ return cap_inode_removexattr(dentry, mnt, name, file);
}
static inline const char *security_inode_xattr_getsuffix (void)
--- a/include/linux/xattr.h
+++ b/include/linux/xattr.h
@@ -47,12 +47,12 @@ struct xattr_handler {
@ -386,7 +428,7 @@ Signed-off-by: John Johansen <jjohansen@suse.de>
ssize_t generic_listxattr(struct dentry *dentry, char *buffer, size_t buffer_size);
--- a/security/commoncap.c
+++ b/security/commoncap.c
@@ -192,7 +192,7 @@ int cap_bprm_secureexec (struct linux_bi
@@ -191,7 +191,7 @@ int cap_bprm_secureexec (struct linux_bi
}
int cap_inode_setxattr(struct dentry *dentry, struct vfsmount *mnt, char *name,
@ -395,7 +437,7 @@ Signed-off-by: John Johansen <jjohansen@suse.de>
{
if (!strncmp(name, XATTR_SECURITY_PREFIX,
sizeof(XATTR_SECURITY_PREFIX) - 1) &&
@@ -202,7 +202,7 @@ int cap_inode_setxattr(struct dentry *de
@@ -201,7 +201,7 @@ int cap_inode_setxattr(struct dentry *de
}
int cap_inode_removexattr(struct dentry *dentry, struct vfsmount *mnt,
@ -441,7 +483,7 @@ Signed-off-by: John Johansen <jjohansen@suse.de>
sizeof(XATTR_SECURITY_PREFIX) - 1) &&
--- a/security/selinux/hooks.c
+++ b/security/selinux/hooks.c
@@ -2309,7 +2309,7 @@ static int selinux_inode_getattr(struct
@@ -2307,7 +2307,7 @@ static int selinux_inode_getattr(struct
static int selinux_inode_setxattr(struct dentry *dentry, struct vfsmount *mnt,
char *name, void *value, size_t size,
@ -450,7 +492,7 @@ Signed-off-by: John Johansen <jjohansen@suse.de>
{
struct task_security_struct *tsec = current->security;
struct inode *inode = dentry->d_inode;
@@ -2396,18 +2396,20 @@ static void selinux_inode_post_setxattr(
@@ -2394,18 +2394,20 @@ static void selinux_inode_post_setxattr(
}
static int selinux_inode_getxattr (struct dentry *dentry, struct vfsmount *mnt,

View file

@ -1,6 +1,7 @@
fix-CONFIG_MMC_DEBUG.diff
security-create.diff
proc_setattr.diff
proc_sys_setattr.diff
#proc_setattr.diff
#proc_sys_setattr.diff
remove_suid.diff
vfs-notify_change.diff
security-setattr.diff

View file

@ -12,7 +12,7 @@ Signed-off-by: Andreas Gruenbacher <agruen@suse.de>
--- a/fs/open.c
+++ b/fs/open.c
@@ -438,10 +438,8 @@ out:
@@ -440,10 +440,8 @@ out:
asmlinkage long sys_fchdir(unsigned int fd)
{
@ -24,7 +24,7 @@ Signed-off-by: Andreas Gruenbacher <agruen@suse.de>
int error;
error = -EBADF;
@@ -449,17 +447,17 @@ asmlinkage long sys_fchdir(unsigned int
@@ -451,17 +449,17 @@ asmlinkage long sys_fchdir(unsigned int
if (!file)
goto out;

View file

@ -17,7 +17,7 @@
void __user *newval, size_t newlen);
--- a/kernel/sysctl.c
+++ b/kernel/sysctl.c
@@ -1087,6 +1087,33 @@ struct ctl_table_header *sysctl_head_nex
@@ -1098,6 +1098,33 @@ struct ctl_table_header *sysctl_head_nex
return NULL;
}
@ -53,7 +53,7 @@
void __user *newval, size_t newlen)
--- a/security/selinux/hooks.c
+++ b/security/selinux/hooks.c
@@ -1428,40 +1428,15 @@ static int selinux_capable(struct task_s
@@ -1427,40 +1427,15 @@ static int selinux_capable(struct task_s
static int selinux_sysctl_get_sid(ctl_table *table, u16 tclass, u32 *sid)
{

View file

@ -31,7 +31,7 @@ Acked-by: Alan Cox <alan@lxorguk.ukuu.org.uk>
--- a/fs/dcache.c
+++ b/fs/dcache.c
@@ -1732,52 +1732,51 @@ shouldnt_be_hashed:
@@ -1761,52 +1761,51 @@ shouldnt_be_hashed:
}
/**
@ -111,7 +111,7 @@ Acked-by: Alan Cox <alan@lxorguk.ukuu.org.uk>
spin_lock(&vfsmount_lock);
if (vfsmnt->mnt_parent == vfsmnt) {
spin_unlock(&vfsmount_lock);
@@ -1791,33 +1790,72 @@ static char * __d_path( struct dentry *d
@@ -1820,33 +1819,72 @@ static char * __d_path( struct dentry *d
parent = dentry->d_parent;
prefetch(parent);
namelen = dentry->d_name.len;
@ -199,7 +199,7 @@ Acked-by: Alan Cox <alan@lxorguk.ukuu.org.uk>
{
char *res;
struct vfsmount *rootmnt;
@@ -1827,9 +1865,8 @@ char * d_path(struct dentry *dentry, str
@@ -1866,9 +1904,8 @@ char * d_path(struct dentry *dentry, str
rootmnt = mntget(current->fs->rootmnt);
root = dget(current->fs->root);
read_unlock(&current->fs->lock);
@ -211,7 +211,7 @@ Acked-by: Alan Cox <alan@lxorguk.ukuu.org.uk>
dput(root);
mntput(rootmnt);
return res;
@@ -1855,10 +1892,10 @@ char * d_path(struct dentry *dentry, str
@@ -1915,10 +1952,10 @@ char *dynamic_dname(struct dentry *dentr
*/
asmlinkage long sys_getcwd(char __user *buf, unsigned long size)
{
@ -224,7 +224,7 @@ Acked-by: Alan Cox <alan@lxorguk.ukuu.org.uk>
if (!page)
return -ENOMEM;
@@ -1870,29 +1907,19 @@ asmlinkage long sys_getcwd(char __user *
@@ -1930,29 +1967,19 @@ asmlinkage long sys_getcwd(char __user *
root = dget(current->fs->root);
read_unlock(&current->fs->lock);

View file

@ -18,7 +18,7 @@ Signed-off-by: John Johansen <jjohansen@suse.de>
--- a/fs/nfsd/nfs4xdr.c
+++ b/fs/nfsd/nfs4xdr.c
@@ -1470,7 +1470,7 @@ nfsd4_encode_fattr(struct svc_fh *fhp, s
@@ -1469,7 +1469,7 @@ nfsd4_encode_fattr(struct svc_fh *fhp, s
}
if (bmval0 & (FATTR4_WORD0_ACL | FATTR4_WORD0_ACLSUPPORT
| FATTR4_WORD0_SUPPORTED_ATTRS)) {
@ -108,7 +108,7 @@ Signed-off-by: John Johansen <jjohansen@suse.de>
--- a/fs/xattr.c
+++ b/fs/xattr.c
@@ -107,7 +107,8 @@ out:
@@ -106,7 +106,8 @@ out:
EXPORT_SYMBOL_GPL(vfs_setxattr);
ssize_t
@ -118,7 +118,7 @@ Signed-off-by: John Johansen <jjohansen@suse.de>
{
struct inode *inode = dentry->d_inode;
int error;
@@ -279,7 +280,8 @@ sys_fsetxattr(int fd, char __user *name,
@@ -278,7 +279,8 @@ sys_fsetxattr(int fd, char __user *name,
* Extended attribute GET operations
*/
static ssize_t
@ -128,7 +128,7 @@ Signed-off-by: John Johansen <jjohansen@suse.de>
{
ssize_t error;
void *kvalue = NULL;
@@ -299,7 +301,7 @@ getxattr(struct dentry *d, char __user *
@@ -298,7 +300,7 @@ getxattr(struct dentry *d, char __user *
return -ENOMEM;
}
@ -137,7 +137,7 @@ Signed-off-by: John Johansen <jjohansen@suse.de>
if (error > 0) {
if (size && copy_to_user(value, kvalue, error))
error = -EFAULT;
@@ -322,7 +324,7 @@ sys_getxattr(char __user *path, char __u
@@ -321,7 +323,7 @@ sys_getxattr(char __user *path, char __u
error = user_path_walk(path, &nd);
if (error)
return error;
@ -146,7 +146,7 @@ Signed-off-by: John Johansen <jjohansen@suse.de>
path_release(&nd);
return error;
}
@@ -337,7 +339,7 @@ sys_lgetxattr(char __user *path, char __
@@ -336,7 +338,7 @@ sys_lgetxattr(char __user *path, char __
error = user_path_walk_link(path, &nd);
if (error)
return error;
@ -155,7 +155,7 @@ Signed-off-by: John Johansen <jjohansen@suse.de>
path_release(&nd);
return error;
}
@@ -351,7 +353,7 @@ sys_fgetxattr(int fd, char __user *name,
@@ -350,7 +352,7 @@ sys_fgetxattr(int fd, char __user *name,
f = fget(fd);
if (!f)
return error;

View file

@ -46,7 +46,7 @@ Signed-off-by: John Johansen <jjohansen@suse.de>
rc = ecryptfs_interpose(lower_new_dentry, new_dentry, dir->i_sb, 0);
--- a/fs/namei.c
+++ b/fs/namei.c
@@ -2282,7 +2282,7 @@ asmlinkage long sys_symlink(const char _
@@ -2270,7 +2270,7 @@ asmlinkage long sys_symlink(const char _
return sys_symlinkat(oldname, AT_FDCWD, newname);
}
@ -55,7 +55,7 @@ Signed-off-by: John Johansen <jjohansen@suse.de>
{
struct inode *inode = old_dentry->d_inode;
int error;
@@ -2360,7 +2360,8 @@ asmlinkage long sys_linkat(int olddfd, c
@@ -2348,7 +2348,8 @@ asmlinkage long sys_linkat(int olddfd, c
error = PTR_ERR(new_dentry);
if (IS_ERR(new_dentry))
goto out_unlock;
@ -79,7 +79,7 @@ Signed-off-by: John Johansen <jjohansen@suse.de>
err = nfserrno(nfsd_sync_dir(ddir));
--- a/include/linux/fs.h
+++ b/include/linux/fs.h
@@ -988,7 +988,7 @@ extern int vfs_create(struct inode *, st
@@ -995,7 +995,7 @@ extern int vfs_create(struct inode *, st
extern int vfs_mkdir(struct inode *, struct dentry *, struct vfsmount *, int);
extern int vfs_mknod(struct inode *, struct dentry *, struct vfsmount *, int, dev_t);
extern int vfs_symlink(struct inode *, struct dentry *, struct vfsmount *, const char *, int);

View file

@ -15,7 +15,7 @@ Signed-off-by: John Johansen <jjohansen@suse.de>
--- a/fs/xattr.c
+++ b/fs/xattr.c
@@ -144,18 +144,20 @@ vfs_getxattr(struct dentry *dentry, stru
@@ -143,18 +143,20 @@ vfs_getxattr(struct dentry *dentry, stru
EXPORT_SYMBOL_GPL(vfs_getxattr);
ssize_t
@ -42,7 +42,7 @@ Signed-off-by: John Johansen <jjohansen@suse.de>
if (size && error > size)
error = -ERANGE;
}
@@ -362,7 +364,8 @@ sys_fgetxattr(int fd, char __user *name,
@@ -361,7 +363,8 @@ sys_fgetxattr(int fd, char __user *name,
* Extended attribute LIST operations
*/
static ssize_t
@ -52,7 +52,7 @@ Signed-off-by: John Johansen <jjohansen@suse.de>
{
ssize_t error;
char *klist = NULL;
@@ -375,7 +378,7 @@ listxattr(struct dentry *d, char __user
@@ -374,7 +377,7 @@ listxattr(struct dentry *d, char __user
return -ENOMEM;
}
@ -61,7 +61,7 @@ Signed-off-by: John Johansen <jjohansen@suse.de>
if (error > 0) {
if (size && copy_to_user(list, klist, error))
error = -EFAULT;
@@ -397,7 +400,7 @@ sys_listxattr(char __user *path, char __
@@ -396,7 +399,7 @@ sys_listxattr(char __user *path, char __
error = user_path_walk(path, &nd);
if (error)
return error;
@ -70,7 +70,7 @@ Signed-off-by: John Johansen <jjohansen@suse.de>
path_release(&nd);
return error;
}
@@ -411,7 +414,7 @@ sys_llistxattr(char __user *path, char _
@@ -410,7 +413,7 @@ sys_llistxattr(char __user *path, char _
error = user_path_walk_link(path, &nd);
if (error)
return error;
@ -79,7 +79,7 @@ Signed-off-by: John Johansen <jjohansen@suse.de>
path_release(&nd);
return error;
}
@@ -425,7 +428,7 @@ sys_flistxattr(int fd, char __user *list
@@ -424,7 +427,7 @@ sys_flistxattr(int fd, char __user *list
f = fget(fd);
if (!f)
return error;

View file

@ -36,7 +36,7 @@ Signed-off-by: John Johansen <jjohansen@suse.de>
rc = ecryptfs_interpose(lower_dentry, dentry, dir->i_sb, 0);
--- a/fs/namei.c
+++ b/fs/namei.c
@@ -1948,7 +1948,8 @@ asmlinkage long sys_mknod(const char __u
@@ -1936,7 +1936,8 @@ asmlinkage long sys_mknod(const char __u
return sys_mknodat(AT_FDCWD, filename, mode, dev);
}
@ -46,7 +46,7 @@ Signed-off-by: John Johansen <jjohansen@suse.de>
{
int error = may_create(dir, dentry, NULL);
@@ -1992,7 +1993,7 @@ asmlinkage long sys_mkdirat(int dfd, con
@@ -1980,7 +1981,7 @@ asmlinkage long sys_mkdirat(int dfd, con
if (!IS_POSIXACL(nd.dentry->d_inode))
mode &= ~current->fs->umask;
@ -114,7 +114,7 @@ Signed-off-by: John Johansen <jjohansen@suse.de>
}
--- a/include/linux/fs.h
+++ b/include/linux/fs.h
@@ -985,7 +985,7 @@ extern void unlock_super(struct super_bl
@@ -992,7 +992,7 @@ extern void unlock_super(struct super_bl
*/
extern int vfs_permission(struct nameidata *, int);
extern int vfs_create(struct inode *, struct dentry *, int, struct nameidata *);

View file

@ -36,7 +36,7 @@ Signed-off-by: John Johansen <jjohansen@suse.de>
rc = ecryptfs_interpose(lower_dentry, dentry, dir->i_sb, 0);
--- a/fs/namei.c
+++ b/fs/namei.c
@@ -1869,7 +1869,8 @@ fail:
@@ -1857,7 +1857,8 @@ fail:
}
EXPORT_SYMBOL_GPL(lookup_create);
@ -46,7 +46,7 @@ Signed-off-by: John Johansen <jjohansen@suse.de>
{
int error = may_create(dir, dentry, NULL);
@@ -1921,11 +1922,12 @@ asmlinkage long sys_mknodat(int dfd, con
@@ -1909,11 +1910,12 @@ asmlinkage long sys_mknodat(int dfd, con
error = vfs_create(nd.dentry->d_inode,dentry,mode,&nd);
break;
case S_IFCHR: case S_IFBLK:
@ -76,7 +76,7 @@ Signed-off-by: John Johansen <jjohansen@suse.de>
printk("nfsd: bad file type %o in nfsd_create\n", type);
--- a/include/linux/fs.h
+++ b/include/linux/fs.h
@@ -986,7 +986,7 @@ extern void unlock_super(struct super_bl
@@ -993,7 +993,7 @@ extern void unlock_super(struct super_bl
extern int vfs_permission(struct nameidata *, int);
extern int vfs_create(struct inode *, struct dentry *, int, struct nameidata *);
extern int vfs_mkdir(struct inode *, struct dentry *, struct vfsmount *, int);
@ -87,7 +87,7 @@ Signed-off-by: John Johansen <jjohansen@suse.de>
extern int vfs_rmdir(struct inode *, struct dentry *);
--- a/net/unix/af_unix.c
+++ b/net/unix/af_unix.c
@@ -808,7 +808,7 @@ static int unix_bind(struct socket *sock
@@ -807,7 +807,7 @@ static int unix_bind(struct socket *sock
*/
mode = S_IFSOCK |
(SOCK_INODE(sock)->i_mode & ~current->fs->umask);

View file

@ -20,15 +20,15 @@ Signed-off-by: John Johansen <jjohansen@suse.de>
fs/open.c | 28 +++++++++++++++-------------
fs/reiserfs/xattr.c | 6 +++---
fs/sysfs/file.c | 2 +-
fs/utimes.c | 4 ++--
fs/utimes.c | 11 ++++++-----
include/linux/fs.h | 6 +++---
mm/filemap.c | 2 +-
mm/tiny-shmem.c | 2 +-
14 files changed, 41 insertions(+), 34 deletions(-)
14 files changed, 45 insertions(+), 37 deletions(-)
--- a/fs/attr.c
+++ b/fs/attr.c
@@ -101,7 +101,8 @@ int inode_setattr(struct inode * inode,
@@ -100,7 +100,8 @@ int inode_setattr(struct inode * inode,
}
EXPORT_SYMBOL(inode_setattr);
@ -66,7 +66,7 @@ Signed-off-by: John Johansen <jjohansen@suse.de>
return rc;
--- a/fs/exec.c
+++ b/fs/exec.c
@@ -1536,7 +1536,8 @@ int do_coredump(long signr, int exit_cod
@@ -1555,7 +1555,8 @@ int do_coredump(long signr, int exit_cod
goto close_fail;
if (!file->f_op->write)
goto close_fail;
@ -100,7 +100,7 @@ Signed-off-by: John Johansen <jjohansen@suse.de>
goto again;
--- a/fs/namei.c
+++ b/fs/namei.c
@@ -1612,7 +1612,8 @@ int may_open(struct nameidata *nd, int a
@@ -1600,7 +1600,8 @@ int may_open(struct nameidata *nd, int a
if (!error) {
DQUOT_INIT(inode);
@ -148,7 +148,7 @@ Signed-off-by: John Johansen <jjohansen@suse.de>
static ino_t last_ino;
--- a/fs/open.c
+++ b/fs/open.c
@@ -194,8 +194,8 @@ out:
@@ -193,8 +193,8 @@ out:
return error;
}
@ -159,8 +159,8 @@ Signed-off-by: John Johansen <jjohansen@suse.de>
{
int err;
struct iattr newattrs;
@@ -212,7 +212,7 @@ int do_truncate(struct dentry *dentry, l
}
@@ -214,7 +214,7 @@ int do_truncate(struct dentry *dentry, l
newattrs.ia_valid |= should_remove_suid(dentry);
mutex_lock(&dentry->d_inode->i_mutex);
- err = notify_change(dentry, &newattrs);
@ -168,7 +168,7 @@ Signed-off-by: John Johansen <jjohansen@suse.de>
mutex_unlock(&dentry->d_inode->i_mutex);
return err;
}
@@ -267,7 +267,7 @@ static long do_sys_truncate(const char _
@@ -269,7 +269,7 @@ static long do_sys_truncate(const char _
error = locks_verify_truncate(inode, NULL, length);
if (!error) {
DQUOT_INIT(inode);
@ -177,7 +177,7 @@ Signed-off-by: John Johansen <jjohansen@suse.de>
}
put_write_access(inode);
@@ -319,7 +319,8 @@ static long do_sys_ftruncate(unsigned in
@@ -321,7 +321,8 @@ static long do_sys_ftruncate(unsigned in
error = locks_verify_truncate(inode, file, length);
if (!error)
@ -187,7 +187,7 @@ Signed-off-by: John Johansen <jjohansen@suse.de>
out_putf:
fput(file);
out:
@@ -519,7 +520,7 @@ asmlinkage long sys_fchmod(unsigned int
@@ -521,7 +522,7 @@ asmlinkage long sys_fchmod(unsigned int
mode = inode->i_mode;
newattrs.ia_mode = (mode & S_IALLUGO) | (inode->i_mode & ~S_IALLUGO);
newattrs.ia_valid = ATTR_MODE | ATTR_CTIME;
@ -196,7 +196,7 @@ Signed-off-by: John Johansen <jjohansen@suse.de>
mutex_unlock(&inode->i_mutex);
out_putf:
@@ -554,7 +555,7 @@ asmlinkage long sys_fchmodat(int dfd, co
@@ -556,7 +557,7 @@ asmlinkage long sys_fchmodat(int dfd, co
mode = inode->i_mode;
newattrs.ia_mode = (mode & S_IALLUGO) | (inode->i_mode & ~S_IALLUGO);
newattrs.ia_valid = ATTR_MODE | ATTR_CTIME;
@ -205,7 +205,7 @@ Signed-off-by: John Johansen <jjohansen@suse.de>
mutex_unlock(&inode->i_mutex);
dput_and_out:
@@ -568,7 +569,8 @@ asmlinkage long sys_chmod(const char __u
@@ -570,7 +571,8 @@ asmlinkage long sys_chmod(const char __u
return sys_fchmodat(AT_FDCWD, filename, mode);
}
@ -215,7 +215,7 @@ Signed-off-by: John Johansen <jjohansen@suse.de>
{
struct inode * inode;
int error;
@@ -597,7 +599,7 @@ static int chown_common(struct dentry *
@@ -599,7 +601,7 @@ static int chown_common(struct dentry *
if (!S_ISDIR(inode->i_mode))
newattrs.ia_valid |= ATTR_KILL_SUID|ATTR_KILL_SGID;
mutex_lock(&inode->i_mutex);
@ -224,7 +224,7 @@ Signed-off-by: John Johansen <jjohansen@suse.de>
mutex_unlock(&inode->i_mutex);
out:
return error;
@@ -611,7 +613,7 @@ asmlinkage long sys_chown(const char __u
@@ -613,7 +615,7 @@ asmlinkage long sys_chown(const char __u
error = user_path_walk(filename, &nd);
if (error)
goto out;
@ -233,7 +233,7 @@ Signed-off-by: John Johansen <jjohansen@suse.de>
path_release(&nd);
out:
return error;
@@ -631,7 +633,7 @@ asmlinkage long sys_fchownat(int dfd, co
@@ -633,7 +635,7 @@ asmlinkage long sys_fchownat(int dfd, co
error = __user_walk_fd(dfd, filename, follow, &nd);
if (error)
goto out;
@ -242,7 +242,7 @@ Signed-off-by: John Johansen <jjohansen@suse.de>
path_release(&nd);
out:
return error;
@@ -645,7 +647,7 @@ asmlinkage long sys_lchown(const char __
@@ -647,7 +649,7 @@ asmlinkage long sys_lchown(const char __
error = user_path_walk_link(filename, &nd);
if (error)
goto out;
@ -251,7 +251,7 @@ Signed-off-by: John Johansen <jjohansen@suse.de>
path_release(&nd);
out:
return error;
@@ -664,7 +666,7 @@ asmlinkage long sys_fchown(unsigned int
@@ -666,7 +668,7 @@ asmlinkage long sys_fchown(unsigned int
dentry = file->f_path.dentry;
audit_inode(NULL, dentry->d_inode);
@ -262,7 +262,7 @@ Signed-off-by: John Johansen <jjohansen@suse.de>
return error;
--- a/fs/reiserfs/xattr.c
+++ b/fs/reiserfs/xattr.c
@@ -483,7 +483,7 @@ reiserfs_xattr_set(struct inode *inode,
@@ -479,7 +479,7 @@ reiserfs_xattr_set(struct inode *inode,
newattrs.ia_size = buffer_size;
newattrs.ia_valid = ATTR_SIZE | ATTR_CTIME;
mutex_lock(&xinode->i_mutex);
@ -271,7 +271,7 @@ Signed-off-by: John Johansen <jjohansen@suse.de>
if (err)
goto out_filp;
@@ -823,7 +823,7 @@ reiserfs_chown_xattrs_filler(void *buf,
@@ -819,7 +819,7 @@ reiserfs_chown_xattrs_filler(void *buf,
}
if (!S_ISDIR(xafile->d_inode->i_mode))
@ -280,7 +280,7 @@ Signed-off-by: John Johansen <jjohansen@suse.de>
dput(xafile);
return err;
@@ -875,7 +875,7 @@ int reiserfs_chown_xattrs(struct inode *
@@ -871,7 +871,7 @@ int reiserfs_chown_xattrs(struct inode *
goto out_dir;
}
@ -291,7 +291,7 @@ Signed-off-by: John Johansen <jjohansen@suse.de>
out_dir:
--- a/fs/sysfs/file.c
+++ b/fs/sysfs/file.c
@@ -584,7 +584,7 @@ int sysfs_chmod_file(struct kobject *kob
@@ -583,7 +583,7 @@ int sysfs_chmod_file(struct kobject *kob
newattrs.ia_mode = (mode & S_IALLUGO) |
(inode->i_mode & ~S_IALLUGO);
newattrs.ia_valid = ATTR_MODE | ATTR_CTIME;
@ -302,27 +302,48 @@ Signed-off-by: John Johansen <jjohansen@suse.de>
dput(victim);
--- a/fs/utimes.c
+++ b/fs/utimes.c
@@ -62,7 +62,7 @@ asmlinkage long sys_utime(char __user *
@@ -46,7 +46,7 @@ long do_utimes(int dfd, char __user *fil
{
int error;
struct nameidata nd;
- struct dentry *dentry;
+ struct path path;
struct inode *inode;
struct iattr newattrs;
struct file *f = NULL;
@@ -64,16 +64,17 @@ long do_utimes(int dfd, char __user *fil
f = fget(dfd);
if (!f)
goto out;
- dentry = f->f_path.dentry;
+ path = f->f_path;
} else {
error = __user_walk_fd(dfd, filename, (flags & AT_SYMLINK_NOFOLLOW) ? 0 : LOOKUP_FOLLOW, &nd);
if (error)
goto out;
- dentry = nd.dentry;
+ path.dentry = nd.dentry;
+ path.mnt = nd.mnt;
}
- inode = dentry->d_inode;
+ inode = path.dentry->d_inode;
error = -EROFS;
if (IS_RDONLY(inode))
@@ -111,7 +112,7 @@ long do_utimes(int dfd, char __user *fil
goto dput_and_out;
}
mutex_lock(&inode->i_mutex);
- error = notify_change(nd.dentry, &newattrs);
+ error = notify_change(nd.dentry, nd.mnt, &newattrs);
- error = notify_change(dentry, &newattrs);
+ error = notify_change(path.dentry, path.mnt, &newattrs);
mutex_unlock(&inode->i_mutex);
dput_and_out:
path_release(&nd);
@@ -115,7 +115,7 @@ long do_utimes(int dfd, char __user *fil
goto dput_and_out;
}
mutex_lock(&inode->i_mutex);
- error = notify_change(nd.dentry, &newattrs);
+ error = notify_change(nd.dentry, nd.mnt, &newattrs);
mutex_unlock(&inode->i_mutex);
dput_and_out:
path_release(&nd);
if (f)
--- a/include/linux/fs.h
+++ b/include/linux/fs.h
@@ -1463,8 +1463,8 @@ static inline int break_lease(struct ino
@@ -1470,8 +1470,8 @@ static inline int break_lease(struct ino
/* fs/open.c */
@ -333,7 +354,7 @@ Signed-off-by: John Johansen <jjohansen@suse.de>
extern long do_sys_open(int fdf, const char __user *filename, int flags,
int mode);
extern struct file *filp_open(const char *, int, int);
@@ -1617,7 +1617,7 @@ extern int do_remount_sb(struct super_bl
@@ -1624,7 +1624,7 @@ extern int do_remount_sb(struct super_bl
#ifdef CONFIG_BLOCK
extern sector_t bmap(struct inode *, sector_t);
#endif
@ -344,7 +365,7 @@ Signed-off-by: John Johansen <jjohansen@suse.de>
int (*check_acl)(struct inode *, int));
--- a/mm/filemap.c
+++ b/mm/filemap.c
@@ -1877,7 +1877,7 @@ int __remove_suid(struct path *path, int
@@ -1908,7 +1908,7 @@ int __remove_suid(struct path *path, int
struct iattr newattrs;
newattrs.ia_valid = ATTR_FORCE | kill;

View file

@ -44,7 +44,7 @@ Signed-off-by: John Johansen <jjohansen@suse.de>
}
--- a/fs/xattr.c
+++ b/fs/xattr.c
@@ -166,7 +166,7 @@ vfs_listxattr(struct dentry *dentry, str
@@ -165,7 +165,7 @@ vfs_listxattr(struct dentry *dentry, str
EXPORT_SYMBOL_GPL(vfs_listxattr);
int
@ -53,7 +53,7 @@ Signed-off-by: John Johansen <jjohansen@suse.de>
{
struct inode *inode = dentry->d_inode;
int error;
@@ -437,7 +437,7 @@ sys_flistxattr(int fd, char __user *list
@@ -436,7 +436,7 @@ sys_flistxattr(int fd, char __user *list
* Extended attribute REMOVE operations
*/
static long
@ -62,7 +62,7 @@ Signed-off-by: John Johansen <jjohansen@suse.de>
{
int error;
char kname[XATTR_NAME_MAX + 1];
@@ -448,7 +448,7 @@ removexattr(struct dentry *d, char __use
@@ -447,7 +447,7 @@ removexattr(struct dentry *d, char __use
if (error < 0)
return error;
@ -71,7 +71,7 @@ Signed-off-by: John Johansen <jjohansen@suse.de>
}
asmlinkage long
@@ -460,7 +460,7 @@ sys_removexattr(char __user *path, char
@@ -459,7 +459,7 @@ sys_removexattr(char __user *path, char
error = user_path_walk(path, &nd);
if (error)
return error;
@ -80,7 +80,7 @@ Signed-off-by: John Johansen <jjohansen@suse.de>
path_release(&nd);
return error;
}
@@ -474,7 +474,7 @@ sys_lremovexattr(char __user *path, char
@@ -473,7 +473,7 @@ sys_lremovexattr(char __user *path, char
error = user_path_walk_link(path, &nd);
if (error)
return error;
@ -89,7 +89,7 @@ Signed-off-by: John Johansen <jjohansen@suse.de>
path_release(&nd);
return error;
}
@@ -491,7 +491,7 @@ sys_fremovexattr(int fd, char __user *na
@@ -490,7 +490,7 @@ sys_fremovexattr(int fd, char __user *na
return error;
dentry = f->f_path.dentry;
audit_inode(NULL, dentry->d_inode);

View file

@ -45,7 +45,7 @@ Signed-off-by: John Johansen <jjohansen@suse.de>
fsstack_copy_attr_all(new_dir, lower_new_dir_dentry->d_inode, NULL);
--- a/fs/namei.c
+++ b/fs/namei.c
@@ -2415,7 +2415,8 @@ asmlinkage long sys_link(const char __us
@@ -2403,7 +2403,8 @@ asmlinkage long sys_link(const char __us
* locking].
*/
static int vfs_rename_dir(struct inode *old_dir, struct dentry *old_dentry,
@ -55,7 +55,7 @@ Signed-off-by: John Johansen <jjohansen@suse.de>
{
int error = 0;
struct inode *target;
@@ -2458,7 +2459,8 @@ static int vfs_rename_dir(struct inode *
@@ -2446,7 +2447,8 @@ static int vfs_rename_dir(struct inode *
}
static int vfs_rename_other(struct inode *old_dir, struct dentry *old_dentry,
@ -65,7 +65,7 @@ Signed-off-by: John Johansen <jjohansen@suse.de>
{
struct inode *target;
int error;
@@ -2486,7 +2488,8 @@ static int vfs_rename_other(struct inode
@@ -2474,7 +2476,8 @@ static int vfs_rename_other(struct inode
}
int vfs_rename(struct inode *old_dir, struct dentry *old_dentry,
@ -75,7 +75,7 @@ Signed-off-by: John Johansen <jjohansen@suse.de>
{
int error;
int is_dir = S_ISDIR(old_dentry->d_inode->i_mode);
@@ -2515,9 +2518,11 @@ int vfs_rename(struct inode *old_dir, st
@@ -2503,9 +2506,11 @@ int vfs_rename(struct inode *old_dir, st
old_name = fsnotify_oldname_init(old_dentry->d_name.name);
if (is_dir)
@ -89,7 +89,7 @@ Signed-off-by: John Johansen <jjohansen@suse.de>
if (!error) {
const char *new_name = old_dentry->d_name.name;
fsnotify_move(old_dir, new_dir, old_name, new_name, is_dir,
@@ -2589,8 +2594,8 @@ static int do_rename(int olddfd, const c
@@ -2577,8 +2582,8 @@ static int do_rename(int olddfd, const c
if (new_dentry == trap)
goto exit5;
@ -114,7 +114,7 @@ Signed-off-by: John Johansen <jjohansen@suse.de>
if (!host_err)
--- a/include/linux/fs.h
+++ b/include/linux/fs.h
@@ -991,7 +991,7 @@ extern int vfs_symlink(struct inode *, s
@@ -998,7 +998,7 @@ extern int vfs_symlink(struct inode *, s
extern int vfs_link(struct dentry *, struct vfsmount *, struct inode *, struct dentry *, struct vfsmount *);
extern int vfs_rmdir(struct inode *, struct dentry *, struct vfsmount *);
extern int vfs_unlink(struct inode *, struct dentry *, struct vfsmount *);

View file

@ -39,7 +39,7 @@ Signed-off-by: John Johansen <jjohansen@suse.de>
d_delete(lower_dentry);
--- a/fs/namei.c
+++ b/fs/namei.c
@@ -2038,7 +2038,7 @@ void dentry_unhash(struct dentry *dentry
@@ -2026,7 +2026,7 @@ void dentry_unhash(struct dentry *dentry
spin_unlock(&dcache_lock);
}
@ -48,7 +48,7 @@ Signed-off-by: John Johansen <jjohansen@suse.de>
{
int error = may_delete(dir, dentry, 1);
@@ -2102,7 +2102,7 @@ static long do_rmdir(int dfd, const char
@@ -2090,7 +2090,7 @@ static long do_rmdir(int dfd, const char
error = PTR_ERR(dentry);
if (IS_ERR(dentry))
goto exit2;
@ -113,7 +113,7 @@ Signed-off-by: John Johansen <jjohansen@suse.de>
out_nfserr:
--- a/fs/reiserfs/xattr.c
+++ b/fs/reiserfs/xattr.c
@@ -779,7 +779,7 @@ int reiserfs_delete_xattrs(struct inode
@@ -775,7 +775,7 @@ int reiserfs_delete_xattrs(struct inode
if (dir->d_inode->i_nlink <= 2) {
root = get_xa_root(inode->i_sb, XATTR_REPLACE);
reiserfs_write_lock_xattrs(inode->i_sb);
@ -124,7 +124,7 @@ Signed-off-by: John Johansen <jjohansen@suse.de>
} else {
--- a/include/linux/fs.h
+++ b/include/linux/fs.h
@@ -989,7 +989,7 @@ extern int vfs_mkdir(struct inode *, str
@@ -996,7 +996,7 @@ extern int vfs_mkdir(struct inode *, str
extern int vfs_mknod(struct inode *, struct dentry *, struct vfsmount *, int, dev_t);
extern int vfs_symlink(struct inode *, struct dentry *, struct vfsmount *, const char *, int);
extern int vfs_link(struct dentry *, struct vfsmount *, struct inode *, struct dentry *, struct vfsmount *);

View file

@ -80,7 +80,7 @@ Signed-off-by: John Johansen <jjohansen@suse.de>
error = 0;
--- a/fs/xattr.c
+++ b/fs/xattr.c
@@ -70,8 +70,8 @@ xattr_permission(struct inode *inode, co
@@ -69,8 +69,8 @@ xattr_permission(struct inode *inode, co
}
int
@ -91,7 +91,7 @@ Signed-off-by: John Johansen <jjohansen@suse.de>
{
struct inode *inode = dentry->d_inode;
int error;
@@ -194,8 +194,8 @@ EXPORT_SYMBOL_GPL(vfs_removexattr);
@@ -193,8 +193,8 @@ EXPORT_SYMBOL_GPL(vfs_removexattr);
* Extended attribute SET operations
*/
static long
@ -102,7 +102,7 @@ Signed-off-by: John Johansen <jjohansen@suse.de>
{
int error;
void *kvalue = NULL;
@@ -222,7 +222,7 @@ setxattr(struct dentry *d, char __user *
@@ -221,7 +221,7 @@ setxattr(struct dentry *d, char __user *
}
}
@ -111,7 +111,7 @@ Signed-off-by: John Johansen <jjohansen@suse.de>
kfree(kvalue);
return error;
}
@@ -237,7 +237,7 @@ sys_setxattr(char __user *path, char __u
@@ -236,7 +236,7 @@ sys_setxattr(char __user *path, char __u
error = user_path_walk(path, &nd);
if (error)
return error;
@ -120,7 +120,7 @@ Signed-off-by: John Johansen <jjohansen@suse.de>
path_release(&nd);
return error;
}
@@ -252,7 +252,7 @@ sys_lsetxattr(char __user *path, char __
@@ -251,7 +251,7 @@ sys_lsetxattr(char __user *path, char __
error = user_path_walk_link(path, &nd);
if (error)
return error;
@ -129,7 +129,7 @@ Signed-off-by: John Johansen <jjohansen@suse.de>
path_release(&nd);
return error;
}
@@ -270,7 +270,7 @@ sys_fsetxattr(int fd, char __user *name,
@@ -269,7 +269,7 @@ sys_fsetxattr(int fd, char __user *name,
return error;
dentry = f->f_path.dentry;
audit_inode(NULL, dentry->d_inode);

View file

@ -44,7 +44,7 @@ Signed-off-by: John Johansen <jjohansen@suse.de>
if (rc || !lower_dentry->d_inode)
--- a/fs/namei.c
+++ b/fs/namei.c
@@ -2217,7 +2217,8 @@ asmlinkage long sys_unlink(const char __
@@ -2205,7 +2205,8 @@ asmlinkage long sys_unlink(const char __
return do_unlinkat(AT_FDCWD, pathname);
}
@ -54,7 +54,7 @@ Signed-off-by: John Johansen <jjohansen@suse.de>
{
int error = may_create(dir, dentry, NULL);
@@ -2263,7 +2264,8 @@ asmlinkage long sys_symlinkat(const char
@@ -2251,7 +2252,8 @@ asmlinkage long sys_symlinkat(const char
if (IS_ERR(dentry))
goto out_unlock;
@ -111,7 +111,7 @@ Signed-off-by: John Johansen <jjohansen@suse.de>
out:
--- a/include/linux/fs.h
+++ b/include/linux/fs.h
@@ -987,7 +987,7 @@ extern int vfs_permission(struct nameida
@@ -994,7 +994,7 @@ extern int vfs_permission(struct nameida
extern int vfs_create(struct inode *, struct dentry *, int, struct nameidata *);
extern int vfs_mkdir(struct inode *, struct dentry *, struct vfsmount *, int);
extern int vfs_mknod(struct inode *, struct dentry *, struct vfsmount *, int, dev_t);

View file

@ -34,7 +34,7 @@ Signed-off-by: John Johansen <jjohansen@suse.de>
goto out_unlock;
--- a/fs/namei.c
+++ b/fs/namei.c
@@ -2119,7 +2119,7 @@ asmlinkage long sys_rmdir(const char __u
@@ -2107,7 +2107,7 @@ asmlinkage long sys_rmdir(const char __u
return do_rmdir(AT_FDCWD, pathname);
}
@ -43,7 +43,7 @@ Signed-off-by: John Johansen <jjohansen@suse.de>
{
int error = may_delete(dir, dentry, 0);
@@ -2183,7 +2183,7 @@ static long do_unlinkat(int dfd, const c
@@ -2171,7 +2171,7 @@ static long do_unlinkat(int dfd, const c
inode = dentry->d_inode;
if (inode)
atomic_inc(&inode->i_count);
@ -76,7 +76,7 @@ Signed-off-by: John Johansen <jjohansen@suse.de>
}
--- a/include/linux/fs.h
+++ b/include/linux/fs.h
@@ -990,7 +990,7 @@ extern int vfs_mknod(struct inode *, str
@@ -997,7 +997,7 @@ extern int vfs_mknod(struct inode *, str
extern int vfs_symlink(struct inode *, struct dentry *, struct vfsmount *, const char *, int);
extern int vfs_link(struct dentry *, struct vfsmount *, struct inode *, struct dentry *, struct vfsmount *);
extern int vfs_rmdir(struct inode *, struct dentry *, struct vfsmount *);
@ -87,7 +87,7 @@ Signed-off-by: John Johansen <jjohansen@suse.de>
/*
--- a/ipc/mqueue.c
+++ b/ipc/mqueue.c
@@ -748,7 +748,7 @@ asmlinkage long sys_mq_unlink(const char
@@ -747,7 +747,7 @@ asmlinkage long sys_mq_unlink(const char
if (inode)
atomic_inc(&inode->i_count);