diff options
author | Al Viro <viro@zeniv.linux.org.uk> | 2018-12-14 23:42:21 -0500 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2018-12-21 11:50:02 -0500 |
commit | 757cbe597fe8490c7c0a9650ebe5d60195f151d4 (patch) | |
tree | 3603e26c54988aa08e45592f7955439974239e54 /fs | |
parent | 99dbbb593fe6b39153c15ea9b9c63ea911864cf2 (diff) | |
download | linux-757cbe597fe8490c7c0a9650ebe5d60195f151d4.tar.gz linux-757cbe597fe8490c7c0a9650ebe5d60195f151d4.tar.bz2 linux-757cbe597fe8490c7c0a9650ebe5d60195f151d4.zip |
LSM: new method: ->sb_add_mnt_opt()
Adding options to growing mnt_opts. NFS kludge with passing
context= down into non-text-options mount switched to it, and
with that the last use of ->sb_parse_opts_str() is gone.
Reviewed-by: David Howells <dhowells@redhat.com>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'fs')
-rw-r--r-- | fs/nfs/super.c | 9 |
1 files changed, 2 insertions, 7 deletions
diff --git a/fs/nfs/super.c b/fs/nfs/super.c index 1943de8f9d29..073eec2366f8 100644 --- a/fs/nfs/super.c +++ b/fs/nfs/super.c @@ -2070,14 +2070,9 @@ static int nfs23_validate_mount_data(void *options, if (data->context[0]){ #ifdef CONFIG_SECURITY_SELINUX int rc; - char *opts_str = kmalloc(sizeof(data->context) + 8, GFP_KERNEL); - if (!opts_str) - return -ENOMEM; - strcpy(opts_str, "context="); data->context[NFS_MAX_CONTEXT_LEN] = '\0'; - strcat(opts_str, &data->context[0]); - rc = security_sb_parse_opts_str(opts_str, &args->lsm_opts); - kfree(opts_str); + rc = security_add_mnt_opt("context", data->context, + strlen(data->context), &args->lsm_opts); if (rc) return rc; #else |