diff options
author | Ondrej Mosnacek <omosnace@redhat.com> | 2021-12-06 16:24:06 +0300 |
---|---|---|
committer | Paul Moore <paul@paul-moore.com> | 2021-12-06 21:46:24 +0300 |
commit | 52f982f00b220d097a71a23c149a1d18efc08e63 (patch) | |
tree | 4bb91b2e13ea2f991987cfa96815b1928813033d /security/selinux | |
parent | 5fe375728983b3fca6b958434a2e3f547bbbb2aa (diff) | |
download | linux-52f982f00b220d097a71a23c149a1d18efc08e63.tar.xz |
security,selinux: remove security_add_mnt_opt()
Its last user has been removed in commit f2aedb713c28 ("NFS: Add
fs_context support.").
Signed-off-by: Ondrej Mosnacek <omosnace@redhat.com>
Reviewed-by: Casey Schaufler <casey@schaufler-ca.com>
Signed-off-by: Paul Moore <paul@paul-moore.com>
Diffstat (limited to 'security/selinux')
-rw-r--r-- | security/selinux/hooks.c | 39 |
1 files changed, 0 insertions, 39 deletions
diff --git a/security/selinux/hooks.c b/security/selinux/hooks.c index 726175254f60..818ce976ff6c 100644 --- a/security/selinux/hooks.c +++ b/security/selinux/hooks.c @@ -1010,44 +1010,6 @@ Einval: return -EINVAL; } -static int selinux_add_mnt_opt(const char *option, const char *val, int len, - void **mnt_opts) -{ - int token = Opt_error; - int rc, i; - - for (i = 0; i < ARRAY_SIZE(tokens); i++) { - if (strcmp(option, tokens[i].name) == 0) { - token = tokens[i].opt; - break; - } - } - - if (token == Opt_error) - return -EINVAL; - - if (token != Opt_seclabel) { - val = kmemdup_nul(val, len, GFP_KERNEL); - if (!val) { - rc = -ENOMEM; - goto free_opt; - } - } - rc = selinux_add_opt(token, val, mnt_opts); - if (unlikely(rc)) { - kfree(val); - goto free_opt; - } - return rc; - -free_opt: - if (*mnt_opts) { - selinux_free_mnt_opts(*mnt_opts); - *mnt_opts = NULL; - } - return rc; -} - static int show_sid(struct seq_file *m, u32 sid) { char *context = NULL; @@ -7285,7 +7247,6 @@ static struct security_hook_list selinux_hooks[] __lsm_ro_after_init = { LSM_HOOK_INIT(fs_context_dup, selinux_fs_context_dup), LSM_HOOK_INIT(fs_context_parse_param, selinux_fs_context_parse_param), LSM_HOOK_INIT(sb_eat_lsm_opts, selinux_sb_eat_lsm_opts), - LSM_HOOK_INIT(sb_add_mnt_opt, selinux_add_mnt_opt), #ifdef CONFIG_SECURITY_NETWORK_XFRM LSM_HOOK_INIT(xfrm_policy_clone_security, selinux_xfrm_policy_clone), #endif |