2
0
mirror of https://gitlab.com/apparmor/apparmor synced 2025-08-31 14:25:52 +00:00

Update the LSM hooks to git-latest (apparmor patches still to be updated).

This commit is contained in:
Andreas Gruenbacher
2007-02-01 05:28:52 +00:00
parent cbad84b250
commit 8b32bddd18
29 changed files with 631 additions and 589 deletions

View File

@@ -6,10 +6,10 @@ calling iop->setattr.
Signed-off-by: Tony Jones <tonyj@suse.de>
Signed-off-by: Andreas Gruenbacher <agruen@suse.de>
Index: linux-2.6.19/fs/proc/base.c
Index: linux-2.6-hooks/fs/proc/base.c
===================================================================
--- linux-2.6.19.orig/fs/proc/base.c
+++ linux-2.6.19/fs/proc/base.c
--- linux-2.6-hooks.orig/fs/proc/base.c
+++ linux-2.6-hooks/fs/proc/base.c
@@ -344,11 +344,8 @@ static int proc_setattr(struct dentry *d
return -EPERM;

View File

@@ -1,100 +1,99 @@
Pass struct file down to remove_suid and children
We always call remove_suid for a specific struct file. Pass this
struct down into remove_suid and children instead of the dentry
of the file. We can then call notify_change() with the vfsmount
and dentry of the file (next patch).
Pass struct path to remove_suid and should_remove_suid instead of
only the dentry. Required by a later patch that adds a struct
vfsmount parameter to notify_change().
Signed-off-by: Tony Jones <tonyj@suse.de>
Signed-off-by: Andreas Gruenbacher <agruen@suse.de>
Index: linux-2.6.19/mm/filemap.c
Index: linux-2.6-hooks/mm/filemap.c
===================================================================
--- linux-2.6.19.orig/mm/filemap.c
+++ linux-2.6.19/mm/filemap.c
@@ -1872,9 +1872,9 @@ repeat:
--- linux-2.6-hooks.orig/mm/filemap.c
+++ linux-2.6-hooks/mm/filemap.c
@@ -1869,9 +1869,9 @@ repeat:
* if suid or (sgid and xgrp)
* remove privs
*/
-int should_remove_suid(struct dentry *dentry)
+int should_remove_suid(struct file *file)
+int should_remove_suid(struct path *path)
{
- mode_t mode = dentry->d_inode->i_mode;
+ mode_t mode = file->f_dentry->d_inode->i_mode;
+ mode_t mode = path->dentry->d_inode->i_mode;
int kill = 0;
/* suid always must be killed */
@@ -1894,20 +1894,20 @@ int should_remove_suid(struct dentry *de
return 0;
@@ -1892,20 +1892,20 @@ int should_remove_suid(struct dentry *de
}
EXPORT_SYMBOL(should_remove_suid);
-int __remove_suid(struct dentry *dentry, int kill)
+int __remove_suid(struct file *file, int kill)
+int __remove_suid(struct path *path, int kill)
{
struct iattr newattrs;
newattrs.ia_valid = ATTR_FORCE | kill;
- return notify_change(dentry, &newattrs);
+ return notify_change(file->f_dentry, &newattrs);
+ return notify_change(path->dentry, &newattrs);
}
-int remove_suid(struct dentry *dentry)
+int remove_suid(struct file *file)
+int remove_suid(struct path *path)
{
- int kill = should_remove_suid(dentry);
+ int kill = should_remove_suid(file);
+ int kill = should_remove_suid(path);
if (unlikely(kill))
- return __remove_suid(dentry, kill);
+ return __remove_suid(file, kill);
+ return __remove_suid(path, kill);
return 0;
}
@@ -2269,7 +2269,7 @@ __generic_file_aio_write_nolock(struct k
@@ -2266,7 +2266,7 @@ __generic_file_aio_write_nolock(struct k
if (count == 0)
goto out;
- err = remove_suid(file->f_dentry);
+ err = remove_suid(file);
- err = remove_suid(file->f_path.dentry);
+ err = remove_suid(&file->f_path);
if (err)
goto out;
Index: linux-2.6.19/fs/ntfs/file.c
Index: linux-2.6-hooks/fs/ntfs/file.c
===================================================================
--- linux-2.6.19.orig/fs/ntfs/file.c
+++ linux-2.6.19/fs/ntfs/file.c
--- linux-2.6-hooks.orig/fs/ntfs/file.c
+++ linux-2.6-hooks/fs/ntfs/file.c
@@ -2162,7 +2162,7 @@ static ssize_t ntfs_file_aio_write_noloc
goto out;
if (!count)
goto out;
- err = remove_suid(file->f_dentry);
+ err = remove_suid(file);
- err = remove_suid(file->f_path.dentry);
+ err = remove_suid(&file->f_path);
if (err)
goto out;
file_update_time(file);
Index: linux-2.6.19/fs/reiserfs/file.c
Index: linux-2.6-hooks/fs/reiserfs/file.c
===================================================================
--- linux-2.6.19.orig/fs/reiserfs/file.c
+++ linux-2.6.19/fs/reiserfs/file.c
@@ -1378,7 +1378,7 @@ static ssize_t reiserfs_file_write(struc
--- linux-2.6-hooks.orig/fs/reiserfs/file.c
+++ linux-2.6-hooks/fs/reiserfs/file.c
@@ -1353,7 +1353,7 @@ static ssize_t reiserfs_file_write(struc
if (count == 0)
goto out;
- res = remove_suid(file->f_dentry);
+ res = remove_suid(file);
- res = remove_suid(file->f_path.dentry);
+ res = remove_suid(&file->f_path);
if (res)
goto out;
Index: linux-2.6.19/fs/splice.c
Index: linux-2.6-hooks/fs/splice.c
===================================================================
--- linux-2.6.19.orig/fs/splice.c
+++ linux-2.6.19/fs/splice.c
--- linux-2.6-hooks.orig/fs/splice.c
+++ linux-2.6-hooks/fs/splice.c
@@ -844,7 +844,7 @@ generic_file_splice_write_nolock(struct
ssize_t ret;
int err;
- err = remove_suid(out->f_dentry);
+ err = remove_suid(out);
- err = remove_suid(out->f_path.dentry);
+ err = remove_suid(&out->f_path);
if (unlikely(err))
return err;
@@ -102,68 +101,115 @@ Index: linux-2.6.19/fs/splice.c
ssize_t ret;
int err;
- err = should_remove_suid(out->f_dentry);
+ err = should_remove_suid(out);
- err = should_remove_suid(out->f_path.dentry);
+ err = should_remove_suid(&out->f_path);
if (unlikely(err)) {
mutex_lock(&inode->i_mutex);
- err = __remove_suid(out->f_dentry, err);
+ err = __remove_suid(out, err);
- err = __remove_suid(out->f_path.dentry, err);
+ err = __remove_suid(&out->f_path, err);
mutex_unlock(&inode->i_mutex);
if (err)
return err;
Index: linux-2.6.19/fs/xfs/linux-2.6/xfs_lrw.c
Index: linux-2.6-hooks/fs/xfs/linux-2.6/xfs_lrw.c
===================================================================
--- linux-2.6.19.orig/fs/xfs/linux-2.6/xfs_lrw.c
+++ linux-2.6.19/fs/xfs/linux-2.6/xfs_lrw.c
--- linux-2.6-hooks.orig/fs/xfs/linux-2.6/xfs_lrw.c
+++ linux-2.6-hooks/fs/xfs/linux-2.6/xfs_lrw.c
@@ -805,7 +805,7 @@ start:
!capable(CAP_FSETID)) {
error = xfs_write_clear_setuid(xip);
if (likely(!error))
- error = -remove_suid(file->f_dentry);
+ error = -remove_suid(file);
- error = -remove_suid(file->f_path.dentry);
+ error = -remove_suid(&file->f_path);
if (unlikely(error)) {
xfs_iunlock(xip, iolock);
goto out_unlock_mutex;
Index: linux-2.6.19/include/linux/fs.h
Index: linux-2.6-hooks/include/linux/fs.h
===================================================================
--- linux-2.6.19.orig/include/linux/fs.h
+++ linux-2.6.19/include/linux/fs.h
@@ -1712,9 +1712,9 @@ extern void __iget(struct inode * inode)
--- linux-2.6-hooks.orig/include/linux/fs.h
+++ linux-2.6-hooks/include/linux/fs.h
@@ -1678,9 +1678,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 *);
-extern int __remove_suid(struct dentry *, int);
-extern int should_remove_suid(struct dentry *);
-extern int remove_suid(struct dentry *);
+extern int __remove_suid(struct file *, int);
+extern int should_remove_suid(struct file *);
+extern int remove_suid(struct file *);
+extern int __remove_suid(struct path *, int);
+extern int should_remove_suid(struct path *);
+extern int remove_suid(struct path *);
extern void remove_dquot_ref(struct super_block *, int, struct list_head *);
extern void __insert_inode_hash(struct inode *, unsigned long hashval);
Index: linux-2.6.19/mm/filemap_xip.c
Index: linux-2.6-hooks/mm/filemap_xip.c
===================================================================
--- linux-2.6.19.orig/mm/filemap_xip.c
+++ linux-2.6.19/mm/filemap_xip.c
--- linux-2.6-hooks.orig/mm/filemap_xip.c
+++ linux-2.6-hooks/mm/filemap_xip.c
@@ -379,7 +379,7 @@ xip_file_write(struct file *filp, const
if (count == 0)
goto out_backing;
- ret = remove_suid(filp->f_dentry);
+ ret = remove_suid(filp);
- ret = remove_suid(filp->f_path.dentry);
+ ret = remove_suid(&filp->f_path);
if (ret)
goto out_backing;
Index: linux-2.6.19/mm/shmem.c
Index: linux-2.6-hooks/mm/shmem.c
===================================================================
--- linux-2.6.19.orig/mm/shmem.c
+++ linux-2.6.19/mm/shmem.c
@@ -1442,7 +1442,7 @@ shmem_file_write(struct file *file, cons
--- linux-2.6-hooks.orig/mm/shmem.c
+++ linux-2.6-hooks/mm/shmem.c
@@ -1447,7 +1447,7 @@ shmem_file_write(struct file *file, cons
if (err || !count)
goto out;
- err = remove_suid(file->f_dentry);
+ err = remove_suid(file);
- err = remove_suid(file->f_path.dentry);
+ err = remove_suid(&file->f_path);
if (err)
goto out;
Index: linux-2.6-hooks/fs/ocfs2/file.c
===================================================================
--- linux-2.6-hooks.orig/fs/ocfs2/file.c
+++ linux-2.6-hooks/fs/ocfs2/file.c
@@ -1035,13 +1035,13 @@ out:
return ret;
}
-static int ocfs2_prepare_inode_for_write(struct dentry *dentry,
+static int ocfs2_prepare_inode_for_write(struct path *path,
loff_t *ppos,
size_t count,
int appending)
{
int ret = 0, meta_level = appending;
- struct inode *inode = dentry->d_inode;
+ struct inode *inode = path->dentry->d_inode;
u32 clusters;
loff_t newsize, saved_pos;
@@ -1067,7 +1067,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. */
- if (should_remove_suid(dentry)) {
+ if (should_remove_suid(path)) {
if (meta_level == 0) {
ocfs2_meta_unlock(inode, meta_level);
meta_level = 1;
@@ -1176,7 +1176,7 @@ static ssize_t ocfs2_file_aio_write(stru
goto out;
}
- ret = ocfs2_prepare_inode_for_write(filp->f_path.dentry, &iocb->ki_pos,
+ ret = ocfs2_prepare_inode_for_write(&filp->f_path, &iocb->ki_pos,
iocb->ki_left, appending);
if (ret < 0) {
mlog_errno(ret);
@@ -1239,7 +1239,7 @@ static ssize_t ocfs2_file_splice_write(s
goto out;
}
- ret = ocfs2_prepare_inode_for_write(out->f_path.dentry, ppos, len, 0);
+ ret = ocfs2_prepare_inode_for_write(&out->f_path, ppos, len, 0);
if (ret < 0) {
mlog_errno(ret);
goto out_unlock;

View File

@@ -3,11 +3,11 @@ Pass struct vfsmount to the inode_create LSM hook.
Signed-off-by: Tony Jones <tonyj@suse.de>
Signed-off-by: Andreas Gruenbacher <agruen@suse.de>
Index: linux-2.6.19/fs/namei.c
Index: linux-2.6-hooks/fs/namei.c
===================================================================
--- linux-2.6.19.orig/fs/namei.c
+++ linux-2.6.19/fs/namei.c
@@ -1506,7 +1506,7 @@ int vfs_create(struct inode *dir, struct
--- linux-2.6-hooks.orig/fs/namei.c
+++ linux-2.6-hooks/fs/namei.c
@@ -1503,7 +1503,7 @@ int vfs_create(struct inode *dir, struct
return -EACCES; /* shouldn't it be ENOSYS? */
mode &= S_IALLUGO;
mode |= S_IFREG;
@@ -16,19 +16,19 @@ Index: linux-2.6.19/fs/namei.c
if (error)
return error;
DQUOT_INIT(dir);
Index: linux-2.6.19/include/linux/security.h
Index: linux-2.6-hooks/include/linux/security.h
===================================================================
--- linux-2.6.19.orig/include/linux/security.h
+++ linux-2.6.19/include/linux/security.h
--- linux-2.6-hooks.orig/include/linux/security.h
+++ linux-2.6-hooks/include/linux/security.h
@@ -283,6 +283,7 @@ struct request_sock;
* Check permission to create a regular file.
* @dir contains inode structure of the parent of the new file.
* @dentry contains the dentry structure for the file to be created.
+ * @mnt is the vfsmount corresponding to dir (may be NULL)
+ * @mnt is the vfsmount corresponding to @dentry (may be NULL).
* @mode contains the file mode of the file to be created.
* Return 0 if permission is granted.
* @inode_link:
@@ -1212,8 +1213,8 @@ struct security_operations {
@@ -1204,8 +1205,8 @@ struct security_operations {
void (*inode_free_security) (struct inode *inode);
int (*inode_init_security) (struct inode *inode, struct inode *dir,
char **name, void **value, size_t *len);
@@ -39,7 +39,7 @@ Index: linux-2.6.19/include/linux/security.h
int (*inode_link) (struct dentry *old_dentry,
struct inode *dir, struct dentry *new_dentry);
int (*inode_unlink) (struct inode *dir, struct dentry *dentry);
@@ -1620,11 +1621,12 @@ static inline int security_inode_init_se
@@ -1611,11 +1612,12 @@ static inline int security_inode_init_se
static inline int security_inode_create (struct inode *dir,
struct dentry *dentry,
@@ -53,7 +53,7 @@ Index: linux-2.6.19/include/linux/security.h
}
static inline int security_inode_link (struct dentry *old_dentry,
@@ -2347,6 +2349,7 @@ static inline int security_inode_init_se
@@ -2338,6 +2340,7 @@ static inline int security_inode_init_se
static inline int security_inode_create (struct inode *dir,
struct dentry *dentry,
@@ -61,10 +61,10 @@ Index: linux-2.6.19/include/linux/security.h
int mode)
{
return 0;
Index: linux-2.6.19/security/dummy.c
Index: linux-2.6-hooks/security/dummy.c
===================================================================
--- linux-2.6.19.orig/security/dummy.c
+++ linux-2.6.19/security/dummy.c
--- linux-2.6-hooks.orig/security/dummy.c
+++ linux-2.6-hooks/security/dummy.c
@@ -265,7 +265,7 @@ static int dummy_inode_init_security (st
}
@@ -74,11 +74,11 @@ Index: linux-2.6.19/security/dummy.c
{
return 0;
}
Index: linux-2.6.19/security/selinux/hooks.c
Index: linux-2.6-hooks/security/selinux/hooks.c
===================================================================
--- linux-2.6.19.orig/security/selinux/hooks.c
+++ linux-2.6.19/security/selinux/hooks.c
@@ -2129,7 +2129,8 @@ static int selinux_inode_init_security(s
--- linux-2.6-hooks.orig/security/selinux/hooks.c
+++ linux-2.6-hooks/security/selinux/hooks.c
@@ -2135,7 +2135,8 @@ static int selinux_inode_init_security(s
return 0;
}

View File

@@ -3,10 +3,10 @@ Pass struct vfsmount to the inode_getxattr LSM hook
Signed-off-by: Tony Jones <tonyj@suse.de>
Signed-off-by: Andreas Gruenbacher <agruen@suse.de>
Index: linux-2.6.19/fs/xattr.c
Index: linux-2.6-hooks/fs/xattr.c
===================================================================
--- linux-2.6.19.orig/fs/xattr.c
+++ linux-2.6.19/fs/xattr.c
--- linux-2.6-hooks.orig/fs/xattr.c
+++ linux-2.6-hooks/fs/xattr.c
@@ -117,7 +117,7 @@ vfs_getxattr(struct dentry *dentry, stru
if (error)
return error;
@@ -16,20 +16,20 @@ Index: linux-2.6.19/fs/xattr.c
if (error)
return error;
Index: linux-2.6.19/include/linux/security.h
Index: linux-2.6-hooks/include/linux/security.h
===================================================================
--- linux-2.6.19.orig/include/linux/security.h
+++ linux-2.6.19/include/linux/security.h
--- linux-2.6-hooks.orig/include/linux/security.h
+++ linux-2.6-hooks/include/linux/security.h
@@ -391,7 +391,7 @@ struct request_sock;
* @value identified by @name for @dentry and @mnt.
* @inode_getxattr:
* Check permission before obtaining the extended attributes
- * identified by @name for @dentry.
+ * identified by @name for @dentry and @mnt
+ * identified by @name for @dentry and @mnt.
* Return 0 if permission is granted.
* @inode_listxattr:
* Check permission before obtaining the list of extended attribute
@@ -1256,7 +1256,8 @@ struct security_operations {
@@ -1248,7 +1248,8 @@ struct security_operations {
struct vfsmount *mnt,
char *name, void *value,
size_t size, int flags);
@@ -39,7 +39,7 @@ Index: linux-2.6.19/include/linux/security.h
int (*inode_listxattr) (struct dentry *dentry);
int (*inode_removexattr) (struct dentry *dentry, char *name);
const char *(*inode_xattr_getsuffix) (void);
@@ -1791,11 +1792,12 @@ static inline void security_inode_post_s
@@ -1782,11 +1783,12 @@ static inline void security_inode_post_s
security_ops->inode_post_setxattr (dentry, mnt, name, value, size, flags);
}
@@ -54,7 +54,7 @@ Index: linux-2.6.19/include/linux/security.h
}
static inline int security_inode_listxattr (struct dentry *dentry)
@@ -2496,7 +2498,8 @@ static inline void security_inode_post_s
@@ -2487,7 +2489,8 @@ static inline void security_inode_post_s
int flags)
{ }
@@ -64,10 +64,10 @@ Index: linux-2.6.19/include/linux/security.h
{
return 0;
}
Index: linux-2.6.19/security/dummy.c
Index: linux-2.6-hooks/security/dummy.c
===================================================================
--- linux-2.6.19.orig/security/dummy.c
+++ linux-2.6.19/security/dummy.c
--- linux-2.6-hooks.orig/security/dummy.c
+++ linux-2.6-hooks/security/dummy.c
@@ -368,7 +368,8 @@ static void dummy_inode_post_setxattr (s
{
}
@@ -78,11 +78,11 @@ Index: linux-2.6.19/security/dummy.c
{
return 0;
}
Index: linux-2.6.19/security/selinux/hooks.c
Index: linux-2.6-hooks/security/selinux/hooks.c
===================================================================
--- linux-2.6.19.orig/security/selinux/hooks.c
+++ linux-2.6.19/security/selinux/hooks.c
@@ -2346,7 +2346,8 @@ static void selinux_inode_post_setxattr(
--- linux-2.6-hooks.orig/security/selinux/hooks.c
+++ linux-2.6-hooks/security/selinux/hooks.c
@@ -2352,7 +2352,8 @@ static void selinux_inode_post_setxattr(
return;
}

View File

@@ -3,11 +3,11 @@ Pass the struct vfsmounts to the inode_link LSM hook
Signed-off-by: Tony Jones <tonyj@suse.de>
Signed-off-by: Andreas Gruenbacher <agruen@suse.de>
Index: linux-2.6.19/fs/namei.c
Index: linux-2.6-hooks/fs/namei.c
===================================================================
--- linux-2.6.19.orig/fs/namei.c
+++ linux-2.6.19/fs/namei.c
@@ -2279,7 +2279,8 @@ int vfs_link(struct dentry *old_dentry,
--- linux-2.6-hooks.orig/fs/namei.c
+++ linux-2.6-hooks/fs/namei.c
@@ -2275,7 +2275,8 @@ int vfs_link(struct dentry *old_dentry,
if (S_ISDIR(old_dentry->d_inode->i_mode))
return -EPERM;
@@ -17,22 +17,22 @@ Index: linux-2.6.19/fs/namei.c
if (error)
return error;
Index: linux-2.6.19/include/linux/security.h
Index: linux-2.6-hooks/include/linux/security.h
===================================================================
--- linux-2.6.19.orig/include/linux/security.h
+++ linux-2.6.19/include/linux/security.h
--- linux-2.6-hooks.orig/include/linux/security.h
+++ linux-2.6-hooks/include/linux/security.h
@@ -289,8 +289,10 @@ struct request_sock;
* @inode_link:
* Check permission before creating a new hard link to a file.
* @old_dentry contains the dentry structure for an existing link to the file.
+ * @old_mnt is the vfsmount where @old_dentry was looked up (may be NULL)
+ * @old_mnt is the vfsmount corresponding to @old_dentry (may be NULL).
* @dir contains the inode structure of the parent directory of the new link.
* @new_dentry contains the dentry structure for the new link.
+ * @new_mnt is the vfsmount for @new_dentry (may be NULL)
+ * @new_mnt is the vfsmount corresponding to @new_dentry (may be NULL).
* Return 0 if permission is granted.
* @inode_unlink:
* Check the permission to remove a hard link to a file.
@@ -1220,8 +1222,9 @@ struct security_operations {
@@ -1212,8 +1214,9 @@ struct security_operations {
char **name, void **value, size_t *len);
int (*inode_create) (struct inode *dir, struct dentry *dentry,
struct vfsmount *mnt, int mode);
@@ -44,7 +44,7 @@ Index: linux-2.6.19/include/linux/security.h
int (*inode_unlink) (struct inode *dir, struct dentry *dentry);
int (*inode_symlink) (struct inode *dir, struct dentry *dentry,
struct vfsmount *mnt, const char *old_name);
@@ -1637,12 +1640,15 @@ static inline int security_inode_create
@@ -1628,12 +1631,15 @@ static inline int security_inode_create
}
static inline int security_inode_link (struct dentry *old_dentry,
@@ -62,7 +62,7 @@ Index: linux-2.6.19/include/linux/security.h
}
static inline int security_inode_unlink (struct inode *dir,
@@ -2368,8 +2374,10 @@ static inline int security_inode_create
@@ -2359,8 +2365,10 @@ static inline int security_inode_create
}
static inline int security_inode_link (struct dentry *old_dentry,
@@ -74,10 +74,10 @@ Index: linux-2.6.19/include/linux/security.h
{
return 0;
}
Index: linux-2.6.19/security/dummy.c
Index: linux-2.6-hooks/security/dummy.c
===================================================================
--- linux-2.6.19.orig/security/dummy.c
+++ linux-2.6.19/security/dummy.c
--- linux-2.6-hooks.orig/security/dummy.c
+++ linux-2.6-hooks/security/dummy.c
@@ -270,8 +270,10 @@ static int dummy_inode_create (struct in
return 0;
}
@@ -91,11 +91,11 @@ Index: linux-2.6.19/security/dummy.c
{
return 0;
}
Index: linux-2.6.19/security/selinux/hooks.c
Index: linux-2.6-hooks/security/selinux/hooks.c
===================================================================
--- linux-2.6.19.orig/security/selinux/hooks.c
+++ linux-2.6.19/security/selinux/hooks.c
@@ -2135,11 +2135,16 @@ static int selinux_inode_create(struct i
--- linux-2.6-hooks.orig/security/selinux/hooks.c
+++ linux-2.6-hooks/security/selinux/hooks.c
@@ -2141,11 +2141,16 @@ static int selinux_inode_create(struct i
return may_create(dir, dentry, SECCLASS_FILE);
}

View File

@@ -3,10 +3,10 @@ Pass struct vfsmount to the inode_listxattr LSM hook
Signed-off-by: Tony Jones <tonyj@suse.de>
Signed-off-by: Andreas Gruenbacher <agruen@suse.de>
Index: linux-2.6.19/fs/xattr.c
Index: linux-2.6-hooks/fs/xattr.c
===================================================================
--- linux-2.6.19.orig/fs/xattr.c
+++ linux-2.6.19/fs/xattr.c
--- linux-2.6-hooks.orig/fs/xattr.c
+++ linux-2.6-hooks/fs/xattr.c
@@ -150,7 +150,7 @@ vfs_listxattr(struct dentry *dentry, str
struct inode *inode = dentry->d_inode;
ssize_t error;
@@ -16,20 +16,20 @@ Index: linux-2.6.19/fs/xattr.c
if (error)
return error;
error = -EOPNOTSUPP;
Index: linux-2.6.19/include/linux/security.h
Index: linux-2.6-hooks/include/linux/security.h
===================================================================
--- linux-2.6.19.orig/include/linux/security.h
+++ linux-2.6.19/include/linux/security.h
--- linux-2.6-hooks.orig/include/linux/security.h
+++ linux-2.6-hooks/include/linux/security.h
@@ -395,7 +395,7 @@ struct request_sock;
* Return 0 if permission is granted.
* @inode_listxattr:
* Check permission before obtaining the list of extended attribute
- * names for @dentry.
+ * names for @dentry/@mnt
+ * names for @dentry and @mnt.
* Return 0 if permission is granted.
* @inode_removexattr:
* Check permission before removing the extended attribute
@@ -1258,7 +1258,7 @@ struct security_operations {
@@ -1250,7 +1250,7 @@ struct security_operations {
size_t size, int flags);
int (*inode_getxattr) (struct dentry *dentry, struct vfsmount *mnt,
char *name);
@@ -38,7 +38,7 @@ Index: linux-2.6.19/include/linux/security.h
int (*inode_removexattr) (struct dentry *dentry, char *name);
const char *(*inode_xattr_getsuffix) (void);
int (*inode_getsecurity)(const struct inode *inode, const char *name, void *buffer, size_t size, int err);
@@ -1800,11 +1800,12 @@ static inline int security_inode_getxatt
@@ -1791,11 +1791,12 @@ static inline int security_inode_getxatt
return security_ops->inode_getxattr (dentry, mnt, name);
}
@@ -53,7 +53,7 @@ Index: linux-2.6.19/include/linux/security.h
}
static inline int security_inode_removexattr (struct dentry *dentry, char *name)
@@ -2504,7 +2505,8 @@ static inline int security_inode_getxatt
@@ -2495,7 +2496,8 @@ static inline int security_inode_getxatt
return 0;
}
@@ -63,10 +63,10 @@ Index: linux-2.6.19/include/linux/security.h
{
return 0;
}
Index: linux-2.6.19/security/dummy.c
Index: linux-2.6-hooks/security/dummy.c
===================================================================
--- linux-2.6.19.orig/security/dummy.c
+++ linux-2.6.19/security/dummy.c
--- linux-2.6-hooks.orig/security/dummy.c
+++ linux-2.6-hooks/security/dummy.c
@@ -374,7 +374,7 @@ static int dummy_inode_getxattr (struct
return 0;
}
@@ -76,11 +76,11 @@ Index: linux-2.6.19/security/dummy.c
{
return 0;
}
Index: linux-2.6.19/security/selinux/hooks.c
Index: linux-2.6-hooks/security/selinux/hooks.c
===================================================================
--- linux-2.6.19.orig/security/selinux/hooks.c
+++ linux-2.6.19/security/selinux/hooks.c
@@ -2352,7 +2352,7 @@ static int selinux_inode_getxattr (struc
--- linux-2.6-hooks.orig/security/selinux/hooks.c
+++ linux-2.6-hooks/security/selinux/hooks.c
@@ -2358,7 +2358,7 @@ static int selinux_inode_getxattr (struc
return dentry_has_perm(current, NULL, dentry, FILE__GETATTR);
}

View File

@@ -3,11 +3,11 @@ Pass struct vfsmount to the inode_mkdir LSM hook
Signed-off-by: Tony Jones <tonyj@suse.de>
Signed-off-by: Andreas Gruenbacher <agruen@suse.de>
Index: linux-2.6.19/fs/namei.c
Index: linux-2.6-hooks/fs/namei.c
===================================================================
--- linux-2.6.19.orig/fs/namei.c
+++ linux-2.6.19/fs/namei.c
@@ -1931,7 +1931,7 @@ int vfs_mkdir(struct inode *dir, struct
--- linux-2.6-hooks.orig/fs/namei.c
+++ linux-2.6-hooks/fs/namei.c
@@ -1928,7 +1928,7 @@ int vfs_mkdir(struct inode *dir, struct
return -EPERM;
mode &= (S_IRWXUGO|S_ISVTX);
@@ -16,19 +16,19 @@ Index: linux-2.6.19/fs/namei.c
if (error)
return error;
Index: linux-2.6.19/include/linux/security.h
Index: linux-2.6-hooks/include/linux/security.h
===================================================================
--- linux-2.6.19.orig/include/linux/security.h
+++ linux-2.6.19/include/linux/security.h
--- linux-2.6-hooks.orig/include/linux/security.h
+++ linux-2.6-hooks/include/linux/security.h
@@ -308,6 +308,7 @@ struct request_sock;
* associated with inode strcture @dir.
* @dir containst the inode structure of parent of the directory to be created.
* @dentry contains the dentry structure of new directory.
+ * @mnt is the vfsmount corresponding to dir (may be NULL)
+ * @mnt is the vfsmount corresponding to @dentry (may be NULL).
* @mode contains the mode of new directory.
* Return 0 if permission is granted.
* @inode_rmdir:
@@ -1221,7 +1222,8 @@ struct security_operations {
@@ -1213,7 +1214,8 @@ struct security_operations {
int (*inode_unlink) (struct inode *dir, struct dentry *dentry);
int (*inode_symlink) (struct inode *dir,
struct dentry *dentry, const char *old_name);
@@ -38,7 +38,7 @@ Index: linux-2.6.19/include/linux/security.h
int (*inode_rmdir) (struct inode *dir, struct dentry *dentry);
int (*inode_mknod) (struct inode *dir, struct dentry *dentry,
int mode, dev_t dev);
@@ -1659,11 +1661,12 @@ static inline int security_inode_symlink
@@ -1650,11 +1652,12 @@ static inline int security_inode_symlink
static inline int security_inode_mkdir (struct inode *dir,
struct dentry *dentry,
@@ -52,7 +52,7 @@ Index: linux-2.6.19/include/linux/security.h
}
static inline int security_inode_rmdir (struct inode *dir,
@@ -2380,6 +2383,7 @@ static inline int security_inode_symlink
@@ -2371,6 +2374,7 @@ static inline int security_inode_symlink
static inline int security_inode_mkdir (struct inode *dir,
struct dentry *dentry,
@@ -60,26 +60,24 @@ Index: linux-2.6.19/include/linux/security.h
int mode)
{
return 0;
Index: linux-2.6.19/security/dummy.c
Index: linux-2.6-hooks/security/dummy.c
===================================================================
--- linux-2.6.19.orig/security/dummy.c
+++ linux-2.6.19/security/dummy.c
@@ -287,8 +287,8 @@ static int dummy_inode_symlink (struct i
return 0;
--- linux-2.6-hooks.orig/security/dummy.c
+++ linux-2.6-hooks/security/dummy.c
@@ -288,7 +288,7 @@ static int dummy_inode_symlink (struct i
}
-static int dummy_inode_mkdir (struct inode *inode, struct dentry *dentry,
static int dummy_inode_mkdir (struct inode *inode, struct dentry *dentry,
- int mask)
+static int dummy_inode_mkdir (struct inode *inode, struct dentry *dentry,
+ struct vfsmount *mnt, int mask)
{
return 0;
}
Index: linux-2.6.19/security/selinux/hooks.c
Index: linux-2.6-hooks/security/selinux/hooks.c
===================================================================
--- linux-2.6.19.orig/security/selinux/hooks.c
+++ linux-2.6.19/security/selinux/hooks.c
@@ -2160,7 +2160,8 @@ static int selinux_inode_symlink(struct
--- linux-2.6-hooks.orig/security/selinux/hooks.c
+++ linux-2.6-hooks/security/selinux/hooks.c
@@ -2166,7 +2166,8 @@ static int selinux_inode_symlink(struct
return may_create(dir, dentry, SECCLASS_LNK_FILE);
}

View File

@@ -3,11 +3,11 @@ Pass struct vfsmount to the inode_mknod LSM hook
Signed-off-by: Tony Jones <tonyj@suse.de>
Signed-off-by: Andreas Gruenbacher <agruen@suse.de>
Index: linux-2.6.19/fs/namei.c
Index: linux-2.6-hooks/fs/namei.c
===================================================================
--- linux-2.6.19.orig/fs/namei.c
+++ linux-2.6.19/fs/namei.c
@@ -1854,7 +1854,7 @@ int vfs_mknod(struct inode *dir, struct
--- linux-2.6-hooks.orig/fs/namei.c
+++ linux-2.6-hooks/fs/namei.c
@@ -1851,7 +1851,7 @@ int vfs_mknod(struct inode *dir, struct
if (!dir->i_op || !dir->i_op->mknod)
return -EPERM;
@@ -16,30 +16,28 @@ Index: linux-2.6.19/fs/namei.c
if (error)
return error;
Index: linux-2.6.19/include/linux/security.h
Index: linux-2.6-hooks/include/linux/security.h
===================================================================
--- linux-2.6.19.orig/include/linux/security.h
+++ linux-2.6.19/include/linux/security.h
--- linux-2.6-hooks.orig/include/linux/security.h
+++ linux-2.6-hooks/include/linux/security.h
@@ -323,6 +323,7 @@ struct request_sock;
* and not this hook.
* @dir contains the inode structure of parent of the new file.
* @dentry contains the dentry structure of the new file.
+ * @mnt is the vfsmount corresponding to dir (may be NULL)
+ * @mnt is the vfsmount corresponding to @dentry (may be NULL).
* @mode contains the mode of the new file.
* @dev contains the the device number.
* Return 0 if permission is granted.
@@ -1225,8 +1226,8 @@ struct security_operations {
int (*inode_mkdir) (struct inode *dir, struct dentry *dentry,
@@ -1218,7 +1219,7 @@ struct security_operations {
struct vfsmount *mnt, int mode);
int (*inode_rmdir) (struct inode *dir, struct dentry *dentry);
- int (*inode_mknod) (struct inode *dir, struct dentry *dentry,
int (*inode_mknod) (struct inode *dir, struct dentry *dentry,
- int mode, dev_t dev);
+ int (*inode_mknod) (struct inode *dir, struct dentry *dentry,
+ struct vfsmount *mnt, int mode, dev_t dev);
int (*inode_rename) (struct inode *old_dir, struct dentry *old_dentry,
struct inode *new_dir, struct dentry *new_dentry);
int (*inode_readlink) (struct dentry *dentry);
@@ -1679,11 +1680,12 @@ static inline int security_inode_rmdir (
@@ -1670,11 +1671,12 @@ static inline int security_inode_rmdir (
static inline int security_inode_mknod (struct inode *dir,
struct dentry *dentry,
@@ -53,7 +51,7 @@ Index: linux-2.6.19/include/linux/security.h
}
static inline int security_inode_rename (struct inode *old_dir,
@@ -2397,6 +2399,7 @@ static inline int security_inode_rmdir (
@@ -2388,6 +2390,7 @@ static inline int security_inode_rmdir (
static inline int security_inode_mknod (struct inode *dir,
struct dentry *dentry,
@@ -61,10 +59,10 @@ Index: linux-2.6.19/include/linux/security.h
int mode, dev_t dev)
{
return 0;
Index: linux-2.6.19/security/dummy.c
Index: linux-2.6-hooks/security/dummy.c
===================================================================
--- linux-2.6.19.orig/security/dummy.c
+++ linux-2.6.19/security/dummy.c
--- linux-2.6-hooks.orig/security/dummy.c
+++ linux-2.6-hooks/security/dummy.c
@@ -299,7 +299,7 @@ static int dummy_inode_rmdir (struct ino
}
@@ -74,11 +72,11 @@ Index: linux-2.6.19/security/dummy.c
{
return 0;
}
Index: linux-2.6.19/security/selinux/hooks.c
Index: linux-2.6-hooks/security/selinux/hooks.c
===================================================================
--- linux-2.6.19.orig/security/selinux/hooks.c
+++ linux-2.6.19/security/selinux/hooks.c
@@ -2171,11 +2171,12 @@ static int selinux_inode_rmdir(struct in
--- linux-2.6-hooks.orig/security/selinux/hooks.c
+++ linux-2.6-hooks/security/selinux/hooks.c
@@ -2177,11 +2177,12 @@ static int selinux_inode_rmdir(struct in
return may_link(dir, dentry, MAY_RMDIR);
}

View File

@@ -3,11 +3,11 @@ Pass struct vfsmount to the inode_readlink LSM hook
Signed-off-by: Tony Jones <tonyj@suse.de>
Signed-off-by: Andreas Gruenbacher <agruen@suse.de>
Index: linux-2.6.19/fs/stat.c
Index: linux-2.6-hooks/fs/stat.c
===================================================================
--- linux-2.6.19.orig/fs/stat.c
+++ linux-2.6.19/fs/stat.c
@@ -314,7 +314,7 @@ asmlinkage long sys_readlinkat(int dfd,
--- linux-2.6-hooks.orig/fs/stat.c
+++ linux-2.6-hooks/fs/stat.c
@@ -307,7 +307,7 @@ asmlinkage long sys_readlinkat(int dfd,
error = -EINVAL;
if (inode->i_op && inode->i_op->readlink) {
@@ -16,19 +16,19 @@ Index: linux-2.6.19/fs/stat.c
if (!error) {
touch_atime(nd.mnt, nd.dentry);
error = inode->i_op->readlink(nd.dentry, buf, bufsiz);
Index: linux-2.6.19/include/linux/security.h
Index: linux-2.6-hooks/include/linux/security.h
===================================================================
--- linux-2.6.19.orig/include/linux/security.h
+++ linux-2.6.19/include/linux/security.h
--- linux-2.6-hooks.orig/include/linux/security.h
+++ linux-2.6-hooks/include/linux/security.h
@@ -338,6 +338,7 @@ struct request_sock;
* @inode_readlink:
* Check the permission to read the symbolic link.
* @dentry contains the dentry structure for the file link.
+ * @mnt is the vfsmount where the dentry was looked up
+ * @mnt is the vfsmount corresponding to @dentry (may be NULL).
* Return 0 if permission is granted.
* @inode_follow_link:
* Check permission to follow a symbolic link when looking up a pathname.
@@ -1231,7 +1232,7 @@ struct security_operations {
@@ -1223,7 +1224,7 @@ struct security_operations {
struct vfsmount *mnt, int mode, dev_t dev);
int (*inode_rename) (struct inode *old_dir, struct dentry *old_dentry,
struct inode *new_dir, struct dentry *new_dentry);
@@ -37,7 +37,7 @@ Index: linux-2.6.19/include/linux/security.h
int (*inode_follow_link) (struct dentry *dentry, struct nameidata *nd);
int (*inode_permission) (struct inode *inode, int mask, struct nameidata *nd);
int (*inode_setattr) (struct dentry *dentry, struct vfsmount *mnt,
@@ -1702,11 +1703,12 @@ static inline int security_inode_rename
@@ -1693,11 +1694,12 @@ static inline int security_inode_rename
new_dir, new_dentry);
}
@@ -52,7 +52,7 @@ Index: linux-2.6.19/include/linux/security.h
}
static inline int security_inode_follow_link (struct dentry *dentry,
@@ -2416,7 +2418,8 @@ static inline int security_inode_rename
@@ -2407,7 +2409,8 @@ static inline int security_inode_rename
return 0;
}
@@ -62,10 +62,10 @@ Index: linux-2.6.19/include/linux/security.h
{
return 0;
}
Index: linux-2.6.19/security/dummy.c
Index: linux-2.6-hooks/security/dummy.c
===================================================================
--- linux-2.6.19.orig/security/dummy.c
+++ linux-2.6.19/security/dummy.c
--- linux-2.6-hooks.orig/security/dummy.c
+++ linux-2.6-hooks/security/dummy.c
@@ -312,7 +312,7 @@ static int dummy_inode_rename (struct in
return 0;
}
@@ -75,11 +75,11 @@ Index: linux-2.6.19/security/dummy.c
{
return 0;
}
Index: linux-2.6.19/security/selinux/hooks.c
Index: linux-2.6-hooks/security/selinux/hooks.c
===================================================================
--- linux-2.6.19.orig/security/selinux/hooks.c
+++ linux-2.6.19/security/selinux/hooks.c
@@ -2190,7 +2190,7 @@ static int selinux_inode_rename(struct i
--- linux-2.6-hooks.orig/security/selinux/hooks.c
+++ linux-2.6-hooks/security/selinux/hooks.c
@@ -2196,7 +2196,7 @@ static int selinux_inode_rename(struct i
return may_rename(old_inode, old_dentry, new_inode, new_dentry);
}

View File

@@ -3,10 +3,10 @@ Pass struct vfsmount to the inode_removexattr LSM hook
Signed-off-by: Tony Jones <tonyj@suse.de>
Signed-off-by: Andreas Gruenbacher <agruen@suse.de>
Index: linux-2.6.19/fs/xattr.c
Index: linux-2.6-hooks/fs/xattr.c
===================================================================
--- linux-2.6.19.orig/fs/xattr.c
+++ linux-2.6.19/fs/xattr.c
--- linux-2.6-hooks.orig/fs/xattr.c
+++ linux-2.6-hooks/fs/xattr.c
@@ -178,7 +178,7 @@ vfs_removexattr(struct dentry *dentry, s
if (error)
return error;
@@ -16,10 +16,10 @@ Index: linux-2.6.19/fs/xattr.c
if (error)
return error;
Index: linux-2.6.19/include/linux/security.h
Index: linux-2.6-hooks/include/linux/security.h
===================================================================
--- linux-2.6.19.orig/include/linux/security.h
+++ linux-2.6.19/include/linux/security.h
--- linux-2.6-hooks.orig/include/linux/security.h
+++ linux-2.6-hooks/include/linux/security.h
@@ -50,7 +50,7 @@ extern int cap_bprm_set_security (struct
extern void cap_bprm_apply_creds (struct linux_binprm *bprm, int unsafe);
extern int cap_bprm_secureexec(struct linux_binprm *bprm);
@@ -29,7 +29,7 @@ Index: linux-2.6.19/include/linux/security.h
extern int cap_task_post_setuid (uid_t old_ruid, uid_t old_euid, uid_t old_suid, int flags);
extern void cap_task_reparent_to_init (struct task_struct *p);
extern int cap_syslog (int type);
@@ -1259,7 +1259,8 @@ struct security_operations {
@@ -1251,7 +1251,8 @@ struct security_operations {
int (*inode_getxattr) (struct dentry *dentry, struct vfsmount *mnt,
char *name);
int (*inode_listxattr) (struct dentry *dentry, struct vfsmount *mnt);
@@ -39,7 +39,7 @@ Index: linux-2.6.19/include/linux/security.h
const char *(*inode_xattr_getsuffix) (void);
int (*inode_getsecurity)(const struct inode *inode, const char *name, void *buffer, size_t size, int err);
int (*inode_setsecurity)(struct inode *inode, const char *name, const void *value, size_t size, int flags);
@@ -1808,11 +1809,12 @@ static inline int security_inode_listxat
@@ -1799,11 +1800,12 @@ static inline int security_inode_listxat
return security_ops->inode_listxattr (dentry, mnt);
}
@@ -54,7 +54,7 @@ Index: linux-2.6.19/include/linux/security.h
}
static inline const char *security_inode_xattr_getsuffix(void)
@@ -2511,9 +2513,10 @@ static inline int security_inode_listxat
@@ -2502,9 +2504,10 @@ static inline int security_inode_listxat
return 0;
}
@@ -67,10 +67,10 @@ Index: linux-2.6.19/include/linux/security.h
}
static inline const char *security_inode_xattr_getsuffix (void)
Index: linux-2.6.19/security/commoncap.c
Index: linux-2.6-hooks/security/commoncap.c
===================================================================
--- linux-2.6.19.orig/security/commoncap.c
+++ linux-2.6.19/security/commoncap.c
--- linux-2.6-hooks.orig/security/commoncap.c
+++ linux-2.6-hooks/security/commoncap.c
@@ -201,7 +201,8 @@ int cap_inode_setxattr(struct dentry *de
return 0;
}
@@ -81,10 +81,10 @@ Index: linux-2.6.19/security/commoncap.c
{
if (!strncmp(name, XATTR_SECURITY_PREFIX,
sizeof(XATTR_SECURITY_PREFIX) - 1) &&
Index: linux-2.6.19/security/dummy.c
Index: linux-2.6-hooks/security/dummy.c
===================================================================
--- linux-2.6.19.orig/security/dummy.c
+++ linux-2.6.19/security/dummy.c
--- linux-2.6-hooks.orig/security/dummy.c
+++ linux-2.6-hooks/security/dummy.c
@@ -379,7 +379,8 @@ static int dummy_inode_listxattr (struct
return 0;
}
@@ -95,11 +95,11 @@ Index: linux-2.6.19/security/dummy.c
{
if (!strncmp(name, XATTR_SECURITY_PREFIX,
sizeof(XATTR_SECURITY_PREFIX) - 1) &&
Index: linux-2.6.19/security/selinux/hooks.c
Index: linux-2.6-hooks/security/selinux/hooks.c
===================================================================
--- linux-2.6.19.orig/security/selinux/hooks.c
+++ linux-2.6.19/security/selinux/hooks.c
@@ -2357,7 +2357,8 @@ static int selinux_inode_listxattr (stru
--- linux-2.6-hooks.orig/security/selinux/hooks.c
+++ linux-2.6-hooks/security/selinux/hooks.c
@@ -2363,7 +2363,8 @@ static int selinux_inode_listxattr (stru
return dentry_has_perm(current, NULL, dentry, FILE__GETATTR);
}

View File

@@ -3,11 +3,11 @@ Pass struct vfsmount to the inode_rename LSM hook
Signed-off-by: Tony Jones <tonyj@suse.de>
Signed-off-by: Andreas Gruenbacher <agruen@suse.de>
Index: linux-2.6.19/fs/namei.c
Index: linux-2.6-hooks/fs/namei.c
===================================================================
--- linux-2.6.19.orig/fs/namei.c
+++ linux-2.6.19/fs/namei.c
@@ -2402,7 +2402,8 @@ static int vfs_rename_dir(struct inode *
--- linux-2.6-hooks.orig/fs/namei.c
+++ linux-2.6-hooks/fs/namei.c
@@ -2398,7 +2398,8 @@ static int vfs_rename_dir(struct inode *
return error;
}
@@ -17,7 +17,7 @@ Index: linux-2.6.19/fs/namei.c
if (error)
return error;
@@ -2436,7 +2437,8 @@ static int vfs_rename_other(struct inode
@@ -2432,7 +2433,8 @@ static int vfs_rename_other(struct inode
struct inode *target;
int error;
@@ -27,22 +27,22 @@ Index: linux-2.6.19/fs/namei.c
if (error)
return error;
Index: linux-2.6.19/include/linux/security.h
Index: linux-2.6-hooks/include/linux/security.h
===================================================================
--- linux-2.6.19.orig/include/linux/security.h
+++ linux-2.6.19/include/linux/security.h
--- linux-2.6-hooks.orig/include/linux/security.h
+++ linux-2.6-hooks/include/linux/security.h
@@ -336,8 +336,10 @@ struct request_sock;
* Check for permission to rename a file or directory.
* @old_dir contains the inode structure for parent of the old link.
* @old_dentry contains the dentry structure of the old link.
+ * @old_mnt is the vfsmount where @old_dentry was looked up (may be NULL)
+ * @old_mnt is the vfsmount corresponding to @old_dentry (may be NULL).
* @new_dir contains the inode structure for parent of the new link.
* @new_dentry contains the dentry structure of the new link.
+ * @new_mnt is the vfsmount for @new_dentry (may be NULL)
+ * @new_mnt is the vfsmount corresponding to @new_dentry (may be NULL).
* Return 0 if permission is granted.
* @inode_readlink:
* Check the permission to read the symbolic link.
@@ -1238,7 +1240,9 @@ struct security_operations {
@@ -1230,7 +1232,9 @@ struct security_operations {
int (*inode_mknod) (struct inode *dir, struct dentry *dentry,
struct vfsmount *mnt, int mode, dev_t dev);
int (*inode_rename) (struct inode *old_dir, struct dentry *old_dentry,
@@ -53,7 +53,7 @@ Index: linux-2.6.19/include/linux/security.h
int (*inode_readlink) (struct dentry *dentry, struct vfsmount *mnt);
int (*inode_follow_link) (struct dentry *dentry, struct nameidata *nd);
int (*inode_permission) (struct inode *inode, int mask, struct nameidata *nd);
@@ -1705,14 +1709,16 @@ static inline int security_inode_mknod (
@@ -1696,14 +1700,16 @@ static inline int security_inode_mknod (
static inline int security_inode_rename (struct inode *old_dir,
struct dentry *old_dentry,
@@ -73,7 +73,7 @@ Index: linux-2.6.19/include/linux/security.h
}
static inline int security_inode_readlink (struct dentry *dentry,
@@ -2428,8 +2434,10 @@ static inline int security_inode_mknod (
@@ -2419,8 +2425,10 @@ static inline int security_inode_mknod (
static inline int security_inode_rename (struct inode *old_dir,
struct dentry *old_dentry,
@@ -85,10 +85,10 @@ Index: linux-2.6.19/include/linux/security.h
{
return 0;
}
Index: linux-2.6.19/security/dummy.c
Index: linux-2.6-hooks/security/dummy.c
===================================================================
--- linux-2.6.19.orig/security/dummy.c
+++ linux-2.6.19/security/dummy.c
--- linux-2.6-hooks.orig/security/dummy.c
+++ linux-2.6-hooks/security/dummy.c
@@ -310,8 +310,10 @@ static int dummy_inode_mknod (struct ino
static int dummy_inode_rename (struct inode *old_inode,
@@ -101,11 +101,11 @@ Index: linux-2.6.19/security/dummy.c
{
return 0;
}
Index: linux-2.6.19/security/selinux/hooks.c
Index: linux-2.6-hooks/security/selinux/hooks.c
===================================================================
--- linux-2.6.19.orig/security/selinux/hooks.c
+++ linux-2.6.19/security/selinux/hooks.c
@@ -2191,8 +2191,12 @@ static int selinux_inode_mknod(struct in
--- linux-2.6-hooks.orig/security/selinux/hooks.c
+++ linux-2.6-hooks/security/selinux/hooks.c
@@ -2197,8 +2197,12 @@ static int selinux_inode_mknod(struct in
return may_create(dir, dentry, inode_mode_to_security_class(mode));
}

View File

@@ -3,11 +3,11 @@ Pass struct vfsmount to the inode_rmdir LSM hook
Signed-off-by: Tony Jones <tonyj@suse.de>
Signed-off-by: Andreas Gruenbacher <agruen@suse.de>
Index: linux-2.6.19/fs/namei.c
Index: linux-2.6-hooks/fs/namei.c
===================================================================
--- linux-2.6.19.orig/fs/namei.c
+++ linux-2.6.19/fs/namei.c
@@ -2027,7 +2027,7 @@ int vfs_rmdir(struct inode *dir, struct
--- linux-2.6-hooks.orig/fs/namei.c
+++ linux-2.6-hooks/fs/namei.c
@@ -2023,7 +2023,7 @@ int vfs_rmdir(struct inode *dir, struct
if (d_mountpoint(dentry))
error = -EBUSY;
else {
@@ -16,19 +16,19 @@ Index: linux-2.6.19/fs/namei.c
if (!error) {
error = dir->i_op->rmdir(dir, dentry);
if (!error)
Index: linux-2.6.19/include/linux/security.h
Index: linux-2.6-hooks/include/linux/security.h
===================================================================
--- linux-2.6.19.orig/include/linux/security.h
+++ linux-2.6.19/include/linux/security.h
--- linux-2.6-hooks.orig/include/linux/security.h
+++ linux-2.6-hooks/include/linux/security.h
@@ -318,6 +318,7 @@ struct request_sock;
* Check the permission to remove a directory.
* @dir contains the inode structure of parent of the directory to be removed.
* @dentry contains the dentry structure of directory to be removed.
+ * @mnt is the vfsmount where the dentry was looked up (may be NULL)
+ * @mnt is the vfsmount corresponding to @dentry (may be NULL).
* Return 0 if permission is granted.
* @inode_mknod:
* Check permissions when creating a special file (or a socket or a fifo
@@ -1230,7 +1231,8 @@ struct security_operations {
@@ -1222,7 +1223,8 @@ struct security_operations {
struct vfsmount *mnt, const char *old_name);
int (*inode_mkdir) (struct inode *dir, struct dentry *dentry,
struct vfsmount *mnt, int mode);
@@ -38,7 +38,7 @@ Index: linux-2.6.19/include/linux/security.h
int (*inode_mknod) (struct inode *dir, struct dentry *dentry,
struct vfsmount *mnt, int mode, dev_t dev);
int (*inode_rename) (struct inode *old_dir, struct dentry *old_dentry,
@@ -1680,11 +1682,12 @@ static inline int security_inode_mkdir (
@@ -1671,11 +1673,12 @@ static inline int security_inode_mkdir (
}
static inline int security_inode_rmdir (struct inode *dir,
@@ -53,7 +53,7 @@ Index: linux-2.6.19/include/linux/security.h
}
static inline int security_inode_mknod (struct inode *dir,
@@ -2405,7 +2408,8 @@ static inline int security_inode_mkdir (
@@ -2396,7 +2399,8 @@ static inline int security_inode_mkdir (
}
static inline int security_inode_rmdir (struct inode *dir,
@@ -63,10 +63,10 @@ Index: linux-2.6.19/include/linux/security.h
{
return 0;
}
Index: linux-2.6.19/security/dummy.c
Index: linux-2.6-hooks/security/dummy.c
===================================================================
--- linux-2.6.19.orig/security/dummy.c
+++ linux-2.6.19/security/dummy.c
--- linux-2.6-hooks.orig/security/dummy.c
+++ linux-2.6-hooks/security/dummy.c
@@ -295,7 +295,8 @@ static int dummy_inode_mkdir (struct ino
return 0;
}
@@ -77,11 +77,11 @@ Index: linux-2.6.19/security/dummy.c
{
return 0;
}
Index: linux-2.6.19/security/selinux/hooks.c
Index: linux-2.6-hooks/security/selinux/hooks.c
===================================================================
--- linux-2.6.19.orig/security/selinux/hooks.c
+++ linux-2.6.19/security/selinux/hooks.c
@@ -2172,7 +2172,8 @@ static int selinux_inode_mkdir(struct in
--- linux-2.6-hooks.orig/security/selinux/hooks.c
+++ linux-2.6-hooks/security/selinux/hooks.c
@@ -2178,7 +2178,8 @@ static int selinux_inode_mkdir(struct in
return may_create(dir, dentry, SECCLASS_DIR);
}

View File

@@ -3,11 +3,11 @@ Pass struct vfsmount to the inode_setattr LSM hook
Signed-off-by: Tony Jones <tonyj@suse.de>
Signed-off-by: Andreas Gruenbacher <agruen@suse.de>
Index: linux-2.6.19/fs/attr.c
Index: linux-2.6-hooks/fs/attr.c
===================================================================
--- linux-2.6.19.orig/fs/attr.c
+++ linux-2.6.19/fs/attr.c
@@ -145,13 +145,13 @@ int notify_change(struct dentry * dentry
--- linux-2.6-hooks.orig/fs/attr.c
+++ linux-2.6-hooks/fs/attr.c
@@ -145,13 +145,13 @@ int notify_change(struct dentry *dentry,
down_write(&dentry->d_inode->i_alloc_sem);
if (inode->i_op && inode->i_op->setattr) {
@@ -23,19 +23,19 @@ Index: linux-2.6.19/fs/attr.c
if (!error) {
if ((ia_valid & ATTR_UID && attr->ia_uid != inode->i_uid) ||
(ia_valid & ATTR_GID && attr->ia_gid != inode->i_gid))
Index: linux-2.6.19/include/linux/security.h
Index: linux-2.6-hooks/include/linux/security.h
===================================================================
--- linux-2.6.19.orig/include/linux/security.h
+++ linux-2.6.19/include/linux/security.h
--- linux-2.6-hooks.orig/include/linux/security.h
+++ linux-2.6-hooks/include/linux/security.h
@@ -358,6 +358,7 @@ struct request_sock;
* file attributes change (such as when a file is truncated, chown/chmod
* operations, transferring disk quotas, etc).
* @dentry contains the dentry structure for the file.
+ * @mnt is the vfsmount where the dentry was looked up (may be NULL)
+ * @mnt is the vfsmount corresponding to @dentry (may be NULL).
* @attr is the iattr structure containing the new file attributes.
* Return 0 if permission is granted.
* @inode_getattr:
@@ -1229,7 +1230,8 @@ struct security_operations {
@@ -1221,7 +1222,8 @@ struct security_operations {
int (*inode_readlink) (struct dentry *dentry);
int (*inode_follow_link) (struct dentry *dentry, struct nameidata *nd);
int (*inode_permission) (struct inode *inode, int mask, struct nameidata *nd);
@@ -45,7 +45,7 @@ Index: linux-2.6.19/include/linux/security.h
int (*inode_getattr) (struct vfsmount *mnt, struct dentry *dentry);
void (*inode_delete) (struct inode *inode);
int (*inode_setxattr) (struct dentry *dentry, char *name, void *value,
@@ -1717,11 +1719,12 @@ static inline int security_inode_permiss
@@ -1708,11 +1710,12 @@ static inline int security_inode_permiss
}
static inline int security_inode_setattr (struct dentry *dentry,
@@ -59,7 +59,7 @@ Index: linux-2.6.19/include/linux/security.h
}
static inline int security_inode_getattr (struct vfsmount *mnt,
@@ -2421,6 +2424,7 @@ static inline int security_inode_permiss
@@ -2412,6 +2415,7 @@ static inline int security_inode_permiss
}
static inline int security_inode_setattr (struct dentry *dentry,
@@ -67,10 +67,10 @@ Index: linux-2.6.19/include/linux/security.h
struct iattr *attr)
{
return 0;
Index: linux-2.6.19/security/dummy.c
Index: linux-2.6-hooks/security/dummy.c
===================================================================
--- linux-2.6.19.orig/security/dummy.c
+++ linux-2.6.19/security/dummy.c
--- linux-2.6-hooks.orig/security/dummy.c
+++ linux-2.6-hooks/security/dummy.c
@@ -328,7 +328,8 @@ static int dummy_inode_permission (struc
return 0;
}
@@ -81,11 +81,11 @@ Index: linux-2.6.19/security/dummy.c
{
return 0;
}
Index: linux-2.6.19/security/selinux/hooks.c
Index: linux-2.6-hooks/security/selinux/hooks.c
===================================================================
--- linux-2.6.19.orig/security/selinux/hooks.c
+++ linux-2.6.19/security/selinux/hooks.c
@@ -2220,11 +2220,12 @@ static int selinux_inode_permission(stru
--- linux-2.6-hooks.orig/security/selinux/hooks.c
+++ linux-2.6-hooks/security/selinux/hooks.c
@@ -2226,11 +2226,12 @@ static int selinux_inode_permission(stru
file_mask_to_av(inode->i_mode, mask), NULL);
}

View File

@@ -3,10 +3,10 @@ Pass struct vfsmount to the inode_setxattr LSM hook
Signed-off-by: Tony Jones <tonyj@suse.de>
Signed-off-by: Andreas Gruenbacher <agruen@suse.de>
Index: linux-2.6.19/include/linux/security.h
Index: linux-2.6-hooks/include/linux/security.h
===================================================================
--- linux-2.6.19.orig/include/linux/security.h
+++ linux-2.6.19/include/linux/security.h
--- linux-2.6-hooks.orig/include/linux/security.h
+++ linux-2.6-hooks/include/linux/security.h
@@ -49,7 +49,7 @@ extern void cap_capset_set (struct task_
extern int cap_bprm_set_security (struct linux_binprm *bprm);
extern void cap_bprm_apply_creds (struct linux_binprm *bprm, int unsafe);
@@ -30,7 +30,7 @@ Index: linux-2.6.19/include/linux/security.h
* @inode_getxattr:
* Check permission before obtaining the extended attributes
* identified by @name for @dentry.
@@ -1250,9 +1250,11 @@ struct security_operations {
@@ -1242,9 +1242,11 @@ struct security_operations {
struct iattr *attr);
int (*inode_getattr) (struct vfsmount *mnt, struct dentry *dentry);
void (*inode_delete) (struct inode *inode);
@@ -45,7 +45,7 @@ Index: linux-2.6.19/include/linux/security.h
size_t size, int flags);
int (*inode_getxattr) (struct dentry *dentry, char *name);
int (*inode_listxattr) (struct dentry *dentry);
@@ -1769,20 +1771,24 @@ static inline void security_inode_delete
@@ -1760,20 +1762,24 @@ static inline void security_inode_delete
security_ops->inode_delete (inode);
}
@@ -75,12 +75,12 @@ Index: linux-2.6.19/include/linux/security.h
}
static inline int security_inode_getxattr (struct dentry *dentry, char *name)
@@ -2476,14 +2482,18 @@ static inline int security_inode_getattr
@@ -2467,14 +2473,18 @@ static inline int security_inode_getattr
static inline void security_inode_delete (struct inode *inode)
{ }
-static inline int security_inode_setxattr (struct dentry *dentry, char *name,
+static inline int security_inode_setxattr (struct dentry *dentry,,
+static inline int security_inode_setxattr (struct dentry *dentry,
+ struct vfsmount *mnt, char *name,
void *value, size_t size, int flags)
{
@@ -98,10 +98,10 @@ Index: linux-2.6.19/include/linux/security.h
{ }
static inline int security_inode_getxattr (struct dentry *dentry, char *name)
Index: linux-2.6.19/security/commoncap.c
Index: linux-2.6-hooks/security/commoncap.c
===================================================================
--- linux-2.6.19.orig/security/commoncap.c
+++ linux-2.6.19/security/commoncap.c
--- linux-2.6-hooks.orig/security/commoncap.c
+++ linux-2.6-hooks/security/commoncap.c
@@ -191,8 +191,8 @@ int cap_bprm_secureexec (struct linux_bi
current->egid != current->gid);
}
@@ -113,10 +113,10 @@ Index: linux-2.6.19/security/commoncap.c
{
if (!strncmp(name, XATTR_SECURITY_PREFIX,
sizeof(XATTR_SECURITY_PREFIX) - 1) &&
Index: linux-2.6.19/security/dummy.c
Index: linux-2.6-hooks/security/dummy.c
===================================================================
--- linux-2.6.19.orig/security/dummy.c
+++ linux-2.6.19/security/dummy.c
--- linux-2.6-hooks.orig/security/dummy.c
+++ linux-2.6-hooks/security/dummy.c
@@ -350,8 +350,9 @@ static void dummy_inode_delete (struct i
return;
}
@@ -140,11 +140,11 @@ Index: linux-2.6.19/security/dummy.c
size_t size, int flags)
{
}
Index: linux-2.6.19/security/selinux/hooks.c
Index: linux-2.6-hooks/security/selinux/hooks.c
===================================================================
--- linux-2.6.19.orig/security/selinux/hooks.c
+++ linux-2.6.19/security/selinux/hooks.c
@@ -2258,7 +2258,9 @@ static int selinux_inode_getattr(struct
--- linux-2.6-hooks.orig/security/selinux/hooks.c
+++ linux-2.6-hooks/security/selinux/hooks.c
@@ -2264,7 +2264,9 @@ static int selinux_inode_getattr(struct
return dentry_has_perm(current, mnt, dentry, FILE__GETATTR);
}
@@ -155,7 +155,7 @@ Index: linux-2.6.19/security/selinux/hooks.c
{
struct task_security_struct *tsec = current->security;
struct inode *inode = dentry->d_inode;
@@ -2318,7 +2320,9 @@ static int selinux_inode_setxattr(struct
@@ -2324,7 +2326,9 @@ static int selinux_inode_setxattr(struct
&ad);
}
@@ -166,10 +166,10 @@ Index: linux-2.6.19/security/selinux/hooks.c
void *value, size_t size, int flags)
{
struct inode *inode = dentry->d_inode;
Index: linux-2.6.19/fs/xattr.c
Index: linux-2.6-hooks/fs/xattr.c
===================================================================
--- linux-2.6.19.orig/fs/xattr.c
+++ linux-2.6.19/fs/xattr.c
--- linux-2.6-hooks.orig/fs/xattr.c
+++ linux-2.6-hooks/fs/xattr.c
@@ -81,7 +81,7 @@ vfs_setxattr(struct dentry *dentry, stru
return error;

View File

@@ -3,11 +3,11 @@ Pass struct vfsmount to the inode_symlink LSM hook.
Signed-off-by: Tony Jones <tonyj@suse.de>
Signed-off-by: Andreas Gruenbacher <agruen@suse.de>
Index: linux-2.6.19/fs/namei.c
Index: linux-2.6-hooks/fs/namei.c
===================================================================
--- linux-2.6.19.orig/fs/namei.c
+++ linux-2.6.19/fs/namei.c
@@ -2200,7 +2200,7 @@ int vfs_symlink(struct inode *dir, struc
--- linux-2.6-hooks.orig/fs/namei.c
+++ linux-2.6-hooks/fs/namei.c
@@ -2196,7 +2196,7 @@ int vfs_symlink(struct inode *dir, struc
if (!dir->i_op || !dir->i_op->symlink)
return -EPERM;
@@ -16,19 +16,19 @@ Index: linux-2.6.19/fs/namei.c
if (error)
return error;
Index: linux-2.6.19/include/linux/security.h
Index: linux-2.6-hooks/include/linux/security.h
===================================================================
--- linux-2.6.19.orig/include/linux/security.h
+++ linux-2.6.19/include/linux/security.h
--- linux-2.6-hooks.orig/include/linux/security.h
+++ linux-2.6-hooks/include/linux/security.h
@@ -301,6 +301,7 @@ struct request_sock;
* Check the permission to create a symbolic link to a file.
* @dir contains the inode structure of parent directory of the symbolic link.
* @dentry contains the dentry structure of the symbolic link.
+ * @mnt is the vfsmount corresponding to dir (may be NULL)
+ * @mnt is the vfsmount corresponding to @dentry (may be NULL).
* @old_name contains the pathname of file.
* Return 0 if permission is granted.
* @inode_mkdir:
@@ -1221,8 +1222,8 @@ struct security_operations {
@@ -1213,8 +1214,8 @@ struct security_operations {
int (*inode_link) (struct dentry *old_dentry,
struct inode *dir, struct dentry *new_dentry);
int (*inode_unlink) (struct inode *dir, struct dentry *dentry);
@@ -39,7 +39,7 @@ Index: linux-2.6.19/include/linux/security.h
int (*inode_mkdir) (struct inode *dir, struct dentry *dentry,
struct vfsmount *mnt, int mode);
int (*inode_rmdir) (struct inode *dir, struct dentry *dentry);
@@ -1653,11 +1654,12 @@ static inline int security_inode_unlink
@@ -1644,11 +1645,12 @@ static inline int security_inode_unlink
static inline int security_inode_symlink (struct inode *dir,
struct dentry *dentry,
@@ -53,7 +53,7 @@ Index: linux-2.6.19/include/linux/security.h
}
static inline int security_inode_mkdir (struct inode *dir,
@@ -2378,6 +2380,7 @@ static inline int security_inode_unlink
@@ -2369,6 +2371,7 @@ static inline int security_inode_unlink
static inline int security_inode_symlink (struct inode *dir,
struct dentry *dentry,
@@ -61,10 +61,10 @@ Index: linux-2.6.19/include/linux/security.h
const char *old_name)
{
return 0;
Index: linux-2.6.19/security/dummy.c
Index: linux-2.6-hooks/security/dummy.c
===================================================================
--- linux-2.6.19.orig/security/dummy.c
+++ linux-2.6.19/security/dummy.c
--- linux-2.6-hooks.orig/security/dummy.c
+++ linux-2.6-hooks/security/dummy.c
@@ -282,7 +282,7 @@ static int dummy_inode_unlink (struct in
}
@@ -74,11 +74,11 @@ Index: linux-2.6.19/security/dummy.c
{
return 0;
}
Index: linux-2.6.19/security/selinux/hooks.c
Index: linux-2.6-hooks/security/selinux/hooks.c
===================================================================
--- linux-2.6.19.orig/security/selinux/hooks.c
+++ linux-2.6.19/security/selinux/hooks.c
@@ -2155,7 +2155,8 @@ static int selinux_inode_unlink(struct i
--- linux-2.6-hooks.orig/security/selinux/hooks.c
+++ linux-2.6-hooks/security/selinux/hooks.c
@@ -2161,7 +2161,8 @@ static int selinux_inode_unlink(struct i
return may_link(dir, dentry, MAY_UNLINK);
}

View File

@@ -3,11 +3,11 @@ Pass struct vfsmount to the inode_unlink LSM hook
Signed-off-by: Tony Jones <tonyj@suse.de>
Signed-off-by: Andreas Gruenbacher <agruen@suse.de>
Index: linux-2.6.19/fs/namei.c
Index: linux-2.6-hooks/fs/namei.c
===================================================================
--- linux-2.6.19.orig/fs/namei.c
+++ linux-2.6.19/fs/namei.c
@@ -2106,7 +2106,7 @@ int vfs_unlink(struct inode *dir, struct
--- linux-2.6-hooks.orig/fs/namei.c
+++ linux-2.6-hooks/fs/namei.c
@@ -2102,7 +2102,7 @@ int vfs_unlink(struct inode *dir, struct
if (d_mountpoint(dentry))
error = -EBUSY;
else {
@@ -16,19 +16,19 @@ Index: linux-2.6.19/fs/namei.c
if (!error)
error = dir->i_op->unlink(dir, dentry);
}
Index: linux-2.6.19/include/linux/security.h
Index: linux-2.6-hooks/include/linux/security.h
===================================================================
--- linux-2.6.19.orig/include/linux/security.h
+++ linux-2.6.19/include/linux/security.h
--- linux-2.6-hooks.orig/include/linux/security.h
+++ linux-2.6-hooks/include/linux/security.h
@@ -298,6 +298,7 @@ struct request_sock;
* Check the permission to remove a hard link to a file.
* @dir contains the inode structure of parent directory of the file.
* @dentry contains the dentry structure for file to be unlinked.
+ * @mnt is the vfsmount where the dentry was looked up (may be NULL)
+ * @mnt is the vfsmount corresponding to @dentry (may be NULL).
* Return 0 if permission is granted.
* @inode_symlink:
* Check the permission to create a symbolic link to a file.
@@ -1226,7 +1227,8 @@ struct security_operations {
@@ -1218,7 +1219,8 @@ struct security_operations {
int (*inode_link) (struct dentry *old_dentry, struct vfsmount *old_mnt,
struct inode *dir, struct dentry *new_dentry,
struct vfsmount *new_mnt);
@@ -38,7 +38,7 @@ Index: linux-2.6.19/include/linux/security.h
int (*inode_symlink) (struct inode *dir, struct dentry *dentry,
struct vfsmount *mnt, const char *old_name);
int (*inode_mkdir) (struct inode *dir, struct dentry *dentry,
@@ -1654,11 +1656,12 @@ static inline int security_inode_link (s
@@ -1645,11 +1647,12 @@ static inline int security_inode_link (s
}
static inline int security_inode_unlink (struct inode *dir,
@@ -53,7 +53,7 @@ Index: linux-2.6.19/include/linux/security.h
}
static inline int security_inode_symlink (struct inode *dir,
@@ -2386,7 +2389,8 @@ static inline int security_inode_link (s
@@ -2377,7 +2380,8 @@ static inline int security_inode_link (s
}
static inline int security_inode_unlink (struct inode *dir,
@@ -63,10 +63,10 @@ Index: linux-2.6.19/include/linux/security.h
{
return 0;
}
Index: linux-2.6.19/security/dummy.c
Index: linux-2.6-hooks/security/dummy.c
===================================================================
--- linux-2.6.19.orig/security/dummy.c
+++ linux-2.6.19/security/dummy.c
--- linux-2.6-hooks.orig/security/dummy.c
+++ linux-2.6-hooks/security/dummy.c
@@ -278,7 +278,8 @@ static int dummy_inode_link (struct dent
return 0;
}
@@ -77,11 +77,11 @@ Index: linux-2.6.19/security/dummy.c
{
return 0;
}
Index: linux-2.6.19/security/selinux/hooks.c
Index: linux-2.6-hooks/security/selinux/hooks.c
===================================================================
--- linux-2.6.19.orig/security/selinux/hooks.c
+++ linux-2.6.19/security/selinux/hooks.c
@@ -2150,11 +2150,12 @@ static int selinux_inode_link(struct den
--- linux-2.6-hooks.orig/security/selinux/hooks.c
+++ linux-2.6-hooks/security/selinux/hooks.c
@@ -2156,11 +2156,12 @@ static int selinux_inode_link(struct den
return may_link(dir, old_dentry, MAY_LINK);
}

View File

@@ -36,7 +36,7 @@ apparmor.diff
apparmor-vfsmnt.diff
apparmor-builtinonly.diff
apparmor-bootdisable.diff
apparmor-twophaseinit.diff
# apparmor-twophaseinit.diff
apparmor-novalidfstype.diff
apparmor-match_perms.diff
apparmor-dfa.diff

View File

@@ -3,10 +3,10 @@ Add a struct vfsmount parameter to vfs_getxattr()
Signed-off-by: Tony Jones <tonyj@suse.de>
Signed-off-by: Andreas Gruenbacher <agruen@suse.de>
Index: linux-2.6.19/fs/nfsd/vfs.c
Index: linux-2.6-hooks/fs/nfsd/vfs.c
===================================================================
--- linux-2.6.19.orig/fs/nfsd/vfs.c
+++ linux-2.6.19/fs/nfsd/vfs.c
--- linux-2.6-hooks.orig/fs/nfsd/vfs.c
+++ linux-2.6-hooks/fs/nfsd/vfs.c
@@ -383,7 +383,7 @@ static ssize_t nfsd_getxattr(struct dent
{
ssize_t buflen;
@@ -25,10 +25,10 @@ Index: linux-2.6.19/fs/nfsd/vfs.c
}
#endif
Index: linux-2.6.19/fs/xattr.c
Index: linux-2.6-hooks/fs/xattr.c
===================================================================
--- linux-2.6.19.orig/fs/xattr.c
+++ linux-2.6.19/fs/xattr.c
--- linux-2.6-hooks.orig/fs/xattr.c
+++ linux-2.6-hooks/fs/xattr.c
@@ -107,7 +107,8 @@ out:
EXPORT_SYMBOL_GPL(vfs_setxattr);
@@ -80,15 +80,15 @@ Index: linux-2.6.19/fs/xattr.c
f = fget(fd);
if (!f)
return error;
- error = getxattr(f->f_dentry, name, value, size);
+ error = getxattr(f->f_dentry, f->f_vfsmnt, name, value, size);
- error = getxattr(f->f_path.dentry, name, value, size);
+ error = getxattr(f->f_path.dentry, f->f_path.mnt, name, value, size);
fput(f);
return error;
}
Index: linux-2.6.19/include/linux/xattr.h
Index: linux-2.6-hooks/include/linux/xattr.h
===================================================================
--- linux-2.6.19.orig/include/linux/xattr.h
+++ linux-2.6.19/include/linux/xattr.h
--- linux-2.6-hooks.orig/include/linux/xattr.h
+++ linux-2.6-hooks/include/linux/xattr.h
@@ -40,7 +40,8 @@ struct xattr_handler {
size_t size, int flags);
};

View File

@@ -3,11 +3,11 @@ Add struct vfsmount parameters to vfs_link()
Signed-off-by: Tony Jones <tonyj@suse.de>
Signed-off-by: Andreas Gruenbacher <agruen@suse.de>
Index: linux-2.6.19/fs/namei.c
Index: linux-2.6-hooks/fs/namei.c
===================================================================
--- linux-2.6.19.orig/fs/namei.c
+++ linux-2.6.19/fs/namei.c
@@ -2254,7 +2254,7 @@ asmlinkage long sys_symlink(const char _
--- linux-2.6-hooks.orig/fs/namei.c
+++ linux-2.6-hooks/fs/namei.c
@@ -2250,7 +2250,7 @@ asmlinkage long sys_symlink(const char _
return sys_symlinkat(oldname, AT_FDCWD, newname);
}
@@ -16,7 +16,7 @@ Index: linux-2.6.19/fs/namei.c
{
struct inode *inode = old_dentry->d_inode;
int error;
@@ -2332,7 +2332,8 @@ asmlinkage long sys_linkat(int olddfd, c
@@ -2328,7 +2328,8 @@ asmlinkage long sys_linkat(int olddfd, c
error = PTR_ERR(new_dentry);
if (IS_ERR(new_dentry))
goto out_unlock;
@@ -26,11 +26,11 @@ Index: linux-2.6.19/fs/namei.c
dput(new_dentry);
out_unlock:
mutex_unlock(&nd.dentry->d_inode->i_mutex);
Index: linux-2.6.19/include/linux/fs.h
Index: linux-2.6-hooks/include/linux/fs.h
===================================================================
--- linux-2.6.19.orig/include/linux/fs.h
+++ linux-2.6.19/include/linux/fs.h
@@ -1016,7 +1016,7 @@ extern int vfs_create(struct inode *, st
--- linux-2.6-hooks.orig/include/linux/fs.h
+++ linux-2.6-hooks/include/linux/fs.h
@@ -982,7 +982,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);
@@ -39,11 +39,11 @@ Index: linux-2.6.19/include/linux/fs.h
extern int vfs_rmdir(struct inode *, struct dentry *);
extern int vfs_unlink(struct inode *, struct dentry *);
extern int vfs_rename(struct inode *, struct dentry *, struct inode *, struct dentry *);
Index: linux-2.6.19/fs/ecryptfs/inode.c
Index: linux-2.6-hooks/fs/ecryptfs/inode.c
===================================================================
--- linux-2.6.19.orig/fs/ecryptfs/inode.c
+++ linux-2.6.19/fs/ecryptfs/inode.c
@@ -444,19 +444,24 @@ static int ecryptfs_link(struct dentry *
--- linux-2.6-hooks.orig/fs/ecryptfs/inode.c
+++ linux-2.6-hooks/fs/ecryptfs/inode.c
@@ -403,19 +403,24 @@ static int ecryptfs_link(struct dentry *
struct dentry *new_dentry)
{
struct dentry *lower_old_dentry;
@@ -70,11 +70,11 @@ Index: linux-2.6.19/fs/ecryptfs/inode.c
if (rc || !lower_new_dentry->d_inode)
goto out_lock;
rc = ecryptfs_interpose(lower_new_dentry, new_dentry, dir->i_sb, 0);
Index: linux-2.6.19/fs/nfsd/vfs.c
Index: linux-2.6-hooks/fs/nfsd/vfs.c
===================================================================
--- linux-2.6.19.orig/fs/nfsd/vfs.c
+++ linux-2.6.19/fs/nfsd/vfs.c
@@ -1538,7 +1538,7 @@ nfsd_link(struct svc_rqst *rqstp, struct
--- linux-2.6-hooks.orig/fs/nfsd/vfs.c
+++ linux-2.6-hooks/fs/nfsd/vfs.c
@@ -1528,7 +1528,7 @@ nfsd_link(struct svc_rqst *rqstp, struct
dold = tfhp->fh_dentry;
dest = dold->d_inode;

View File

@@ -3,10 +3,10 @@ Add a struct vfsmount parameter to vfs_listxattr()
Signed-off-by: Tony Jones <tonyj@suse.de>
Signed-off-by: Andreas Gruenbacher <agruen@suse.de>
Index: linux-2.6.19/fs/xattr.c
Index: linux-2.6-hooks/fs/xattr.c
===================================================================
--- linux-2.6.19.orig/fs/xattr.c
+++ linux-2.6.19/fs/xattr.c
--- linux-2.6-hooks.orig/fs/xattr.c
+++ linux-2.6-hooks/fs/xattr.c
@@ -144,18 +144,20 @@ vfs_getxattr(struct dentry *dentry, stru
EXPORT_SYMBOL_GPL(vfs_getxattr);
@@ -75,15 +75,15 @@ Index: linux-2.6.19/fs/xattr.c
f = fget(fd);
if (!f)
return error;
- error = listxattr(f->f_dentry, list, size);
+ error = listxattr(f->f_dentry, f->f_vfsmnt, list, size);
- error = listxattr(f->f_path.dentry, list, size);
+ error = listxattr(f->f_path.dentry, f->f_path.mnt, list, size);
fput(f);
return error;
}
Index: linux-2.6.19/include/linux/xattr.h
Index: linux-2.6-hooks/include/linux/xattr.h
===================================================================
--- linux-2.6.19.orig/include/linux/xattr.h
+++ linux-2.6.19/include/linux/xattr.h
--- linux-2.6-hooks.orig/include/linux/xattr.h
+++ linux-2.6-hooks/include/linux/xattr.h
@@ -42,7 +42,8 @@ struct xattr_handler {
ssize_t vfs_getxattr(struct dentry *, struct vfsmount *, char *, void *,

View File

@@ -3,11 +3,11 @@ Add struct vfsmount parameter to vfs_mkdir
Signed-off-by: Tony Jones <tonyj@suse.de>
Signed-off-by: Andreas Gruenbacher <agruen@suse.de>
Index: linux-2.6.19/fs/ecryptfs/inode.c
Index: linux-2.6-hooks/fs/ecryptfs/inode.c
===================================================================
--- linux-2.6.19.orig/fs/ecryptfs/inode.c
+++ linux-2.6.19/fs/ecryptfs/inode.c
@@ -540,11 +540,14 @@ static int ecryptfs_mkdir(struct inode *
--- linux-2.6-hooks.orig/fs/ecryptfs/inode.c
+++ linux-2.6-hooks/fs/ecryptfs/inode.c
@@ -501,11 +501,14 @@ static int ecryptfs_mkdir(struct inode *
{
int rc;
struct dentry *lower_dentry;
@@ -23,11 +23,11 @@ Index: linux-2.6.19/fs/ecryptfs/inode.c
if (rc || !lower_dentry->d_inode)
goto out;
rc = ecryptfs_interpose(lower_dentry, dentry, dir->i_sb, 0);
Index: linux-2.6.19/fs/namei.c
Index: linux-2.6-hooks/fs/namei.c
===================================================================
--- linux-2.6.19.orig/fs/namei.c
+++ linux-2.6.19/fs/namei.c
@@ -1919,7 +1919,8 @@ asmlinkage long sys_mknod(const char __u
--- linux-2.6-hooks.orig/fs/namei.c
+++ linux-2.6-hooks/fs/namei.c
@@ -1916,7 +1916,8 @@ asmlinkage long sys_mknod(const char __u
return sys_mknodat(AT_FDCWD, filename, mode, dev);
}
@@ -37,7 +37,7 @@ Index: linux-2.6.19/fs/namei.c
{
int error = may_create(dir, dentry, NULL);
@@ -1963,7 +1964,7 @@ asmlinkage long sys_mkdirat(int dfd, con
@@ -1960,7 +1961,7 @@ asmlinkage long sys_mkdirat(int dfd, con
if (!IS_POSIXACL(nd.dentry->d_inode))
mode &= ~current->fs->umask;
@@ -46,10 +46,10 @@ Index: linux-2.6.19/fs/namei.c
dput(dentry);
out_unlock:
mutex_unlock(&nd.dentry->d_inode->i_mutex);
Index: linux-2.6.19/fs/nfsd/nfs4recover.c
Index: linux-2.6-hooks/fs/nfsd/nfs4recover.c
===================================================================
--- linux-2.6.19.orig/fs/nfsd/nfs4recover.c
+++ linux-2.6.19/fs/nfsd/nfs4recover.c
--- linux-2.6-hooks.orig/fs/nfsd/nfs4recover.c
+++ linux-2.6-hooks/fs/nfsd/nfs4recover.c
@@ -156,7 +156,7 @@ nfsd4_create_clid_dir(struct nfs4_client
dprintk("NFSD: nfsd4_create_clid_dir: DIRECTORY EXISTS\n");
goto out_put;
@@ -59,11 +59,11 @@ Index: linux-2.6.19/fs/nfsd/nfs4recover.c
out_put:
dput(dentry);
out_unlock:
Index: linux-2.6.19/fs/nfsd/vfs.c
Index: linux-2.6-hooks/fs/nfsd/vfs.c
===================================================================
--- linux-2.6.19.orig/fs/nfsd/vfs.c
+++ linux-2.6.19/fs/nfsd/vfs.c
@@ -1183,7 +1183,7 @@ nfsd_create(struct svc_rqst *rqstp, stru
--- linux-2.6-hooks.orig/fs/nfsd/vfs.c
+++ linux-2.6-hooks/fs/nfsd/vfs.c
@@ -1184,7 +1184,7 @@ nfsd_create(struct svc_rqst *rqstp, stru
host_err = vfs_create(dirp, dchild, iap->ia_mode, NULL);
break;
case S_IFDIR:
@@ -72,11 +72,11 @@ Index: linux-2.6.19/fs/nfsd/vfs.c
break;
case S_IFCHR:
case S_IFBLK:
Index: linux-2.6.19/include/linux/fs.h
Index: linux-2.6-hooks/include/linux/fs.h
===================================================================
--- linux-2.6.19.orig/include/linux/fs.h
+++ linux-2.6.19/include/linux/fs.h
@@ -1013,7 +1013,7 @@ static inline void unlock_super(struct s
--- linux-2.6-hooks.orig/include/linux/fs.h
+++ linux-2.6-hooks/include/linux/fs.h
@@ -979,7 +979,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

@@ -3,11 +3,11 @@ Add a struct vfsmount parameter to vfs_mknod()
Signed-off-by: Tony Jones <tonyj@suse.de>
Signed-off-by: Andreas Gruenbacher <agruen@suse.de>
Index: linux-2.6.19/fs/ecryptfs/inode.c
Index: linux-2.6-hooks/fs/ecryptfs/inode.c
===================================================================
--- linux-2.6.19.orig/fs/ecryptfs/inode.c
+++ linux-2.6.19/fs/ecryptfs/inode.c
@@ -590,11 +590,14 @@ ecryptfs_mknod(struct inode *dir, struct
--- linux-2.6-hooks.orig/fs/ecryptfs/inode.c
+++ linux-2.6-hooks/fs/ecryptfs/inode.c
@@ -552,11 +552,14 @@ ecryptfs_mknod(struct inode *dir, struct
{
int rc;
struct dentry *lower_dentry;
@@ -23,11 +23,11 @@ Index: linux-2.6.19/fs/ecryptfs/inode.c
if (rc || !lower_dentry->d_inode)
goto out;
rc = ecryptfs_interpose(lower_dentry, dentry, dir->i_sb, 0);
Index: linux-2.6.19/fs/namei.c
Index: linux-2.6-hooks/fs/namei.c
===================================================================
--- linux-2.6.19.orig/fs/namei.c
+++ linux-2.6.19/fs/namei.c
@@ -1840,7 +1840,8 @@ fail:
--- linux-2.6-hooks.orig/fs/namei.c
+++ linux-2.6-hooks/fs/namei.c
@@ -1837,7 +1837,8 @@ fail:
}
EXPORT_SYMBOL_GPL(lookup_create);
@@ -37,7 +37,7 @@ Index: linux-2.6.19/fs/namei.c
{
int error = may_create(dir, dentry, NULL);
@@ -1892,11 +1893,12 @@ asmlinkage long sys_mknodat(int dfd, con
@@ -1889,11 +1890,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:
@@ -53,11 +53,11 @@ Index: linux-2.6.19/fs/namei.c
break;
case S_IFDIR:
error = -EPERM;
Index: linux-2.6.19/fs/nfsd/vfs.c
Index: linux-2.6-hooks/fs/nfsd/vfs.c
===================================================================
--- linux-2.6.19.orig/fs/nfsd/vfs.c
+++ linux-2.6.19/fs/nfsd/vfs.c
@@ -1189,7 +1189,7 @@ nfsd_create(struct svc_rqst *rqstp, stru
--- linux-2.6-hooks.orig/fs/nfsd/vfs.c
+++ linux-2.6-hooks/fs/nfsd/vfs.c
@@ -1190,7 +1190,7 @@ nfsd_create(struct svc_rqst *rqstp, stru
case S_IFBLK:
case S_IFIFO:
case S_IFSOCK:
@@ -66,11 +66,11 @@ Index: linux-2.6.19/fs/nfsd/vfs.c
break;
default:
printk("nfsd: bad file type %o in nfsd_create\n", type);
Index: linux-2.6.19/include/linux/fs.h
Index: linux-2.6-hooks/include/linux/fs.h
===================================================================
--- linux-2.6.19.orig/include/linux/fs.h
+++ linux-2.6.19/include/linux/fs.h
@@ -1014,7 +1014,7 @@ static inline void unlock_super(struct s
--- linux-2.6-hooks.orig/include/linux/fs.h
+++ linux-2.6-hooks/include/linux/fs.h
@@ -980,7 +980,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);
@@ -79,11 +79,11 @@ Index: linux-2.6.19/include/linux/fs.h
extern int vfs_symlink(struct inode *, struct dentry *, const char *, int);
extern int vfs_link(struct dentry *, struct inode *, struct dentry *);
extern int vfs_rmdir(struct inode *, struct dentry *);
Index: linux-2.6.19/net/unix/af_unix.c
Index: linux-2.6-hooks/net/unix/af_unix.c
===================================================================
--- linux-2.6.19.orig/net/unix/af_unix.c
+++ linux-2.6.19/net/unix/af_unix.c
@@ -807,7 +807,7 @@ static int unix_bind(struct socket *sock
--- linux-2.6-hooks.orig/net/unix/af_unix.c
+++ linux-2.6-hooks/net/unix/af_unix.c
@@ -808,7 +808,7 @@ static int unix_bind(struct socket *sock
*/
mode = S_IFSOCK |
(SOCK_INODE(sock)->i_mode & ~current->fs->umask);

View File

@@ -13,25 +13,25 @@ The next patch passes the vfsmount to the inode_setattr LSM hook.
Signed-off-by: Tony Jones <tonyj@suse.de>
Signed-off-by: Andreas Gruenbacher <agruen@suse.de>
Index: linux-2.6.19/fs/attr.c
Index: linux-2.6-hooks/fs/attr.c
===================================================================
--- linux-2.6.19.orig/fs/attr.c
+++ linux-2.6.19/fs/attr.c
--- linux-2.6-hooks.orig/fs/attr.c
+++ linux-2.6-hooks/fs/attr.c
@@ -101,7 +101,8 @@ int inode_setattr(struct inode * inode,
}
EXPORT_SYMBOL(inode_setattr);
-int notify_change(struct dentry * dentry, struct iattr * attr)
+int notify_change(struct dentry * dentry, struct vfsmount *mnt,
+ struct iattr * attr)
+int notify_change(struct dentry *dentry, struct vfsmount *mnt,
+ struct iattr *attr)
{
struct inode *inode = dentry->d_inode;
mode_t mode;
Index: linux-2.6.19/include/linux/fs.h
Index: linux-2.6-hooks/include/linux/fs.h
===================================================================
--- linux-2.6.19.orig/include/linux/fs.h
+++ linux-2.6.19/include/linux/fs.h
@@ -1491,8 +1491,8 @@ static inline int break_lease(struct ino
--- linux-2.6-hooks.orig/include/linux/fs.h
+++ linux-2.6-hooks/include/linux/fs.h
@@ -1457,8 +1457,8 @@ static inline int break_lease(struct ino
/* fs/open.c */
@@ -42,7 +42,7 @@ Index: linux-2.6.19/include/linux/fs.h
extern long do_sys_open(int fdf, const char __user *filename, int flags,
int mode);
extern struct file *filp_open(const char *, int, int);
@@ -1639,7 +1639,7 @@ extern int do_remount_sb(struct super_bl
@@ -1605,7 +1605,7 @@ extern int do_remount_sb(struct super_bl
#ifdef CONFIG_BLOCK
extern sector_t bmap(struct inode *, sector_t);
#endif
@@ -51,11 +51,11 @@ Index: linux-2.6.19/include/linux/fs.h
extern int permission(struct inode *, int, struct nameidata *);
extern int generic_permission(struct inode *, int,
int (*check_acl)(struct inode *, int));
Index: linux-2.6.19/fs/ecryptfs/inode.c
Index: linux-2.6-hooks/fs/ecryptfs/inode.c
===================================================================
--- linux-2.6.19.orig/fs/ecryptfs/inode.c
+++ linux-2.6.19/fs/ecryptfs/inode.c
@@ -893,12 +893,14 @@ static int ecryptfs_setattr(struct dentr
--- linux-2.6-hooks.orig/fs/ecryptfs/inode.c
+++ linux-2.6-hooks/fs/ecryptfs/inode.c
@@ -856,12 +856,14 @@ static int ecryptfs_setattr(struct dentr
{
int rc = 0;
struct dentry *lower_dentry;
@@ -70,32 +70,32 @@ Index: linux-2.6.19/fs/ecryptfs/inode.c
inode = dentry->d_inode;
lower_inode = ecryptfs_inode_to_lower(inode);
if (ia->ia_valid & ATTR_SIZE) {
@@ -913,7 +915,7 @@ static int ecryptfs_setattr(struct dentr
@@ -876,7 +878,7 @@ static int ecryptfs_setattr(struct dentr
if (rc < 0)
goto out;
}
- rc = notify_change(lower_dentry, ia);
+ rc = notify_change(lower_dentry, lower_mnt, ia);
out:
ecryptfs_copy_attr_all(inode, lower_inode);
fsstack_copy_attr_all(inode, lower_inode, NULL);
return rc;
Index: linux-2.6.19/fs/fat/file.c
Index: linux-2.6-hooks/fs/fat/file.c
===================================================================
--- linux-2.6.19.orig/fs/fat/file.c
+++ linux-2.6.19/fs/fat/file.c
--- linux-2.6-hooks.orig/fs/fat/file.c
+++ linux-2.6-hooks/fs/fat/file.c
@@ -92,7 +92,7 @@ int fat_generic_ioctl(struct inode *inod
}
/* This MUST be done before doing anything irreversible... */
- err = notify_change(filp->f_dentry, &ia);
+ err = notify_change(filp->f_dentry, filp->f_vfsmnt, &ia);
- err = notify_change(filp->f_path.dentry, &ia);
+ err = notify_change(filp->f_path.dentry, filp->f_path.mnt, &ia);
if (err)
goto up;
Index: linux-2.6.19/fs/hpfs/namei.c
Index: linux-2.6-hooks/fs/hpfs/namei.c
===================================================================
--- linux-2.6.19.orig/fs/hpfs/namei.c
+++ linux-2.6.19/fs/hpfs/namei.c
--- linux-2.6-hooks.orig/fs/hpfs/namei.c
+++ linux-2.6-hooks/fs/hpfs/namei.c
@@ -426,7 +426,7 @@ again:
/*printk("HPFS: truncating file before delete.\n");*/
newattrs.ia_size = 0;
@@ -105,10 +105,10 @@ Index: linux-2.6.19/fs/hpfs/namei.c
put_write_access(inode);
if (!err)
goto again;
Index: linux-2.6.19/fs/nfsd/vfs.c
Index: linux-2.6-hooks/fs/nfsd/vfs.c
===================================================================
--- linux-2.6.19.orig/fs/nfsd/vfs.c
+++ linux-2.6.19/fs/nfsd/vfs.c
--- linux-2.6-hooks.orig/fs/nfsd/vfs.c
+++ linux-2.6-hooks/fs/nfsd/vfs.c
@@ -359,7 +359,7 @@ nfsd_setattr(struct svc_rqst *rqstp, str
err = nfserr_notsync;
if (!check_guard || guardtime == inode->i_ctime.tv_sec) {
@@ -118,7 +118,7 @@ Index: linux-2.6.19/fs/nfsd/vfs.c
err = nfserrno(host_err);
fh_unlock(fhp);
}
@@ -896,7 +896,7 @@ static void kill_suid(struct dentry *den
@@ -897,7 +897,7 @@ static void kill_suid(struct dentry *den
ia.ia_valid = ATTR_KILL_SUID | ATTR_KILL_SGID;
mutex_lock(&dentry->d_inode->i_mutex);
@@ -127,10 +127,10 @@ Index: linux-2.6.19/fs/nfsd/vfs.c
mutex_unlock(&dentry->d_inode->i_mutex);
}
Index: linux-2.6.19/fs/open.c
Index: linux-2.6-hooks/fs/open.c
===================================================================
--- linux-2.6.19.orig/fs/open.c
+++ linux-2.6.19/fs/open.c
--- linux-2.6-hooks.orig/fs/open.c
+++ linux-2.6-hooks/fs/open.c
@@ -194,8 +194,8 @@ out:
return error;
}
@@ -165,7 +165,7 @@ Index: linux-2.6.19/fs/open.c
error = locks_verify_truncate(inode, file, length);
if (!error)
- error = do_truncate(dentry, length, ATTR_MTIME|ATTR_CTIME, file);
+ error = do_truncate(dentry, file->f_vfsmnt, length,
+ error = do_truncate(dentry, file->f_path.mnt, length,
+ ATTR_MTIME|ATTR_CTIME, file);
out_putf:
fput(file);
@@ -175,7 +175,7 @@ Index: linux-2.6.19/fs/open.c
newattrs.ia_mode = (mode & S_IALLUGO) | (inode->i_mode & ~S_IALLUGO);
newattrs.ia_valid = ATTR_MODE | ATTR_CTIME;
- err = notify_change(dentry, &newattrs);
+ err = notify_change(dentry, file->f_vfsmnt, &newattrs);
+ err = notify_change(dentry, file->f_path.mnt, &newattrs);
mutex_unlock(&inode->i_mutex);
out_putf:
@@ -236,23 +236,23 @@ Index: linux-2.6.19/fs/open.c
return error;
@@ -664,7 +666,7 @@ asmlinkage long sys_fchown(unsigned int
dentry = file->f_dentry;
dentry = file->f_path.dentry;
audit_inode(NULL, dentry->d_inode);
- error = chown_common(dentry, user, group);
+ error = chown_common(dentry, file->f_vfsmnt, user, group);
+ error = chown_common(dentry, file->f_path.mnt, user, group);
fput(file);
out:
return error;
Index: linux-2.6.19/fs/reiserfs/xattr.c
Index: linux-2.6-hooks/fs/reiserfs/xattr.c
===================================================================
--- linux-2.6.19.orig/fs/reiserfs/xattr.c
+++ linux-2.6.19/fs/reiserfs/xattr.c
--- linux-2.6-hooks.orig/fs/reiserfs/xattr.c
+++ linux-2.6-hooks/fs/reiserfs/xattr.c
@@ -527,7 +527,7 @@ reiserfs_xattr_set(struct inode *inode,
newattrs.ia_size = buffer_size;
newattrs.ia_valid = ATTR_SIZE | ATTR_CTIME;
mutex_lock(&xinode->i_mutex);
- err = notify_change(fp->f_dentry, &newattrs);
+ err = notify_change(fp->f_dentry, NULL, &newattrs);
- err = notify_change(fp->f_path.dentry, &newattrs);
+ err = notify_change(fp->f_path.dentry, NULL, &newattrs);
if (err)
goto out_filp;
@@ -274,11 +274,11 @@ Index: linux-2.6.19/fs/reiserfs/xattr.c
unlock_kernel();
out_dir:
Index: linux-2.6.19/fs/sysfs/file.c
Index: linux-2.6-hooks/fs/sysfs/file.c
===================================================================
--- linux-2.6.19.orig/fs/sysfs/file.c
+++ linux-2.6.19/fs/sysfs/file.c
@@ -523,7 +523,7 @@ int sysfs_chmod_file(struct kobject *kob
--- linux-2.6-hooks.orig/fs/sysfs/file.c
+++ linux-2.6-hooks/fs/sysfs/file.c
@@ -526,7 +526,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;
@@ -287,11 +287,11 @@ Index: linux-2.6.19/fs/sysfs/file.c
mutex_unlock(&inode->i_mutex);
}
dput(victim);
Index: linux-2.6.19/fs/utimes.c
Index: linux-2.6-hooks/fs/utimes.c
===================================================================
--- linux-2.6.19.orig/fs/utimes.c
+++ linux-2.6.19/fs/utimes.c
@@ -61,7 +61,7 @@ asmlinkage long sys_utime(char __user *
--- linux-2.6-hooks.orig/fs/utimes.c
+++ linux-2.6-hooks/fs/utimes.c
@@ -62,7 +62,7 @@ asmlinkage long sys_utime(char __user *
goto dput_and_out;
}
mutex_lock(&inode->i_mutex);
@@ -300,7 +300,7 @@ Index: linux-2.6.19/fs/utimes.c
mutex_unlock(&inode->i_mutex);
dput_and_out:
path_release(&nd);
@@ -114,7 +114,7 @@ long do_utimes(int dfd, char __user *fil
@@ -115,7 +115,7 @@ long do_utimes(int dfd, char __user *fil
goto dput_and_out;
}
mutex_lock(&inode->i_mutex);
@@ -309,38 +309,38 @@ Index: linux-2.6.19/fs/utimes.c
mutex_unlock(&inode->i_mutex);
dput_and_out:
path_release(&nd);
Index: linux-2.6.19/mm/filemap.c
Index: linux-2.6-hooks/mm/filemap.c
===================================================================
--- linux-2.6.19.orig/mm/filemap.c
+++ linux-2.6.19/mm/filemap.c
@@ -1899,7 +1899,7 @@ int __remove_suid(struct file *file, int
--- linux-2.6-hooks.orig/mm/filemap.c
+++ linux-2.6-hooks/mm/filemap.c
@@ -1897,7 +1897,7 @@ int __remove_suid(struct path *path, int
struct iattr newattrs;
newattrs.ia_valid = ATTR_FORCE | kill;
- return notify_change(file->f_dentry, &newattrs);
+ return notify_change(file->f_dentry, file->f_vfsmnt, &newattrs);
- return notify_change(path->dentry, &newattrs);
+ return notify_change(path->dentry, path->mnt, &newattrs);
}
int remove_suid(struct file *file)
Index: linux-2.6.19/fs/exec.c
int remove_suid(struct path *path)
Index: linux-2.6-hooks/fs/exec.c
===================================================================
--- linux-2.6.19.orig/fs/exec.c
+++ linux-2.6.19/fs/exec.c
@@ -1532,7 +1532,8 @@ int do_coredump(long signr, int exit_cod
--- linux-2.6-hooks.orig/fs/exec.c
+++ linux-2.6-hooks/fs/exec.c
@@ -1534,7 +1534,8 @@ int do_coredump(long signr, int exit_cod
goto close_fail;
if (!file->f_op->write)
goto close_fail;
- if (!ispipe && do_truncate(file->f_dentry, 0, 0, file) != 0)
- if (!ispipe && do_truncate(file->f_path.dentry, 0, 0, file) != 0)
+ if (!ispipe &&
+ do_truncate(file->f_dentry, file->f_vfsmnt, 0, 0, file) != 0)
+ do_truncate(file->f_path.dentry, file->f_path.mnt, 0, 0, file) != 0)
goto close_fail;
retval = binfmt->core_dump(signr, regs, file);
Index: linux-2.6.19/fs/namei.c
Index: linux-2.6-hooks/fs/namei.c
===================================================================
--- linux-2.6.19.orig/fs/namei.c
+++ linux-2.6.19/fs/namei.c
@@ -1583,7 +1583,8 @@ int may_open(struct nameidata *nd, int a
--- linux-2.6-hooks.orig/fs/namei.c
+++ linux-2.6-hooks/fs/namei.c
@@ -1580,7 +1580,8 @@ int may_open(struct nameidata *nd, int a
if (!error) {
DQUOT_INIT(inode);
@@ -350,16 +350,16 @@ Index: linux-2.6.19/fs/namei.c
}
put_write_access(inode);
if (error)
Index: linux-2.6.19/mm/tiny-shmem.c
Index: linux-2.6-hooks/mm/tiny-shmem.c
===================================================================
--- linux-2.6.19.orig/mm/tiny-shmem.c
+++ linux-2.6.19/mm/tiny-shmem.c
--- linux-2.6-hooks.orig/mm/tiny-shmem.c
+++ linux-2.6-hooks/mm/tiny-shmem.c
@@ -86,7 +86,7 @@ struct file *shmem_file_setup(char *name
file->f_mode = FMODE_WRITE | FMODE_READ;
/* notify everyone as to the change of file size */
- error = do_truncate(dentry, size, 0, file);
+ error = do_truncate(dentry, file->f_vfsmnt, size, 0, file);
+ error = do_truncate(dentry, file->f_path.mnt, size, 0, file);
if (error < 0)
goto close_file;

View File

@@ -3,11 +3,11 @@ Add a struct vfsmount parameter to vfs_removexattr()
Signed-off-by: Tony Jones <tonyj@suse.de>
Signed-off-by: Andreas Gruenbacher <agruen@suse.de>
Index: linux-2.6.19/fs/nfsd/vfs.c
Index: linux-2.6-hooks/fs/nfsd/vfs.c
===================================================================
--- linux-2.6.19.orig/fs/nfsd/vfs.c
+++ linux-2.6.19/fs/nfsd/vfs.c
@@ -1986,7 +1986,7 @@ nfsd_set_posix_acl(struct svc_fh *fhp, i
--- linux-2.6-hooks.orig/fs/nfsd/vfs.c
+++ linux-2.6-hooks/fs/nfsd/vfs.c
@@ -1975,7 +1975,7 @@ nfsd_set_posix_acl(struct svc_fh *fhp, i
if (!S_ISDIR(inode->i_mode) && type == ACL_TYPE_DEFAULT)
error = 0;
else {
@@ -16,10 +16,10 @@ Index: linux-2.6.19/fs/nfsd/vfs.c
if (error == -ENODATA)
error = 0;
}
Index: linux-2.6.19/fs/xattr.c
Index: linux-2.6-hooks/fs/xattr.c
===================================================================
--- linux-2.6.19.orig/fs/xattr.c
+++ linux-2.6.19/fs/xattr.c
--- linux-2.6-hooks.orig/fs/xattr.c
+++ linux-2.6-hooks/fs/xattr.c
@@ -166,7 +166,7 @@ vfs_listxattr(struct dentry *dentry, str
EXPORT_SYMBOL_GPL(vfs_listxattr);
@@ -67,17 +67,17 @@ Index: linux-2.6.19/fs/xattr.c
}
@@ -491,7 +491,7 @@ sys_fremovexattr(int fd, char __user *na
return error;
dentry = f->f_dentry;
dentry = f->f_path.dentry;
audit_inode(NULL, dentry->d_inode);
- error = removexattr(dentry, name);
+ error = removexattr(dentry, f->f_vfsmnt, name);
+ error = removexattr(dentry, f->f_path.mnt, name);
fput(f);
return error;
}
Index: linux-2.6.19/include/linux/xattr.h
Index: linux-2.6-hooks/include/linux/xattr.h
===================================================================
--- linux-2.6.19.orig/include/linux/xattr.h
+++ linux-2.6.19/include/linux/xattr.h
--- linux-2.6-hooks.orig/include/linux/xattr.h
+++ linux-2.6-hooks/include/linux/xattr.h
@@ -46,7 +46,7 @@ ssize_t vfs_listxattr(struct dentry *d,
size_t size);
int vfs_setxattr(struct dentry *, struct vfsmount *, char *, void *, size_t,

View File

@@ -3,11 +3,11 @@ Add struct vfsmount parameters to vfs_rename()
Signed-off-by: Tony Jones <tonyj@suse.de>
Signed-off-by: Andreas Gruenbacher <agruen@suse.de>
Index: linux-2.6.19/fs/ecryptfs/inode.c
Index: linux-2.6-hooks/fs/ecryptfs/inode.c
===================================================================
--- linux-2.6.19.orig/fs/ecryptfs/inode.c
+++ linux-2.6.19/fs/ecryptfs/inode.c
@@ -627,19 +627,24 @@ ecryptfs_rename(struct inode *old_dir, s
--- linux-2.6-hooks.orig/fs/ecryptfs/inode.c
+++ linux-2.6-hooks/fs/ecryptfs/inode.c
@@ -590,19 +590,24 @@ ecryptfs_rename(struct inode *old_dir, s
{
int rc;
struct dentry *lower_old_dentry;
@@ -32,12 +32,12 @@ Index: linux-2.6.19/fs/ecryptfs/inode.c
+ lower_new_dentry, lower_new_mnt);
if (rc)
goto out_lock;
ecryptfs_copy_attr_all(new_dir, lower_new_dir_dentry->d_inode);
Index: linux-2.6.19/fs/namei.c
fsstack_copy_attr_all(new_dir, lower_new_dir_dentry->d_inode, NULL);
Index: linux-2.6-hooks/fs/namei.c
===================================================================
--- linux-2.6.19.orig/fs/namei.c
+++ linux-2.6.19/fs/namei.c
@@ -2386,7 +2386,8 @@ asmlinkage long sys_link(const char __us
--- linux-2.6-hooks.orig/fs/namei.c
+++ linux-2.6-hooks/fs/namei.c
@@ -2382,7 +2382,8 @@ asmlinkage long sys_link(const char __us
* locking].
*/
static int vfs_rename_dir(struct inode *old_dir, struct dentry *old_dentry,
@@ -47,7 +47,7 @@ Index: linux-2.6.19/fs/namei.c
{
int error = 0;
struct inode *target;
@@ -2429,7 +2430,8 @@ static int vfs_rename_dir(struct inode *
@@ -2425,7 +2426,8 @@ static int vfs_rename_dir(struct inode *
}
static int vfs_rename_other(struct inode *old_dir, struct dentry *old_dentry,
@@ -57,7 +57,7 @@ Index: linux-2.6.19/fs/namei.c
{
struct inode *target;
int error;
@@ -2457,7 +2459,8 @@ static int vfs_rename_other(struct inode
@@ -2453,7 +2455,8 @@ static int vfs_rename_other(struct inode
}
int vfs_rename(struct inode *old_dir, struct dentry *old_dentry,
@@ -67,7 +67,7 @@ Index: linux-2.6.19/fs/namei.c
{
int error;
int is_dir = S_ISDIR(old_dentry->d_inode->i_mode);
@@ -2486,9 +2489,11 @@ int vfs_rename(struct inode *old_dir, st
@@ -2482,9 +2485,11 @@ int vfs_rename(struct inode *old_dir, st
old_name = fsnotify_oldname_init(old_dentry->d_name.name);
if (is_dir)
@@ -81,7 +81,7 @@ Index: linux-2.6.19/fs/namei.c
if (!error) {
const char *new_name = old_dentry->d_name.name;
fsnotify_move(old_dir, new_dir, old_name, new_name, is_dir,
@@ -2560,8 +2565,8 @@ static int do_rename(int olddfd, const c
@@ -2556,8 +2561,8 @@ static int do_rename(int olddfd, const c
if (new_dentry == trap)
goto exit5;
@@ -92,11 +92,11 @@ Index: linux-2.6.19/fs/namei.c
exit5:
dput(new_dentry);
exit4:
Index: linux-2.6.19/fs/nfsd/vfs.c
Index: linux-2.6-hooks/fs/nfsd/vfs.c
===================================================================
--- linux-2.6.19.orig/fs/nfsd/vfs.c
+++ linux-2.6.19/fs/nfsd/vfs.c
@@ -1631,7 +1631,7 @@ nfsd_rename(struct svc_rqst *rqstp, stru
--- linux-2.6-hooks.orig/fs/nfsd/vfs.c
+++ linux-2.6-hooks/fs/nfsd/vfs.c
@@ -1621,7 +1621,7 @@ nfsd_rename(struct svc_rqst *rqstp, stru
host_err = -EPERM;
} else
#endif
@@ -105,11 +105,11 @@ Index: linux-2.6.19/fs/nfsd/vfs.c
if (!host_err && EX_ISSYNC(tfhp->fh_export)) {
host_err = nfsd_sync_dir(tdentry);
if (!host_err)
Index: linux-2.6.19/include/linux/fs.h
Index: linux-2.6-hooks/include/linux/fs.h
===================================================================
--- linux-2.6.19.orig/include/linux/fs.h
+++ linux-2.6.19/include/linux/fs.h
@@ -1019,7 +1019,7 @@ extern int vfs_symlink(struct inode *, s
--- linux-2.6-hooks.orig/include/linux/fs.h
+++ linux-2.6-hooks/include/linux/fs.h
@@ -985,7 +985,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

@@ -3,11 +3,11 @@ Add a struct vfsmount parameter to vfs_rmdir()
Signed-off-by: Tony Jones <tonyj@suse.de>
Signed-off-by: Andreas Gruenbacher <agruen@suse.de>
Index: linux-2.6.19/fs/ecryptfs/inode.c
Index: linux-2.6-hooks/fs/ecryptfs/inode.c
===================================================================
--- linux-2.6.19.orig/fs/ecryptfs/inode.c
+++ linux-2.6.19/fs/ecryptfs/inode.c
@@ -572,14 +572,16 @@ out:
--- linux-2.6-hooks.orig/fs/ecryptfs/inode.c
+++ linux-2.6-hooks/fs/ecryptfs/inode.c
@@ -534,14 +534,16 @@ out:
static int ecryptfs_rmdir(struct inode *dir, struct dentry *dentry)
{
struct dentry *lower_dentry;
@@ -25,11 +25,11 @@ Index: linux-2.6.19/fs/ecryptfs/inode.c
dput(lower_dentry);
if (!rc)
d_delete(lower_dentry);
Index: linux-2.6.19/fs/namei.c
Index: linux-2.6-hooks/fs/namei.c
===================================================================
--- linux-2.6.19.orig/fs/namei.c
+++ linux-2.6.19/fs/namei.c
@@ -2010,7 +2010,7 @@ void dentry_unhash(struct dentry *dentry
--- linux-2.6-hooks.orig/fs/namei.c
+++ linux-2.6-hooks/fs/namei.c
@@ -2006,7 +2006,7 @@ void dentry_unhash(struct dentry *dentry
spin_unlock(&dcache_lock);
}
@@ -38,7 +38,7 @@ Index: linux-2.6.19/fs/namei.c
{
int error = may_delete(dir, dentry, 1);
@@ -2074,7 +2074,7 @@ static long do_rmdir(int dfd, const char
@@ -2070,7 +2070,7 @@ static long do_rmdir(int dfd, const char
error = PTR_ERR(dentry);
if (IS_ERR(dentry))
goto exit2;
@@ -47,10 +47,10 @@ Index: linux-2.6.19/fs/namei.c
dput(dentry);
exit2:
mutex_unlock(&nd.dentry->d_inode->i_mutex);
Index: linux-2.6.19/fs/nfsd/nfs4recover.c
Index: linux-2.6-hooks/fs/nfsd/nfs4recover.c
===================================================================
--- linux-2.6.19.orig/fs/nfsd/nfs4recover.c
+++ linux-2.6.19/fs/nfsd/nfs4recover.c
--- linux-2.6-hooks.orig/fs/nfsd/nfs4recover.c
+++ linux-2.6-hooks/fs/nfsd/nfs4recover.c
@@ -275,7 +275,7 @@ nfsd4_clear_clid_dir(struct dentry *dir,
* a kernel from the future.... */
nfsd4_list_rec_dir(dentry, nfsd4_remove_clid_file);
@@ -60,11 +60,11 @@ Index: linux-2.6.19/fs/nfsd/nfs4recover.c
mutex_unlock(&dir->d_inode->i_mutex);
return status;
}
Index: linux-2.6.19/fs/nfsd/vfs.c
Index: linux-2.6-hooks/fs/nfsd/vfs.c
===================================================================
--- linux-2.6.19.orig/fs/nfsd/vfs.c
+++ linux-2.6.19/fs/nfsd/vfs.c
@@ -1705,7 +1705,7 @@ nfsd_unlink(struct svc_rqst *rqstp, stru
--- linux-2.6-hooks.orig/fs/nfsd/vfs.c
+++ linux-2.6-hooks/fs/nfsd/vfs.c
@@ -1695,7 +1695,7 @@ nfsd_unlink(struct svc_rqst *rqstp, stru
#endif
host_err = vfs_unlink(dirp, rdentry);
} else { /* It's RMDIR */
@@ -73,10 +73,10 @@ Index: linux-2.6.19/fs/nfsd/vfs.c
}
dput(rdentry);
Index: linux-2.6.19/fs/reiserfs/xattr.c
Index: linux-2.6-hooks/fs/reiserfs/xattr.c
===================================================================
--- linux-2.6.19.orig/fs/reiserfs/xattr.c
+++ linux-2.6.19/fs/reiserfs/xattr.c
--- linux-2.6-hooks.orig/fs/reiserfs/xattr.c
+++ linux-2.6-hooks/fs/reiserfs/xattr.c
@@ -823,7 +823,7 @@ int reiserfs_delete_xattrs(struct inode
if (dir->d_inode->i_nlink <= 2) {
root = get_xa_root(inode->i_sb);
@@ -86,11 +86,11 @@ Index: linux-2.6.19/fs/reiserfs/xattr.c
reiserfs_write_unlock_xattrs(inode->i_sb);
dput(root);
} else {
Index: linux-2.6.19/include/linux/fs.h
Index: linux-2.6-hooks/include/linux/fs.h
===================================================================
--- linux-2.6.19.orig/include/linux/fs.h
+++ linux-2.6.19/include/linux/fs.h
@@ -1017,7 +1017,7 @@ extern int vfs_mkdir(struct inode *, str
--- linux-2.6-hooks.orig/include/linux/fs.h
+++ linux-2.6-hooks/include/linux/fs.h
@@ -983,7 +983,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

@@ -3,10 +3,10 @@ Add a struct vfsmount parameter to vfs_setxattr()
Signed-off-by: Tony Jones <tonyj@suse.de>
Signed-off-by: Andreas Gruenbacher <agruen@suse.de>
Index: linux-2.6.19/fs/nfsd/vfs.c
Index: linux-2.6-hooks/fs/nfsd/vfs.c
===================================================================
--- linux-2.6.19.orig/fs/nfsd/vfs.c
+++ linux-2.6.19/fs/nfsd/vfs.c
--- linux-2.6-hooks.orig/fs/nfsd/vfs.c
+++ linux-2.6-hooks/fs/nfsd/vfs.c
@@ -416,7 +416,7 @@ set_nfsv4_acl_one(struct dentry *dentry,
goto out;
}
@@ -16,7 +16,7 @@ Index: linux-2.6.19/fs/nfsd/vfs.c
out:
kfree(buf);
return error;
@@ -1981,7 +1981,7 @@ nfsd_set_posix_acl(struct svc_fh *fhp, i
@@ -1970,7 +1970,7 @@ nfsd_set_posix_acl(struct svc_fh *fhp, i
size = 0;
if (size)
@@ -25,10 +25,10 @@ Index: linux-2.6.19/fs/nfsd/vfs.c
else {
if (!S_ISDIR(inode->i_mode) && type == ACL_TYPE_DEFAULT)
error = 0;
Index: linux-2.6.19/fs/xattr.c
Index: linux-2.6-hooks/fs/xattr.c
===================================================================
--- linux-2.6.19.orig/fs/xattr.c
+++ linux-2.6.19/fs/xattr.c
--- linux-2.6-hooks.orig/fs/xattr.c
+++ linux-2.6-hooks/fs/xattr.c
@@ -70,8 +70,8 @@ xattr_permission(struct inode *inode, co
}
@@ -80,17 +80,17 @@ Index: linux-2.6.19/fs/xattr.c
}
@@ -270,7 +270,7 @@ sys_fsetxattr(int fd, char __user *name,
return error;
dentry = f->f_dentry;
dentry = f->f_path.dentry;
audit_inode(NULL, dentry->d_inode);
- error = setxattr(dentry, name, value, size, flags);
+ error = setxattr(dentry, f->f_vfsmnt, name, value, size, flags);
fput(f);
return error;
}
Index: linux-2.6.19/include/linux/xattr.h
Index: linux-2.6-hooks/include/linux/xattr.h
===================================================================
--- linux-2.6.19.orig/include/linux/xattr.h
+++ linux-2.6.19/include/linux/xattr.h
--- linux-2.6-hooks.orig/include/linux/xattr.h
+++ linux-2.6-hooks/include/linux/xattr.h
@@ -42,7 +42,8 @@ struct xattr_handler {
ssize_t vfs_getxattr(struct dentry *, char *, void *, size_t);

View File

@@ -3,11 +3,11 @@ Add a struct vfsmount parameter to vfs_symlink()
Signed-off-by: Tony Jones <tonyj@suse.de>
Signed-off-by: Andreas Gruenbacher <agruen@suse.de>
Index: linux-2.6.19/fs/ecryptfs/inode.c
Index: linux-2.6-hooks/fs/ecryptfs/inode.c
===================================================================
--- linux-2.6.19.orig/fs/ecryptfs/inode.c
+++ linux-2.6.19/fs/ecryptfs/inode.c
@@ -502,6 +502,7 @@ static int ecryptfs_symlink(struct inode
--- linux-2.6-hooks.orig/fs/ecryptfs/inode.c
+++ linux-2.6-hooks/fs/ecryptfs/inode.c
@@ -462,6 +462,7 @@ static int ecryptfs_symlink(struct inode
{
int rc;
struct dentry *lower_dentry;
@@ -15,7 +15,7 @@ Index: linux-2.6.19/fs/ecryptfs/inode.c
struct dentry *lower_dir_dentry;
umode_t mode;
char *encoded_symname;
@@ -510,6 +511,7 @@ static int ecryptfs_symlink(struct inode
@@ -470,6 +471,7 @@ static int ecryptfs_symlink(struct inode
lower_dentry = ecryptfs_dentry_to_lower(dentry);
dget(lower_dentry);
@@ -23,7 +23,7 @@ Index: linux-2.6.19/fs/ecryptfs/inode.c
lower_dir_dentry = lock_parent(lower_dentry);
mode = S_IALLUGO;
encoded_symlen = ecryptfs_encode_filename(crypt_stat, symname,
@@ -519,7 +521,7 @@ static int ecryptfs_symlink(struct inode
@@ -479,7 +481,7 @@ static int ecryptfs_symlink(struct inode
rc = encoded_symlen;
goto out_lock;
}
@@ -32,11 +32,11 @@ Index: linux-2.6.19/fs/ecryptfs/inode.c
encoded_symname, mode);
kfree(encoded_symname);
if (rc || !lower_dentry->d_inode)
Index: linux-2.6.19/fs/namei.c
Index: linux-2.6-hooks/fs/namei.c
===================================================================
--- linux-2.6.19.orig/fs/namei.c
+++ linux-2.6.19/fs/namei.c
@@ -2189,7 +2189,8 @@ asmlinkage long sys_unlink(const char __
--- linux-2.6-hooks.orig/fs/namei.c
+++ linux-2.6-hooks/fs/namei.c
@@ -2185,7 +2185,8 @@ asmlinkage long sys_unlink(const char __
return do_unlinkat(AT_FDCWD, pathname);
}
@@ -46,7 +46,7 @@ Index: linux-2.6.19/fs/namei.c
{
int error = may_create(dir, dentry, NULL);
@@ -2235,7 +2236,8 @@ asmlinkage long sys_symlinkat(const char
@@ -2231,7 +2232,8 @@ asmlinkage long sys_symlinkat(const char
if (IS_ERR(dentry))
goto out_unlock;
@@ -56,11 +56,11 @@ Index: linux-2.6.19/fs/namei.c
dput(dentry);
out_unlock:
mutex_unlock(&nd.dentry->d_inode->i_mutex);
Index: linux-2.6.19/fs/nfsd/vfs.c
Index: linux-2.6-hooks/fs/nfsd/vfs.c
===================================================================
--- linux-2.6.19.orig/fs/nfsd/vfs.c
+++ linux-2.6.19/fs/nfsd/vfs.c
@@ -1474,11 +1474,12 @@ nfsd_symlink(struct svc_rqst *rqstp, str
--- linux-2.6-hooks.orig/fs/nfsd/vfs.c
+++ linux-2.6-hooks/fs/nfsd/vfs.c
@@ -1464,11 +1464,12 @@ nfsd_symlink(struct svc_rqst *rqstp, str
else {
strncpy(path_alloced, path, plen);
path_alloced[plen] = 0;
@@ -75,11 +75,11 @@ Index: linux-2.6.19/fs/nfsd/vfs.c
if (!host_err) {
if (EX_ISSYNC(fhp->fh_export))
Index: linux-2.6.19/include/linux/fs.h
Index: linux-2.6-hooks/include/linux/fs.h
===================================================================
--- linux-2.6.19.orig/include/linux/fs.h
+++ linux-2.6.19/include/linux/fs.h
@@ -1015,7 +1015,7 @@ extern int vfs_permission(struct nameida
--- linux-2.6-hooks.orig/include/linux/fs.h
+++ linux-2.6-hooks/include/linux/fs.h
@@ -981,7 +981,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

@@ -3,11 +3,11 @@ Add a struct vfsmount parameter to vfs_unlink()
Signed-off-by: Tony Jones <tonyj@suse.de>
Signed-off-by: Andreas Gruenbacher <agruen@suse.de>
Index: linux-2.6.19/fs/ecryptfs/inode.c
Index: linux-2.6-hooks/fs/ecryptfs/inode.c
===================================================================
--- linux-2.6.19.orig/fs/ecryptfs/inode.c
+++ linux-2.6.19/fs/ecryptfs/inode.c
@@ -485,10 +485,11 @@ static int ecryptfs_unlink(struct inode
--- linux-2.6-hooks.orig/fs/ecryptfs/inode.c
+++ linux-2.6-hooks/fs/ecryptfs/inode.c
@@ -445,10 +445,11 @@ static int ecryptfs_unlink(struct inode
{
int rc = 0;
struct dentry *lower_dentry = ecryptfs_dentry_to_lower(dentry);
@@ -20,11 +20,11 @@ Index: linux-2.6.19/fs/ecryptfs/inode.c
if (rc) {
printk(KERN_ERR "Error in vfs_unlink; rc = [%d]\n", rc);
goto out_unlock;
Index: linux-2.6.19/fs/namei.c
Index: linux-2.6-hooks/fs/namei.c
===================================================================
--- linux-2.6.19.orig/fs/namei.c
+++ linux-2.6.19/fs/namei.c
@@ -2090,7 +2090,7 @@ asmlinkage long sys_rmdir(const char __u
--- linux-2.6-hooks.orig/fs/namei.c
+++ linux-2.6-hooks/fs/namei.c
@@ -2086,7 +2086,7 @@ asmlinkage long sys_rmdir(const char __u
return do_rmdir(AT_FDCWD, pathname);
}
@@ -33,7 +33,7 @@ Index: linux-2.6.19/fs/namei.c
{
int error = may_delete(dir, dentry, 0);
@@ -2154,7 +2154,7 @@ static long do_unlinkat(int dfd, const c
@@ -2150,7 +2150,7 @@ static long do_unlinkat(int dfd, const c
inode = dentry->d_inode;
if (inode)
atomic_inc(&inode->i_count);
@@ -42,37 +42,37 @@ Index: linux-2.6.19/fs/namei.c
exit2:
dput(dentry);
}
Index: linux-2.6.19/fs/nfsd/nfs4recover.c
Index: linux-2.6-hooks/fs/nfsd/nfs4recover.c
===================================================================
--- linux-2.6.19.orig/fs/nfsd/nfs4recover.c
+++ linux-2.6.19/fs/nfsd/nfs4recover.c
--- linux-2.6-hooks.orig/fs/nfsd/nfs4recover.c
+++ linux-2.6-hooks/fs/nfsd/nfs4recover.c
@@ -260,7 +260,7 @@ nfsd4_remove_clid_file(struct dentry *di
return -EINVAL;
}
mutex_lock(&dir->d_inode->i_mutex);
mutex_lock_nested(&dir->d_inode->i_mutex, I_MUTEX_PARENT);
- status = vfs_unlink(dir->d_inode, dentry);
+ status = vfs_unlink(dir->d_inode, dentry, NULL);
mutex_unlock(&dir->d_inode->i_mutex);
return status;
}
Index: linux-2.6.19/fs/nfsd/vfs.c
Index: linux-2.6-hooks/fs/nfsd/vfs.c
===================================================================
--- linux-2.6.19.orig/fs/nfsd/vfs.c
+++ linux-2.6.19/fs/nfsd/vfs.c
@@ -1703,7 +1703,7 @@ nfsd_unlink(struct svc_rqst *rqstp, stru
--- linux-2.6-hooks.orig/fs/nfsd/vfs.c
+++ linux-2.6-hooks/fs/nfsd/vfs.c
@@ -1693,7 +1693,7 @@ nfsd_unlink(struct svc_rqst *rqstp, stru
host_err = -EPERM;
} else
#endif
- host_err = vfs_unlink(dirp, rdentry);
+ host_err = vfs_unlink(dirp, rdentry, NULL);
} else { /* It's RMDIR */
host_err = vfs_rmdir(dirp, NULL, rdentry);
host_err = vfs_rmdir(dirp, rdentry, NULL);
}
Index: linux-2.6.19/include/linux/fs.h
Index: linux-2.6-hooks/include/linux/fs.h
===================================================================
--- linux-2.6.19.orig/include/linux/fs.h
+++ linux-2.6.19/include/linux/fs.h
@@ -1018,7 +1018,7 @@ extern int vfs_mknod(struct inode *, str
--- linux-2.6-hooks.orig/include/linux/fs.h
+++ linux-2.6-hooks/include/linux/fs.h
@@ -984,7 +984,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 *);
@@ -81,10 +81,10 @@ Index: linux-2.6.19/include/linux/fs.h
extern int vfs_rename(struct inode *, struct dentry *, struct inode *, struct dentry *);
/*
Index: linux-2.6.19/ipc/mqueue.c
Index: linux-2.6-hooks/ipc/mqueue.c
===================================================================
--- linux-2.6.19.orig/ipc/mqueue.c
+++ linux-2.6.19/ipc/mqueue.c
--- linux-2.6-hooks.orig/ipc/mqueue.c
+++ linux-2.6-hooks/ipc/mqueue.c
@@ -747,7 +747,7 @@ asmlinkage long sys_mq_unlink(const char
if (inode)
atomic_inc(&inode->i_count);