summaryrefslogtreecommitdiff
path: root/fs/super.c
diff options
context:
space:
mode:
authorAl Viro <viro@zeniv.linux.org.uk>2018-11-17 12:09:18 -0500
committerAl Viro <viro@zeniv.linux.org.uk>2018-12-21 11:46:00 -0500
commitf5c0c26d9008b355babb6d16f3d7c4de3bada0e7 (patch)
tree27370bd41579aa94dd36056956554e922a4455f9 /fs/super.c
parentc039bc3c2498724946304a8f964244a9b6af1043 (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 'fs/super.c')
-rw-r--r--fs/super.c13
1 files changed, 1 insertions, 12 deletions
diff --git a/fs/super.c b/fs/super.c
index 8d9c9199832d..d571527cb8b8 100644
--- a/fs/super.c
+++ b/fs/super.c
@@ -1252,18 +1252,7 @@ mount_fs(struct file_system_type *type, int flags, const char *name, void *data)
security_init_mnt_opts(&opts);
if (data && !(type->fs_flags & FS_BINARY_MOUNTDATA)) {
- char *secdata = alloc_secdata();
- if (!secdata)
- return ERR_PTR(-ENOMEM);
-
- error = security_sb_copy_data(data, secdata);
- if (error) {
- free_secdata(secdata);
- return ERR_PTR(error);
- }
-
- error = security_sb_parse_opts_str(secdata, &opts);
- free_secdata(secdata);
+ error = security_sb_eat_lsm_opts(data, &opts);
if (error)
return ERR_PTR(error);
}