diff options
author | Al Viro <viro@zeniv.linux.org.uk> | 2018-12-13 04:13:29 +0300 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2018-12-21 19:47:41 +0300 |
commit | 5b4002391153acebce2557af318bbdc17e235134 (patch) | |
tree | b5c6afc5fbffd01ca682332e2893bad477e59b9d /security/smack | |
parent | 6a0440e5b7562512c021aa1b5a706fcc545773db (diff) | |
download | linux-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/smack')
-rw-r--r-- | security/smack/smack_lsm.c | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/security/smack/smack_lsm.c b/security/smack/smack_lsm.c index 50e6e88bfe70..835cca277c2a 100644 --- a/security/smack/smack_lsm.c +++ b/security/smack/smack_lsm.c @@ -739,6 +739,20 @@ out_err: return rc; } +static int smack_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 = smack_sb_copy_data(options, s); + if (!err) + err = smack_parse_opts_str(s, opts); + free_page((unsigned long)s); + return err; +} + /** * smack_set_mnt_opts - set Smack specific mount options * @sb: the file system superblock @@ -4637,7 +4651,7 @@ 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_eat_lsm_opts, smack_sb_eat_lsm_opts), 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), |