Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge tag 'fixes-v5.17-lsm-ceph-null' of git://git.kernel.org/pub/scm/linux/kernel/git/jmorris/linux-security

Pull security sybsystem fix from James Morris:
"Fix NULL pointer crash in LSM via Ceph, from Vivek Goyal"

* tag 'fixes-v5.17-lsm-ceph-null' of git://git.kernel.org/pub/scm/linux/kernel/git/jmorris/linux-security:
security, lsm: dentry_init_security() Handle multi LSM registration

+14 -3
+1 -1
include/linux/lsm_hook_defs.h
··· 80 80 unsigned long *set_kern_flags) 81 81 LSM_HOOK(int, 0, move_mount, const struct path *from_path, 82 82 const struct path *to_path) 83 - LSM_HOOK(int, 0, dentry_init_security, struct dentry *dentry, 83 + LSM_HOOK(int, -EOPNOTSUPP, dentry_init_security, struct dentry *dentry, 84 84 int mode, const struct qstr *name, const char **xattr_name, 85 85 void **ctx, u32 *ctxlen) 86 86 LSM_HOOK(int, 0, dentry_create_files_as, struct dentry *dentry, int mode,
+13 -2
security/security.c
··· 1048 1048 const char **xattr_name, void **ctx, 1049 1049 u32 *ctxlen) 1050 1050 { 1051 - return call_int_hook(dentry_init_security, -EOPNOTSUPP, dentry, mode, 1052 - name, xattr_name, ctx, ctxlen); 1051 + struct security_hook_list *hp; 1052 + int rc; 1053 + 1054 + /* 1055 + * Only one module will provide a security context. 1056 + */ 1057 + hlist_for_each_entry(hp, &security_hook_heads.dentry_init_security, list) { 1058 + rc = hp->hook.dentry_init_security(dentry, mode, name, 1059 + xattr_name, ctx, ctxlen); 1060 + if (rc != LSM_RET_DEFAULT(dentry_init_security)) 1061 + return rc; 1062 + } 1063 + return LSM_RET_DEFAULT(dentry_init_security); 1053 1064 } 1054 1065 EXPORT_SYMBOL(security_dentry_init_security); 1055 1066