diff options
author | Al Viro <viro@zeniv.linux.org.uk> | 2018-11-17 18:09:18 +0100 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2018-12-21 17:46:00 +0100 |
commit | f5c0c26d9008b355babb6d16f3d7c4de3bada0e7 (patch) | |
tree | 27370bd41579aa94dd36056956554e922a4455f9 /fs/namespace.c | |
parent | LSM: lift extracting and parsing LSM options into the caller of ->sb_remount() (diff) | |
download | linux-f5c0c26d9008b355babb6d16f3d7c4de3bada0e7.tar.xz linux-f5c0c26d9008b355babb6d16f3d7c4de3bada0e7.zip |
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 'fs/namespace.c')
-rw-r--r-- | fs/namespace.c | 11 |
1 files changed, 1 insertions, 10 deletions
diff --git a/fs/namespace.c b/fs/namespace.c index 341793fbd390..39aca7b69c2e 100644 --- a/fs/namespace.c +++ b/fs/namespace.c @@ -2312,16 +2312,7 @@ static int do_remount(struct path *path, int ms_flags, int sb_flags, security_init_mnt_opts(&opts); if (data && !(sb->s_type->fs_flags & FS_BINARY_MOUNTDATA)) { - char *secdata = alloc_secdata(); - if (!secdata) - return -ENOMEM; - err = security_sb_copy_data(data, secdata); - if (err) { - free_secdata(secdata); - return err; - } - err = security_sb_parse_opts_str(secdata, &opts); - free_secdata(secdata); + err = security_sb_eat_lsm_opts(data, &opts); if (err) return err; } |