[PATCH RFC v2 42/42] selftests/filesystems: add backing file tests for pseudo files
sashiko-bot at kernel.org
sashiko-bot at kernel.org
Sat Nov 14 13:23:23 UTC 2026
> Add tests that files on pseudo filesystems can't be used as storage:
>
> - a procfs file attached read-only to a loop device
> - sysfs files attached read-only and read-write to a loop device
> - a sysfs file behind a lower-only overlayfs attached to a loop device
> - a symlink and a magic link to a sysfs file attached to a loop device
> - a procfs file as the backing file of an nvme target namespace
> - a procfs file as the backing file and as the protection file of a
> fileio device of the scsi target
> - a procfs file as a zloop zone file
> - a sysfs file as the backing file of a usb mass storage gadget LUN
> - a sysfs file as the source of a file-backed erofs mount
>
> Add tests that FIFOs and character devices can't be used as storage by
> loop, the nvme target, the fileio backend and zloop either.
>
> And make sure that a memfd and another loop device still work as loop
> backing files, that a regular file and a block device still work for
> the nvme target and the fileio backend and that loop refuses a backing
> file that isn't open for reading.
>
> The nvme target test uses buffered_io as asked for in [1]. Most pseudo
> files can't be opened with O_DIRECT and the test would pass without
> ever reaching the check.
>
> [1]: https://lore.kernel.org/r/71f76e5e-ce24-4a71-863a-169ad262c510@gmail.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=42
More information about the Linux-security-module-archive
mailing list