[PATCH RFC v2 41/42] acct: refuse files on pseudo filesystems
sashiko-bot at kernel.org
sashiko-bot at kernel.org
Sat Nov 14 13:23:29 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
> 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/20261114-work-loop-pseudo-v2-0-98639a2286fb@kernel.org?part=41
More information about the Linux-security-module-archive
mailing list