aboutsummaryrefslogtreecommitdiffstats
path: root/security/selinux
diff options
context:
space:
mode:
authorAl Viro <viro@zeniv.linux.org.uk>2012-06-26 13:58:53 -0400
committerAl Viro <viro@zeniv.linux.org.uk>2012-07-22 16:01:29 -0400
commit765927b2d508712d320c8934db963bbe14c3fcec (patch)
tree97acdb14fae285764def396c4ed01d4d5c93e76a /security/selinux
parentbf349a447059656ebe63fb4fd1ccb27ac1da22ad (diff)
switch dentry_open() to struct path, make it grab references itself
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'security/selinux')
-rw-r--r--security/selinux/hooks.c3
-rw-r--r--security/selinux/include/security.h2
-rw-r--r--security/selinux/selinuxfs.c6
3 files changed, 5 insertions, 6 deletions
diff --git a/security/selinux/hooks.c b/security/selinux/hooks.c
index 372ec6502aa..e423f5fe67f 100644
--- a/security/selinux/hooks.c
+++ b/security/selinux/hooks.c
@@ -2157,8 +2157,7 @@ static inline void flush_unauthorized_files(const struct cred *cred,
2157 get_file(devnull); 2157 get_file(devnull);
2158 } else { 2158 } else {
2159 devnull = dentry_open( 2159 devnull = dentry_open(
2160 dget(selinux_null), 2160 &selinux_null,
2161 mntget(selinuxfs_mount),
2162 O_RDWR, cred); 2161 O_RDWR, cred);
2163 if (IS_ERR(devnull)) { 2162 if (IS_ERR(devnull)) {
2164 devnull = NULL; 2163 devnull = NULL;
diff --git a/security/selinux/include/security.h b/security/selinux/include/security.h
index dde2005407a..6d3885165d1 100644
--- a/security/selinux/include/security.h
+++ b/security/selinux/include/security.h
@@ -221,7 +221,7 @@ extern void selinux_status_update_policyload(int seqno);
221extern void selinux_complete_init(void); 221extern void selinux_complete_init(void);
222extern int selinux_disable(void); 222extern int selinux_disable(void);
223extern void exit_sel_fs(void); 223extern void exit_sel_fs(void);
224extern struct dentry *selinux_null; 224extern struct path selinux_null;
225extern struct vfsmount *selinuxfs_mount; 225extern struct vfsmount *selinuxfs_mount;
226extern void selnl_notify_setenforce(int val); 226extern void selnl_notify_setenforce(int val);
227extern void selnl_notify_policyload(u32 seqno); 227extern void selnl_notify_policyload(u32 seqno);
diff --git a/security/selinux/selinuxfs.c b/security/selinux/selinuxfs.c
index 3ad29025128..298e695d682 100644
--- a/security/selinux/selinuxfs.c
+++ b/security/selinux/selinuxfs.c
@@ -1297,7 +1297,7 @@ out:
1297 1297
1298#define NULL_FILE_NAME "null" 1298#define NULL_FILE_NAME "null"
1299 1299
1300struct dentry *selinux_null; 1300struct path selinux_null;
1301 1301
1302static ssize_t sel_read_avc_cache_threshold(struct file *filp, char __user *buf, 1302static ssize_t sel_read_avc_cache_threshold(struct file *filp, char __user *buf,
1303 size_t count, loff_t *ppos) 1303 size_t count, loff_t *ppos)
@@ -1838,7 +1838,7 @@ static int sel_fill_super(struct super_block *sb, void *data, int silent)
1838 1838
1839 init_special_inode(inode, S_IFCHR | S_IRUGO | S_IWUGO, MKDEV(MEM_MAJOR, 3)); 1839 init_special_inode(inode, S_IFCHR | S_IRUGO | S_IWUGO, MKDEV(MEM_MAJOR, 3));
1840 d_add(dentry, inode); 1840 d_add(dentry, inode);
1841 selinux_null = dentry; 1841 selinux_null.dentry = dentry;
1842 1842
1843 dentry = sel_make_dir(sb->s_root, "avc", &sel_last_ino); 1843 dentry = sel_make_dir(sb->s_root, "avc", &sel_last_ino);
1844 if (IS_ERR(dentry)) { 1844 if (IS_ERR(dentry)) {
@@ -1912,7 +1912,7 @@ static int __init init_sel_fs(void)
1912 return err; 1912 return err;
1913 } 1913 }
1914 1914
1915 selinuxfs_mount = kern_mount(&sel_fs_type); 1915 selinux_null.mnt = selinuxfs_mount = kern_mount(&sel_fs_type);
1916 if (IS_ERR(selinuxfs_mount)) { 1916 if (IS_ERR(selinuxfs_mount)) {
1917 printk(KERN_ERR "selinuxfs: could not mount!\n"); 1917 printk(KERN_ERR "selinuxfs: could not mount!\n");
1918 err = PTR_ERR(selinuxfs_mount); 1918 err = PTR_ERR(selinuxfs_mount);