summaryrefslogtreecommitdiffstats
path: root/security
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
parentf5c0c26d9008b355babb6d16f3d7c4de3bada0e7 (diff)
downloadlinux-a10d7c22b34bcf744679019269bfb33ebf0b75ee.tar.bz2
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')
-rw-r--r--security/security.c5
-rw-r--r--security/selinux/hooks.c10
-rw-r--r--security/smack/smack_lsm.c15
3 files changed, 3 insertions, 27 deletions
diff --git a/security/security.c b/security/security.c
index 02c656dd5c0c..afb05646d41b 100644
--- a/security/security.c
+++ b/security/security.c
@@ -405,10 +405,9 @@ int security_sb_remount(struct super_block *sb,
return call_int_hook(sb_remount, 0, sb, opts);
}
-int security_sb_kern_mount(struct super_block *sb, int flags,
- struct security_mnt_opts *opts)
+int security_sb_kern_mount(struct super_block *sb)
{
- return call_int_hook(sb_kern_mount, 0, sb, flags, opts);
+ return call_int_hook(sb_kern_mount, 0, sb);
}
int security_sb_show_options(struct seq_file *m, struct super_block *sb)
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:
return -EINVAL;
}
-static int selinux_sb_kern_mount(struct super_block *sb, int flags,
- struct security_mnt_opts *opts)
+static int selinux_sb_kern_mount(struct super_block *sb)
{
const struct cred *cred = current_cred();
struct common_audit_data ad;
- int rc = selinux_set_mnt_opts(sb, opts, 0, NULL);
- if (rc)
- return rc;
-
- /* Allow all mounts performed by the kernel */
- if (flags & MS_KERNMOUNT)
- return 0;
ad.type = LSM_AUDIT_DATA_DENTRY;
ad.u.dentry = sb->s_root;
diff --git a/security/smack/smack_lsm.c b/security/smack/smack_lsm.c
index 1d465ae3d11c..50e6e88bfe70 100644
--- a/security/smack/smack_lsm.c
+++ b/security/smack/smack_lsm.c
@@ -852,20 +852,6 @@ static int smack_set_mnt_opts(struct super_block *sb,
}
/**
- * smack_sb_kern_mount - Smack specific mount processing
- * @sb: the file system superblock
- * @flags: the mount flags
- * @data: the smack mount options
- *
- * Returns 0 on success, an error code on failure
- */
-static int smack_sb_kern_mount(struct super_block *sb, int flags,
- struct security_mnt_opts *opts)
-{
- return smack_set_mnt_opts(sb, opts, 0, NULL);
-}
-
-/**
* smack_sb_statfs - Smack check on statfs
* @dentry: identifies the file system in question
*
@@ -4652,7 +4638,6 @@ static struct security_hook_list smack_hooks[] __lsm_ro_after_init = {
LSM_HOOK_INIT(sb_alloc_security, smack_sb_alloc_security),
LSM_HOOK_INIT(sb_free_security, smack_sb_free_security),
LSM_HOOK_INIT(sb_copy_data, smack_sb_copy_data),
- LSM_HOOK_INIT(sb_kern_mount, smack_sb_kern_mount),
LSM_HOOK_INIT(sb_statfs, smack_sb_statfs),
LSM_HOOK_INIT(sb_set_mnt_opts, smack_set_mnt_opts),
LSM_HOOK_INIT(sb_parse_opts_str, smack_parse_opts_str),