summaryrefslogtreecommitdiff
path: root/security/selinux/hooks.c
diff options
context:
space:
mode:
authorAl Viro <viro@zeniv.linux.org.uk>2018-12-13 04:13:29 +0300
committerAl Viro <viro@zeniv.linux.org.uk>2018-12-21 19:47:41 +0300
commit5b4002391153acebce2557af318bbdc17e235134 (patch)
treeb5c6afc5fbffd01ca682332e2893bad477e59b9d /security/selinux/hooks.c
parent6a0440e5b7562512c021aa1b5a706fcc545773db (diff)
downloadlinux-5b4002391153acebce2557af318bbdc17e235134.tar.xz
LSM: turn sb_eat_lsm_opts() into a method
Kill ->sb_copy_data() - it's used only in combination with immediately following ->sb_parse_opts_str(). Turn that combination into a new method. This is just a mechanical move - cleanups will be the next step. 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.c16
1 files changed, 15 insertions, 1 deletions
diff --git a/security/selinux/hooks.c b/security/selinux/hooks.c
index 630fe8883957..ce0511f024e0 100644
--- a/security/selinux/hooks.c
+++ b/security/selinux/hooks.c
@@ -2810,6 +2810,20 @@ out:
return rc;
}
+static int selinux_sb_eat_lsm_opts(char *options, struct security_mnt_opts *opts)
+{
+ char *s = (char *)get_zeroed_page(GFP_KERNEL);
+ int err;
+
+ if (!s)
+ return -ENOMEM;
+ err = selinux_sb_copy_data(options, s);
+ if (!err)
+ err = selinux_parse_opts_str(s, opts);
+ free_page((unsigned long)s);
+ return err;
+}
+
static int selinux_sb_remount(struct super_block *sb,
struct security_mnt_opts *opts)
{
@@ -6863,7 +6877,7 @@ static struct security_hook_list selinux_hooks[] __lsm_ro_after_init = {
LSM_HOOK_INIT(sb_alloc_security, selinux_sb_alloc_security),
LSM_HOOK_INIT(sb_free_security, selinux_sb_free_security),
- LSM_HOOK_INIT(sb_copy_data, selinux_sb_copy_data),
+ LSM_HOOK_INIT(sb_eat_lsm_opts, selinux_sb_eat_lsm_opts),
LSM_HOOK_INIT(sb_remount, selinux_sb_remount),
LSM_HOOK_INIT(sb_kern_mount, selinux_sb_kern_mount),
LSM_HOOK_INIT(sb_show_options, selinux_sb_show_options),