mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-29 03:01:39 -04:00
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 <[email protected]> Signed-off-by: Al Viro <[email protected]>
This commit is contained in:
parent
c039bc3c24
commit
f5c0c26d90
6 changed files with 20 additions and 77 deletions
13
fs/super.c
13
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);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue