diff options
author | Al Viro <viro@zeniv.linux.org.uk> | 2018-11-17 12:09:18 -0500 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2018-12-21 11:46:00 -0500 |
commit | f5c0c26d9008b355babb6d16f3d7c4de3bada0e7 (patch) | |
tree | 27370bd41579aa94dd36056956554e922a4455f9 /security/security.c | |
parent | c039bc3c2498724946304a8f964244a9b6af1043 (diff) |
new helper: security_sb_eat_lsm_opts()
combination of alloc_secdata(), security_sb_copy_data(),
security_sb_parse_opt_str() and free_secdata().
Reviewed-by: David Howells <dhowells@redhat.com>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'security/security.c')
-rw-r--r-- | security/security.c | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/security/security.c b/security/security.c index 3f50beb30fb1..02c656dd5c0c 100644 --- a/security/security.c +++ b/security/security.c | |||
@@ -384,11 +384,20 @@ void security_sb_free(struct super_block *sb) | |||
384 | call_void_hook(sb_free_security, sb); | 384 | call_void_hook(sb_free_security, sb); |
385 | } | 385 | } |
386 | 386 | ||
387 | int security_sb_copy_data(char *orig, char *copy) | 387 | int security_sb_eat_lsm_opts(char *options, struct security_mnt_opts *opts) |
388 | { | 388 | { |
389 | return call_int_hook(sb_copy_data, 0, orig, copy); | 389 | char *s = (char *)get_zeroed_page(GFP_KERNEL); |
390 | int err; | ||
391 | |||
392 | if (!s) | ||
393 | return -ENOMEM; | ||
394 | err = call_int_hook(sb_copy_data, 0, options, s); | ||
395 | if (!err) | ||
396 | err = call_int_hook(sb_parse_opts_str, 0, s, opts); | ||
397 | free_page((unsigned long)s); | ||
398 | return err; | ||
390 | } | 399 | } |
391 | EXPORT_SYMBOL(security_sb_copy_data); | 400 | EXPORT_SYMBOL(security_sb_eat_lsm_opts); |
392 | 401 | ||
393 | int security_sb_remount(struct super_block *sb, | 402 | int security_sb_remount(struct super_block *sb, |
394 | struct security_mnt_opts *opts) | 403 | struct security_mnt_opts *opts) |