[PATCH RFC 1/3] lsm: Call inode_init_security hooks without xattrs
sashiko-bot at kernel.org
sashiko-bot at kernel.org
Sat Oct 24 21:38:27 UTC 2026
> security_inode_init_security() returns early when no LSM reserves an
> xattr slot, so the inode_init_security hooks never run on a kernel
> whose LSMs provide no xattr. An LSM can then not use the hook to
> observe inode creation unless some other LSM happens to label inodes.
>
> Call the hooks regardless of the reserved xattr count, and only skip
> allocating the xattr array when no slot is reserved. LSMs that write
> xattrs still need a reserved slot, so they are unaffected. Landlock
> uses the hook in the next patch to track the files a sandboxed task
> creates.
>
> Assisted-by: LLM
> Signed-off-by: Farid Zakaria <farid.m.zakaria at gmail.com>
Sashiko has reviewed this patch and found no issues.
--
Sashiko AI review · https://sashiko.dev/#/patchset/20261024-landlock-created-rights-v1-0-77c8db3f6bd2@gmail.com?part=1
More information about the Linux-security-module-archive
mailing list