summaryrefslogtreecommitdiffstats
path: root/security/selinux/hooks.c
diff options
context:
space:
mode:
authorAl Viro <viro@zeniv.linux.org.uk>2018-12-05 11:58:35 -0500
committerAl Viro <viro@zeniv.linux.org.uk>2018-12-21 11:46:42 -0500
commita10d7c22b34bcf744679019269bfb33ebf0b75ee (patch)
treed8061eb8e92296f6a55d683112c8f8a172f33e83 /security/selinux/hooks.c
parentf5c0c26d9008b355babb6d16f3d7c4de3bada0e7 (diff)
LSM: split ->sb_set_mnt_opts() out of ->sb_kern_mount()
... leaving the "is it kernel-internal" logics in the caller. Reviewed-by: David Howells <dhowells@redhat.com> Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'security/selinux/hooks.c')
-rw-r--r--security/selinux/hooks.c10
1 files changed, 1 insertions, 9 deletions
diff --git a/security/selinux/hooks.c b/security/selinux/hooks.c
index ba3e2917bd24..59b164d7134d 100644
--- a/security/selinux/hooks.c
+++ b/security/selinux/hooks.c
@@ -2874,18 +2874,10 @@ out_bad_option:
2874 return -EINVAL; 2874 return -EINVAL;
2875} 2875}
2876 2876
2877static int selinux_sb_kern_mount(struct super_block *sb, int flags, 2877static int selinux_sb_kern_mount(struct super_block *sb)
2878 struct security_mnt_opts *opts)
2879{ 2878{
2880 const struct cred *cred = current_cred(); 2879 const struct cred *cred = current_cred();
2881 struct common_audit_data ad; 2880 struct common_audit_data ad;
2882 int rc = selinux_set_mnt_opts(sb, opts, 0, NULL);
2883 if (rc)
2884 return rc;
2885
2886 /* Allow all mounts performed by the kernel */
2887 if (flags & MS_KERNMOUNT)
2888 return 0;
2889 2881
2890 ad.type = LSM_AUDIT_DATA_DENTRY; 2882 ad.type = LSM_AUDIT_DATA_DENTRY;
2891 ad.u.dentry = sb->s_root; 2883 ad.u.dentry = sb->s_root;