summaryrefslogtreecommitdiff
path: root/security/security.c
diff options
context:
space:
mode:
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>2022-01-31 10:13:10 +0100
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2022-01-31 10:13:10 +0100
commit60c250a98d4ca12a34a89a498cb05d4d221f2f19 (patch)
treef73a2201c64cb9c86fd4d78eac442548bc6df590 /security/security.c
parent993a44fa85c1ea5989fb5c46236ca2e3cfd71b78 (diff)
parent26291c54e111ff6ba87a164d85d4a4e134b7315c (diff)
Merge tag 'v5.17-rc2' into usb-next
We need the USB fixes in here as well. Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'security/security.c')
-rw-r--r--security/security.c15
1 files changed, 13 insertions, 2 deletions
diff --git a/security/security.c b/security/security.c
index 3d4eb474f35b0..22261d79f3333 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);