Skip to content

Commit fe3fa43

Browse files
committed
Merge branch 'master' of git://git.infradead.org/users/eparis/selinux into next
2 parents ee009e4 + 026eb16 commit fe3fa43

52 files changed

Lines changed: 594 additions & 323 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎fs/btrfs/inode.c‎

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -90,13 +90,14 @@ static noinline int cow_file_range(struct inode *inode,
9090
unsigned long *nr_written, int unlock);
9191

9292
static int btrfs_init_inode_security(struct btrfs_trans_handle *trans,
93-
struct inode *inode, struct inode *dir)
93+
struct inode *inode, struct inode *dir,
94+
const struct qstr *qstr)
9495
{
9596
int err;
9697

9798
err = btrfs_init_acl(trans, inode, dir);
9899
if (!err)
99-
err = btrfs_xattr_security_init(trans, inode, dir);
100+
err = btrfs_xattr_security_init(trans, inode, dir, qstr);
100101
return err;
101102
}
102103

@@ -4704,7 +4705,7 @@ static int btrfs_mknod(struct inode *dir, struct dentry *dentry,
47044705
if (IS_ERR(inode))
47054706
goto out_unlock;
47064707

4707-
err = btrfs_init_inode_security(trans, inode, dir);
4708+
err = btrfs_init_inode_security(trans, inode, dir, &dentry->d_name);
47084709
if (err) {
47094710
drop_inode = 1;
47104711
goto out_unlock;
@@ -4765,7 +4766,7 @@ static int btrfs_create(struct inode *dir, struct dentry *dentry,
47654766
if (IS_ERR(inode))
47664767
goto out_unlock;
47674768

4768-
err = btrfs_init_inode_security(trans, inode, dir);
4769+
err = btrfs_init_inode_security(trans, inode, dir, &dentry->d_name);
47694770
if (err) {
47704771
drop_inode = 1;
47714772
goto out_unlock;
@@ -4893,7 +4894,7 @@ static int btrfs_mkdir(struct inode *dir, struct dentry *dentry, int mode)
48934894

48944895
drop_on_err = 1;
48954896

4896-
err = btrfs_init_inode_security(trans, inode, dir);
4897+
err = btrfs_init_inode_security(trans, inode, dir, &dentry->d_name);
48974898
if (err)
48984899
goto out_fail;
48994900

@@ -7104,7 +7105,7 @@ static int btrfs_symlink(struct inode *dir, struct dentry *dentry,
71047105
if (IS_ERR(inode))
71057106
goto out_unlock;
71067107

7107-
err = btrfs_init_inode_security(trans, inode, dir);
7108+
err = btrfs_init_inode_security(trans, inode, dir, &dentry->d_name);
71087109
if (err) {
71097110
drop_inode = 1;
71107111
goto out_unlock;

‎fs/btrfs/xattr.c‎

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -370,15 +370,17 @@ int btrfs_removexattr(struct dentry *dentry, const char *name)
370370
}
371371

372372
int btrfs_xattr_security_init(struct btrfs_trans_handle *trans,
373-
struct inode *inode, struct inode *dir)
373+
struct inode *inode, struct inode *dir,
374+
const struct qstr *qstr)
374375
{
375376
int err;
376377
size_t len;
377378
void *value;
378379
char *suffix;
379380
char *name;
380381

381-
err = security_inode_init_security(inode, dir, &suffix, &value, &len);
382+
err = security_inode_init_security(inode, dir, qstr, &suffix, &value,
383+
&len);
382384
if (err) {
383385
if (err == -EOPNOTSUPP)
384386
return 0;

‎fs/btrfs/xattr.h‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ extern int btrfs_setxattr(struct dentry *dentry, const char *name,
3737
extern int btrfs_removexattr(struct dentry *dentry, const char *name);
3838

3939
extern int btrfs_xattr_security_init(struct btrfs_trans_handle *trans,
40-
struct inode *inode, struct inode *dir);
40+
struct inode *inode, struct inode *dir,
41+
const struct qstr *qstr);
4142

4243
#endif /* __XATTR__ */

‎fs/ext2/ext2.h‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ extern struct ext2_dir_entry_2 * ext2_dotdot (struct inode *, struct page **);
110110
extern void ext2_set_link(struct inode *, struct ext2_dir_entry_2 *, struct page *, struct inode *, int);
111111

112112
/* 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 *);
114114
extern void ext2_free_inode (struct inode *);
115115
extern unsigned long ext2_count_free_inodes (struct super_block *);
116116
extern void ext2_check_inodes_bitmap (struct super_block *);

‎fs/ext2/ialloc.c‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -429,7 +429,8 @@ static int find_group_other(struct super_block *sb, struct inode *parent)
429429
return group;
430430
}
431431

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)
433434
{
434435
struct super_block *sb;
435436
struct buffer_head *bitmap_bh = NULL;
@@ -585,7 +586,7 @@ struct inode *ext2_new_inode(struct inode *dir, int mode)
585586
if (err)
586587
goto fail_free_drop;
587588

588-
err = ext2_init_security(inode,dir);
589+
err = ext2_init_security(inode, dir, qstr);
589590
if (err)
590591
goto fail_free_drop;
591592

‎fs/ext2/namei.c‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ static int ext2_create (struct inode * dir, struct dentry * dentry, int mode, st
104104

105105
dquot_initialize(dir);
106106

107-
inode = ext2_new_inode(dir, mode);
107+
inode = ext2_new_inode(dir, mode, &dentry->d_name);
108108
if (IS_ERR(inode))
109109
return PTR_ERR(inode);
110110

@@ -133,7 +133,7 @@ static int ext2_mknod (struct inode * dir, struct dentry *dentry, int mode, dev_
133133

134134
dquot_initialize(dir);
135135

136-
inode = ext2_new_inode (dir, mode);
136+
inode = ext2_new_inode (dir, mode, &dentry->d_name);
137137
err = PTR_ERR(inode);
138138
if (!IS_ERR(inode)) {
139139
init_special_inode(inode, inode->i_mode, rdev);
@@ -159,7 +159,7 @@ static int ext2_symlink (struct inode * dir, struct dentry * dentry,
159159

160160
dquot_initialize(dir);
161161

162-
inode = ext2_new_inode (dir, S_IFLNK | S_IRWXUGO);
162+
inode = ext2_new_inode (dir, S_IFLNK | S_IRWXUGO, &dentry->d_name);
163163
err = PTR_ERR(inode);
164164
if (IS_ERR(inode))
165165
goto out;
@@ -230,7 +230,7 @@ static int ext2_mkdir(struct inode * dir, struct dentry * dentry, int mode)
230230

231231
inode_inc_link_count(dir);
232232

233-
inode = ext2_new_inode (dir, S_IFDIR | mode);
233+
inode = ext2_new_inode(dir, S_IFDIR | mode, &dentry->d_name);
234234
err = PTR_ERR(inode);
235235
if (IS_ERR(inode))
236236
goto out_dir;

‎fs/ext2/xattr.h‎

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -116,9 +116,11 @@ exit_ext2_xattr(void)
116116
# endif /* CONFIG_EXT2_FS_XATTR */
117117

118118
#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);
120121
#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)
122124
{
123125
return 0;
124126
}

‎fs/ext2/xattr_security.c‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,14 +47,15 @@ ext2_xattr_security_set(struct dentry *dentry, const char *name,
4747
}
4848

4949
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)
5152
{
5253
int err;
5354
size_t len;
5455
void *value;
5556
char *name;
5657

57-
err = security_inode_init_security(inode, dir, &name, &value, &len);
58+
err = security_inode_init_security(inode, dir, qstr, &name, &value, &len);
5859
if (err) {
5960
if (err == -EOPNOTSUPP)
6061
return 0;

‎fs/ext3/ialloc.c‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -404,7 +404,8 @@ static int find_group_other(struct super_block *sb, struct inode *parent)
404404
* For other inodes, search forward from the parent directory's block
405405
* group to find a free inode.
406406
*/
407-
struct inode *ext3_new_inode(handle_t *handle, struct inode * dir, int mode)
407+
struct inode *ext3_new_inode(handle_t *handle, struct inode * dir,
408+
const struct qstr *qstr, int mode)
408409
{
409410
struct super_block *sb;
410411
struct buffer_head *bitmap_bh = NULL;
@@ -589,7 +590,7 @@ struct inode *ext3_new_inode(handle_t *handle, struct inode * dir, int mode)
589590
if (err)
590591
goto fail_free_drop;
591592

592-
err = ext3_init_security(handle,inode, dir);
593+
err = ext3_init_security(handle, inode, dir, qstr);
593594
if (err)
594595
goto fail_free_drop;
595596

‎fs/ext3/namei.c‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1710,7 +1710,7 @@ static int ext3_create (struct inode * dir, struct dentry * dentry, int mode,
17101710
if (IS_DIRSYNC(dir))
17111711
handle->h_sync = 1;
17121712

1713-
inode = ext3_new_inode (handle, dir, mode);
1713+
inode = ext3_new_inode (handle, dir, &dentry->d_name, mode);
17141714
err = PTR_ERR(inode);
17151715
if (!IS_ERR(inode)) {
17161716
inode->i_op = &ext3_file_inode_operations;
@@ -1746,7 +1746,7 @@ static int ext3_mknod (struct inode * dir, struct dentry *dentry,
17461746
if (IS_DIRSYNC(dir))
17471747
handle->h_sync = 1;
17481748

1749-
inode = ext3_new_inode (handle, dir, mode);
1749+
inode = ext3_new_inode (handle, dir, &dentry->d_name, mode);
17501750
err = PTR_ERR(inode);
17511751
if (!IS_ERR(inode)) {
17521752
init_special_inode(inode, inode->i_mode, rdev);
@@ -1784,7 +1784,7 @@ static int ext3_mkdir(struct inode * dir, struct dentry * dentry, int mode)
17841784
if (IS_DIRSYNC(dir))
17851785
handle->h_sync = 1;
17861786

1787-
inode = ext3_new_inode (handle, dir, S_IFDIR | mode);
1787+
inode = ext3_new_inode (handle, dir, &dentry->d_name, S_IFDIR | mode);
17881788
err = PTR_ERR(inode);
17891789
if (IS_ERR(inode))
17901790
goto out_stop;
@@ -2206,7 +2206,7 @@ static int ext3_symlink (struct inode * dir,
22062206
if (IS_DIRSYNC(dir))
22072207
handle->h_sync = 1;
22082208

2209-
inode = ext3_new_inode (handle, dir, S_IFLNK|S_IRWXUGO);
2209+
inode = ext3_new_inode (handle, dir, &dentry->d_name, S_IFLNK|S_IRWXUGO);
22102210
err = PTR_ERR(inode);
22112211
if (IS_ERR(inode))
22122212
goto out_stop;

0 commit comments

Comments
 (0)