[PATCH RFC v3 17/44] securityfs: use fc_init_pseudo()
sashiko-bot at kernel.org
sashiko-bot at kernel.org
Mon Nov 16 11:20:03 UTC 2026
> Initialize securityfs as a pseudo filesystem. This raises SB_I_PSEUDO
> and SB_I_NOEXEC. securityfs never holds executables.
>
> But securityfs needs device nodes. AppArmor puts a .null device node
> into securityfs. On exec it replaces file descriptors the new profile
> isn't allowed to use with that node and opens it via dentry_open() which
> doesn't care about SB_I_NODEV. Such a file descriptor can still be
> reopened through /proc/<pid>/fd/<nr> though and that's what opening
> /dev/stderr does. The node itself can also be opened by path as
> /sys/kernel/security/apparmor/.null. Both go through may_open_dev()
> which refuses device nodes with SB_I_NODEV raised. So clear SB_I_NODEV
> again in securityfs_fill_super().
>
> Reviewed-by: Alexander Mikhalitsyn <alex at amutable.com>
> Reviewed-by: Chris Down <chris at chrisdown.name>
> Signed-off-by: Christian Brauner (Amutable) <brauner at kernel.org>
Sashiko has reviewed this patch and found no issues.
--
Sashiko AI review · https://sashiko.dev/#/patchset/20261116-work-loop-pseudo-v3-0-8cbbea1cf34f@kernel.org?part=17
More information about the Linux-security-module-archive
mailing list