diff options
author | Jakub Kicinski <kuba@kernel.org> | 2022-02-03 17:36:16 -0800 |
---|---|---|
committer | Jakub Kicinski <kuba@kernel.org> | 2022-02-03 17:36:16 -0800 |
commit | c59400a68c53374179cdc5f99fa77afbd092dcf8 (patch) | |
tree | c5e17286fa5b7867a5290a975cca3bc5759d510e /security | |
parent | 9c30918925d7992a6d812b3aa7e026839723c78a (diff) | |
parent | dcb85f85fa6f142aae1fe86f399d4503d49f2b60 (diff) | |
download | linux-c59400a68c53374179cdc5f99fa77afbd092dcf8.tar.bz2 |
Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net
No conflicts.
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'security')
-rw-r--r-- | security/security.c | 15 | ||||
-rw-r--r-- | security/selinux/ss/conditional.c | 3 |
2 files changed, 15 insertions, 3 deletions
diff --git a/security/security.c b/security/security.c index 3d4eb474f35b..22261d79f333 100644 --- a/security/security.c +++ b/security/security.c @@ -1048,8 +1048,19 @@ int security_dentry_init_security(struct dentry *dentry, int mode, const char **xattr_name, void **ctx, u32 *ctxlen) { - return call_int_hook(dentry_init_security, -EOPNOTSUPP, dentry, mode, - name, xattr_name, ctx, ctxlen); + struct security_hook_list *hp; + int rc; + + /* + * Only one module will provide a security context. + */ + hlist_for_each_entry(hp, &security_hook_heads.dentry_init_security, list) { + rc = hp->hook.dentry_init_security(dentry, mode, name, + xattr_name, ctx, ctxlen); + if (rc != LSM_RET_DEFAULT(dentry_init_security)) + return rc; + } + return LSM_RET_DEFAULT(dentry_init_security); } EXPORT_SYMBOL(security_dentry_init_security); diff --git a/security/selinux/ss/conditional.c b/security/selinux/ss/conditional.c index 2ec6e5cd25d9..feb206f3acb4 100644 --- a/security/selinux/ss/conditional.c +++ b/security/selinux/ss/conditional.c @@ -152,6 +152,8 @@ static void cond_list_destroy(struct policydb *p) for (i = 0; i < p->cond_list_len; i++) cond_node_destroy(&p->cond_list[i]); kfree(p->cond_list); + p->cond_list = NULL; + p->cond_list_len = 0; } void cond_policydb_destroy(struct policydb *p) @@ -441,7 +443,6 @@ int cond_read_list(struct policydb *p, void *fp) return 0; err: cond_list_destroy(p); - p->cond_list = NULL; return rc; } |