summaryrefslogtreecommitdiff
path: root/fs/namespace.c
diff options
context:
space:
mode:
authorAl Viro <viro@zeniv.linux.org.uk>2018-11-17 20:09:18 +0300
committerAl Viro <viro@zeniv.linux.org.uk>2018-12-21 19:46:00 +0300
commitf5c0c26d9008b355babb6d16f3d7c4de3bada0e7 (patch)
tree27370bd41579aa94dd36056956554e922a4455f9 /fs/namespace.c
parentc039bc3c2498724946304a8f964244a9b6af1043 (diff)
downloadlinux-f5c0c26d9008b355babb6d16f3d7c4de3bada0e7.tar.xz
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.c11
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;
}