diff options
| author | Linus Torvalds <torvalds@linux-foundation.org> | 2011-03-16 12:15:43 -0400 |
|---|---|---|
| committer | Linus Torvalds <torvalds@linux-foundation.org> | 2011-03-16 12:15:43 -0400 |
| commit | 0f6e0e8448a16d8d22119ce91d8dd24b44865b51 (patch) | |
| tree | 7c295c02db035fc6a0b867465911a2bc9dc6b1ef /fs/ext2 | |
| parent | 0d2ecee2bdb2a19d04bc5cefac0f86e790f1aad4 (diff) | |
| parent | a002951c97ff8da49938c982a4c236bf2fafdc9f (diff) | |
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jmorris/security-testing-2.6
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jmorris/security-testing-2.6: (33 commits)
AppArmor: kill unused macros in lsm.c
AppArmor: cleanup generated files correctly
KEYS: Add an iovec version of KEYCTL_INSTANTIATE
KEYS: Add a new keyctl op to reject a key with a specified error code
KEYS: Add a key type op to permit the key description to be vetted
KEYS: Add an RCU payload dereference macro
AppArmor: Cleanup make file to remove cruft and make it easier to read
SELinux: implement the new sb_remount LSM hook
LSM: Pass -o remount options to the LSM
SELinux: Compute SID for the newly created socket
SELinux: Socket retains creator role and MLS attribute
SELinux: Auto-generate security_is_socket_class
TOMOYO: Fix memory leak upon file open.
Revert "selinux: simplify ioctl checking"
selinux: drop unused packet flow permissions
selinux: Fix packet forwarding checks on postrouting
selinux: Fix wrong checks for selinux_policycap_netpeer
selinux: Fix check for xfrm selinux context algorithm
ima: remove unnecessary call to ima_must_measure
IMA: remove IMA imbalance checking
...
Diffstat (limited to 'fs/ext2')
| -rw-r--r-- | fs/ext2/ext2.h | 2 | ||||
| -rw-r--r-- | fs/ext2/ialloc.c | 5 | ||||
| -rw-r--r-- | fs/ext2/namei.c | 8 | ||||
| -rw-r--r-- | fs/ext2/xattr.h | 6 | ||||
| -rw-r--r-- | fs/ext2/xattr_security.c | 5 |
5 files changed, 15 insertions, 11 deletions
diff --git a/fs/ext2/ext2.h b/fs/ext2/ext2.h index 6346a2acf32..1b48c337087 100644 --- a/fs/ext2/ext2.h +++ b/fs/ext2/ext2.h | |||
| @@ -110,7 +110,7 @@ extern struct ext2_dir_entry_2 * ext2_dotdot (struct inode *, struct page **); | |||
| 110 | extern void ext2_set_link(struct inode *, struct ext2_dir_entry_2 *, struct page *, struct inode *, int); | 110 | extern void ext2_set_link(struct inode *, struct ext2_dir_entry_2 *, struct page *, struct inode *, int); |
| 111 | 111 | ||
| 112 | /* ialloc.c */ | 112 | /* ialloc.c */ |
| 113 | extern struct inode * ext2_new_inode (struct inode *, int); | 113 | extern struct inode * ext2_new_inode (struct inode *, int, const struct qstr *); |
| 114 | extern void ext2_free_inode (struct inode *); | 114 | extern void ext2_free_inode (struct inode *); |
| 115 | extern unsigned long ext2_count_free_inodes (struct super_block *); | 115 | extern unsigned long ext2_count_free_inodes (struct super_block *); |
| 116 | extern void ext2_check_inodes_bitmap (struct super_block *); | 116 | extern void ext2_check_inodes_bitmap (struct super_block *); |
diff --git a/fs/ext2/ialloc.c b/fs/ext2/ialloc.c index ad70479aabf..ee9ed31948e 100644 --- a/fs/ext2/ialloc.c +++ b/fs/ext2/ialloc.c | |||
| @@ -429,7 +429,8 @@ found: | |||
| 429 | return group; | 429 | return group; |
| 430 | } | 430 | } |
| 431 | 431 | ||
| 432 | struct inode *ext2_new_inode(struct inode *dir, int mode) | 432 | struct inode *ext2_new_inode(struct inode *dir, int mode, |
| 433 | const struct qstr *qstr) | ||
| 433 | { | 434 | { |
| 434 | struct super_block *sb; | 435 | struct super_block *sb; |
| 435 | struct buffer_head *bitmap_bh = NULL; | 436 | struct buffer_head *bitmap_bh = NULL; |
| @@ -585,7 +586,7 @@ got: | |||
| 585 | if (err) | 586 | if (err) |
| 586 | goto fail_free_drop; | 587 | goto fail_free_drop; |
| 587 | 588 | ||
| 588 | err = ext2_init_security(inode,dir); | 589 | err = ext2_init_security(inode, dir, qstr); |
| 589 | if (err) | 590 | if (err) |
| 590 | goto fail_free_drop; | 591 | goto fail_free_drop; |
| 591 | 592 | ||
diff --git a/fs/ext2/namei.c b/fs/ext2/namei.c index adb91855ccd..ed5c5d496ee 100644 --- a/fs/ext2/namei.c +++ b/fs/ext2/namei.c | |||
| @@ -104,7 +104,7 @@ static int ext2_create (struct inode * dir, struct dentry * dentry, int mode, st | |||
| 104 | 104 | ||
| 105 | dquot_initialize(dir); | 105 | dquot_initialize(dir); |
| 106 | 106 | ||
| 107 | inode = ext2_new_inode(dir, mode); | 107 | inode = ext2_new_inode(dir, mode, &dentry->d_name); |
| 108 | if (IS_ERR(inode)) | 108 | if (IS_ERR(inode)) |
| 109 | return PTR_ERR(inode); | 109 | return PTR_ERR(inode); |
| 110 | 110 | ||
| @@ -133,7 +133,7 @@ static int ext2_mknod (struct inode * dir, struct dentry *dentry, int mode, dev_ | |||
| 133 | 133 | ||
| 134 | dquot_initialize(dir); | 134 | dquot_initialize(dir); |
| 135 | 135 | ||
| 136 | inode = ext2_new_inode (dir, mode); | 136 | inode = ext2_new_inode (dir, mode, &dentry->d_name); |
| 137 | err = PTR_ERR(inode); | 137 | err = PTR_ERR(inode); |
| 138 | if (!IS_ERR(inode)) { | 138 | if (!IS_ERR(inode)) { |
| 139 | init_special_inode(inode, inode->i_mode, rdev); | 139 | init_special_inode(inode, inode->i_mode, rdev); |
| @@ -159,7 +159,7 @@ static int ext2_symlink (struct inode * dir, struct dentry * dentry, | |||
| 159 | 159 | ||
| 160 | dquot_initialize(dir); | 160 | dquot_initialize(dir); |
| 161 | 161 | ||
| 162 | inode = ext2_new_inode (dir, S_IFLNK | S_IRWXUGO); | 162 | inode = ext2_new_inode (dir, S_IFLNK | S_IRWXUGO, &dentry->d_name); |
| 163 | err = PTR_ERR(inode); | 163 | err = PTR_ERR(inode); |
| 164 | if (IS_ERR(inode)) | 164 | if (IS_ERR(inode)) |
| 165 | goto out; | 165 | goto out; |
| @@ -230,7 +230,7 @@ static int ext2_mkdir(struct inode * dir, struct dentry * dentry, int mode) | |||
| 230 | 230 | ||
| 231 | inode_inc_link_count(dir); | 231 | inode_inc_link_count(dir); |
| 232 | 232 | ||
| 233 | inode = ext2_new_inode (dir, S_IFDIR | mode); | 233 | inode = ext2_new_inode(dir, S_IFDIR | mode, &dentry->d_name); |
| 234 | err = PTR_ERR(inode); | 234 | err = PTR_ERR(inode); |
| 235 | if (IS_ERR(inode)) | 235 | if (IS_ERR(inode)) |
| 236 | goto out_dir; | 236 | goto out_dir; |
diff --git a/fs/ext2/xattr.h b/fs/ext2/xattr.h index a1a1c218461..5e41cccff76 100644 --- a/fs/ext2/xattr.h +++ b/fs/ext2/xattr.h | |||
| @@ -116,9 +116,11 @@ exit_ext2_xattr(void) | |||
| 116 | # endif /* CONFIG_EXT2_FS_XATTR */ | 116 | # endif /* CONFIG_EXT2_FS_XATTR */ |
| 117 | 117 | ||
| 118 | #ifdef CONFIG_EXT2_FS_SECURITY | 118 | #ifdef CONFIG_EXT2_FS_SECURITY |
| 119 | extern int ext2_init_security(struct inode *inode, struct inode *dir); | 119 | extern int ext2_init_security(struct inode *inode, struct inode *dir, |
| 120 | const struct qstr *qstr); | ||
| 120 | #else | 121 | #else |
| 121 | static inline int ext2_init_security(struct inode *inode, struct inode *dir) | 122 | static inline int ext2_init_security(struct inode *inode, struct inode *dir, |
| 123 | const struct qstr *qstr) | ||
| 122 | { | 124 | { |
| 123 | return 0; | 125 | return 0; |
| 124 | } | 126 | } |
diff --git a/fs/ext2/xattr_security.c b/fs/ext2/xattr_security.c index 3004e15d5da..5d979b4347b 100644 --- a/fs/ext2/xattr_security.c +++ b/fs/ext2/xattr_security.c | |||
| @@ -47,14 +47,15 @@ ext2_xattr_security_set(struct dentry *dentry, const char *name, | |||
| 47 | } | 47 | } |
| 48 | 48 | ||
| 49 | int | 49 | int |
| 50 | ext2_init_security(struct inode *inode, struct inode *dir) | 50 | ext2_init_security(struct inode *inode, struct inode *dir, |
| 51 | const struct qstr *qstr) | ||
| 51 | { | 52 | { |
| 52 | int err; | 53 | int err; |
| 53 | size_t len; | 54 | size_t len; |
| 54 | void *value; | 55 | void *value; |
| 55 | char *name; | 56 | char *name; |
| 56 | 57 | ||
| 57 | err = security_inode_init_security(inode, dir, &name, &value, &len); | 58 | err = security_inode_init_security(inode, dir, qstr, &name, &value, &len); |
| 58 | if (err) { | 59 | if (err) { |
| 59 | if (err == -EOPNOTSUPP) | 60 | if (err == -EOPNOTSUPP) |
| 60 | return 0; | 61 | return 0; |
