[PATCH RFC v3 43/44] acct: refuse files on pseudo filesystems
sashiko-bot at kernel.org
sashiko-bot at kernel.org
Mon Nov 16 11:27:19 UTC 2026
> acct(2) already refuses to write its records to files on kernel internal
> filesystems and to procfs and sysfs files. It recognizes the latter two
> by FS_USERNS_MOUNT_RESTRICTED which misses every other pseudo
> filesystem. So a cgroup2 or binfmt_misc file is accepted as the
> accounting file.
>
> The records are written with the credentials of whoever turned on
> accounting so this isn't abusable the way loop is. But files on pseudo
> filesystems aren't a place to store accounting records. Use
> file_check_backing() to refuse all of them.
>
> SB_NOUSER doesn't need to be checked separately anymore. It is only
> raised by pseudo filesystems and by tmpfs instances that are either
> kernel internal or can't be mounted.
>
> Suggested-by: Alexander Mikhalitsyn <alex at amutable.com>
> Link: https://lore.kernel.org/r/ae189903d4cda27130317a9312d94b53d07415ba.camel@amutable.com
> Reviewed-by: Chris Down <chris at chrisdown.name>
> Tested-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=43
More information about the Linux-security-module-archive
mailing list