diff options
Diffstat (limited to 'security/security.c')
-rw-r--r-- | security/security.c | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/security/security.c b/security/security.c index 9663ffcca4b0..b7cf5cbfdc67 100644 --- a/security/security.c +++ b/security/security.c @@ -1061,8 +1061,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); |