AI Trajectory


Trajectory: (Expand/Collapse All)
Seq Timestamp Type Name Duration
0/0 2026/11/13 12:16 flow patch-triage
32m Args:
null

Results:
{
  "EnableConfigs": [
    "BLK_DEV_LOOP",
    "BLK_DEV_ZONED",
    "BLK_DEV_ZONED_LOOP",
    "NVME_TARGET",
    "TARGET_CORE",
    "TCM_FILEIO",
    "FUSE_FS",
    "FUSE_PASSTHROUGH",
    "EROFS_FS",
    "EROFS_FS_BACKED_BY_FILE",
    "USB_GADGET",
    "USB_CONFIGFS",
    "USB_CONFIGFS_MASS_STORAGE"
  ],
  "FocusSymbols": [
    "loop_check_backing_file",
    "loop_configure",
    "zloop_init_zone",
    "nvmet_file_ns_enable",
    "fd_configure_device",
    "fsg_lun_open",
    "fuse_backing_open_file",
    "fuse_backing_open",
    "erofs_file_get_tree",
    "erofs_init_device"
  ],
  "KMSANReasoning": "The patch series introduces a new superblock internal flag `SB_I_PSEUDO` and helper functions `fc_init_pseudo()` and `file_is_pseudo()`. It marks pseudo filesystems with this flag during `init_fs_context` and adds checks across various storage subsystems (loop, zloop, nvmet, target_core_file, usb mass storage gadget, erofs, fuse backing) to disallow regular files on pseudo filesystems from being used as backing storage.\n\nContrasting KASAN vs KMSAN applicability:\n- KMSAN is designed to catch reads of uninitialized memory and information leaks to user space. In this patch series, no new uninitialized memory allocations or buffer copies to user space are introduced. The `fs_context` structures where `fc_init_pseudo()` sets flags are allocated zeroed via `kzalloc_obj()`. The check `file_is_pseudo()` only inspects existing, fully initialized fields (`inode-\u003ei_mode` and `sb-\u003es_iflags`).\n- KASAN and standard kernel debuggers (e.g., LOCKDEP, assertions) are relevant for any potential regressions or errors in file operations and storage backing teardowns, though the patch mainly adds early `-EINVAL`/`-EBADF` rejections on invalid backing file setups.\n\nSince there is no exposure or risk of uninitialized memory usage, a dedicated KMSAN fuzzing session is not warranted.",
  "NeedsKMSAN": false,
  "Reasoning": "The patch introduces SB_I_PSEUDO to designate regular files on pseudo-filesystems as kernel interfaces that must not be used as storage backends, and integrates file_is_pseudo() validation into loop devices, zoned loop devices, NVMe target fileio, LIO target FILEIO, USB mass storage gadget, FUSE passthrough backing files, and file-backed EROFS. These are reachable, user-accessible storage and filesystem interfaces in amd64 virtualized environments, making them suitable targets for fuzzing to uncover edge cases and regressions in backing file validation.",
  "WorthFuzzing": true
}

1/1 2026/11/13 12:16 action read-patch-diff
0m Args:
null

Results:
{
  "PatchDiff": "commit da40508d66ebfc12e02da88b0a4c015923f8f10a\nAuthor: syz-cluster \u003ctriage@syzkaller.com\u003e\nDate:   Fri Nov 13 12:16:12 2026 +0000\n\n    syz-cluster: applied patch under review\n\ndiff --git a/arch/powerpc/platforms/cell/spufs/inode.c b/arch/powerpc/platforms/cell/spufs/inode.c\nindex f066d9c7344d37..54b45932aecd22 100644\n--- a/arch/powerpc/platforms/cell/spufs/inode.c\n+++ b/arch/powerpc/platforms/cell/spufs/inode.c\n@@ -11,6 +11,7 @@\n #include \u003clinux/file.h\u003e\n #include \u003clinux/fs.h\u003e\n #include \u003clinux/fs_context.h\u003e\n+#include \u003clinux/pseudo_fs.h\u003e\n #include \u003clinux/fs_parser.h\u003e\n #include \u003clinux/fsnotify.h\u003e\n #include \u003clinux/backing-dev.h\u003e\n@@ -741,6 +742,7 @@ static int spufs_init_fs_context(struct fs_context *fc)\n \n \tfc-\u003efs_private = ctx;\n \tfc-\u003es_fs_info = sbi;\n+\tfc_init_pseudo(fc);\n \tfc-\u003eops = \u0026spufs_context_ops;\n \treturn 0;\n \ndiff --git a/arch/s390/hypfs/inode.c b/arch/s390/hypfs/inode.c\nindex 559b011e68800f..8662169de477ab 100644\n--- a/arch/s390/hypfs/inode.c\n+++ b/arch/s390/hypfs/inode.c\n@@ -12,6 +12,7 @@\n #include \u003clinux/errno.h\u003e\n #include \u003clinux/fs.h\u003e\n #include \u003clinux/fs_context.h\u003e\n+#include \u003clinux/pseudo_fs.h\u003e\n #include \u003clinux/fs_parser.h\u003e\n #include \u003clinux/namei.h\u003e\n #include \u003clinux/vfs.h\u003e\n@@ -301,6 +302,7 @@ static int hypfs_init_fs_context(struct fs_context *fc)\n \tsbi-\u003egid = current_gid();\n \n \tfc-\u003es_fs_info = sbi;\n+\tfc_init_pseudo(fc);\n \tfc-\u003eops = \u0026hypfs_context_ops;\n \treturn 0;\n }\ndiff --git a/drivers/android/binder/rust_binderfs.c b/drivers/android/binder/rust_binderfs.c\nindex 5f020226720dba..04468c5b5c116c 100644\n--- a/drivers/android/binder/rust_binderfs.c\n+++ b/drivers/android/binder/rust_binderfs.c\n@@ -3,6 +3,7 @@\n #include \u003clinux/compiler_types.h\u003e\n #include \u003clinux/errno.h\u003e\n #include \u003clinux/fs.h\u003e\n+#include \u003clinux/pseudo_fs.h\u003e\n #include \u003clinux/fsnotify.h\u003e\n #include \u003clinux/gfp.h\u003e\n #include \u003clinux/idr.h\u003e\n@@ -667,7 +668,6 @@ static int binderfs_fill_super(struct super_block *sb, struct fs_context *fc)\n \t * necessary and safe.\n \t */\n \tsb-\u003es_iflags \u0026= ~SB_I_NODEV;\n-\tsb-\u003es_iflags |= SB_I_NOEXEC;\n \tsb-\u003es_magic = RUST_BINDERFS_SUPER_MAGIC;\n \tsb-\u003es_op = \u0026binderfs_super_ops;\n \tsb-\u003es_time_gran = 1;\n@@ -759,6 +759,7 @@ static int binderfs_init_fs_context(struct fs_context *fc)\n \tctx-\u003estats_mode = binderfs_stats_mode_unset;\n \n \tfc-\u003efs_private = ctx;\n+\tfc_init_pseudo(fc);\n \tfc-\u003eops = \u0026binderfs_fs_context_ops;\n \n \treturn 0;\ndiff --git a/drivers/block/loop.c b/drivers/block/loop.c\nindex a3325ceab484a4..1482580a19795a 100644\n--- a/drivers/block/loop.c\n+++ b/drivers/block/loop.c\n@@ -528,12 +528,18 @@ static void loop_assign_backing_file(struct loop_device *lo, struct file *file)\n \n static int loop_check_backing_file(struct file *file)\n {\n+\tif (!(file-\u003ef_mode \u0026 FMODE_READ))\n+\t\treturn -EBADF;\n+\n \tif (!file-\u003ef_op-\u003eread_iter)\n \t\treturn -EINVAL;\n \n \tif ((file-\u003ef_mode \u0026 FMODE_WRITE) \u0026\u0026 !file-\u003ef_op-\u003ewrite_iter)\n \t\treturn -EINVAL;\n \n+\tif (file_is_pseudo(file))\n+\t\treturn -EINVAL;\n+\n \treturn 0;\n }\n \ndiff --git a/drivers/block/zloop.c b/drivers/block/zloop.c\nindex 65634a39b0bfcb..dcc06dd47b040e 100644\n--- a/drivers/block/zloop.c\n+++ b/drivers/block/zloop.c\n@@ -1137,6 +1137,11 @@ static int zloop_init_zone(struct zloop_device *zlo, struct zloop_options *opts,\n \t\tgoto out_fput;\n \t}\n \n+\tif (file_is_pseudo(zone-\u003efile)) {\n+\t\tret = -EINVAL;\n+\t\tgoto out_fput;\n+\t}\n+\n \tif (zlo-\u003eblock_size) {\n \t\tret = zloop_get_block_size(zlo, zone);\n \t\tif (ret)\ndiff --git a/drivers/nvme/target/io-cmd-file.c b/drivers/nvme/target/io-cmd-file.c\nindex 695963dd932ee7..71c69bac539436 100644\n--- a/drivers/nvme/target/io-cmd-file.c\n+++ b/drivers/nvme/target/io-cmd-file.c\n@@ -47,6 +47,16 @@ int nvmet_file_ns_enable(struct nvmet_ns *ns)\n \t\treturn ret;\n \t}\n \n+\tif (!ns-\u003efile-\u003ef_op-\u003eread_iter || !ns-\u003efile-\u003ef_op-\u003ewrite_iter) {\n+\t\tret = -EINVAL;\n+\t\tgoto err;\n+\t}\n+\n+\tif (file_is_pseudo(ns-\u003efile)) {\n+\t\tret = -EINVAL;\n+\t\tgoto err;\n+\t}\n+\n \tnvmet_file_ns_revalidate(ns);\n \n \t/*\ndiff --git a/drivers/target/target_core_file.c b/drivers/target/target_core_file.c\nindex ab9824a4852f1e..7a3cf63dc979b5 100644\n--- a/drivers/target/target_core_file.c\n+++ b/drivers/target/target_core_file.c\n@@ -144,6 +144,21 @@ static int fd_configure_device(struct se_device *dev)\n \t\tgoto fail;\n \t}\n \tfd_dev-\u003efd_file = file;\n+\n+\tif (!file-\u003ef_op-\u003eread_iter || !file-\u003ef_op-\u003ewrite_iter) {\n+\t\tpr_err(\"FILEIO: %s lacks -\u003eread_iter or -\u003ewrite_iter\\n\",\n+\t\t       fd_dev-\u003efd_dev_name);\n+\t\tret = -EINVAL;\n+\t\tgoto fail;\n+\t}\n+\n+\tif (file_is_pseudo(file)) {\n+\t\tpr_err(\"FILEIO: %s is on a pseudo filesystem\\n\",\n+\t\t       fd_dev-\u003efd_dev_name);\n+\t\tret = -EINVAL;\n+\t\tgoto fail;\n+\t}\n+\n \t/*\n \t * If using a block backend with this struct file, we extract\n \t * fd_dev-\u003efd_[block,dev]_size from struct block_device.\ndiff --git a/drivers/usb/gadget/function/f_fs.c b/drivers/usb/gadget/function/f_fs.c\nindex c64a268e98a433..a6b3788399a560 100644\n--- a/drivers/usb/gadget/function/f_fs.c\n+++ b/drivers/usb/gadget/function/f_fs.c\n@@ -15,6 +15,7 @@\n /* #define VERBOSE_DEBUG */\n \n #include \u003clinux/blkdev.h\u003e\n+#include \u003clinux/pseudo_fs.h\u003e\n #include \u003clinux/dma-buf.h\u003e\n #include \u003clinux/dma-fence.h\u003e\n #include \u003clinux/dma-resv.h\u003e\n@@ -2166,6 +2167,7 @@ static int ffs_fs_init_fs_context(struct fs_context *fc)\n \tctx-\u003eno_disconnect = false;\n \n \tfc-\u003efs_private = ctx;\n+\tfc_init_pseudo(fc);\n \tfc-\u003eops = \u0026ffs_fs_context_ops;\n \treturn 0;\n }\ndiff --git a/drivers/usb/gadget/function/storage_common.c b/drivers/usb/gadget/function/storage_common.c\nindex 75831f2c7abeb0..83683ade20c240 100644\n--- a/drivers/usb/gadget/function/storage_common.c\n+++ b/drivers/usb/gadget/function/storage_common.c\n@@ -211,6 +211,11 @@ int fsg_lun_open(struct fsg_lun *curlun, const char *filename)\n \t\tgoto out;\n \t}\n \n+\tif (file_is_pseudo(filp)) {\n+\t\tLINFO(curlun, \"file on a pseudo filesystem: %s\\n\", filename);\n+\t\tgoto out;\n+\t}\n+\n \t/*\n \t * If we can't read the file, it's no good.\n \t * If we can't write the file, use it read-only.\ndiff --git a/drivers/usb/gadget/legacy/inode.c b/drivers/usb/gadget/legacy/inode.c\nindex 7f6d8460152f90..8490e5d0351e1a 100644\n--- a/drivers/usb/gadget/legacy/inode.c\n+++ b/drivers/usb/gadget/legacy/inode.c\n@@ -13,6 +13,7 @@\n #include \u003clinux/module.h\u003e\n #include \u003clinux/fs.h\u003e\n #include \u003clinux/fs_context.h\u003e\n+#include \u003clinux/pseudo_fs.h\u003e\n #include \u003clinux/pagemap.h\u003e\n #include \u003clinux/uts.h\u003e\n #include \u003clinux/wait.h\u003e\n@@ -2223,6 +2224,7 @@ static const struct fs_context_operations gadgetfs_context_ops = {\n \n static int gadgetfs_init_fs_context(struct fs_context *fc)\n {\n+\tfc_init_pseudo(fc);\n \tfc-\u003eops = \u0026gadgetfs_context_ops;\n \treturn 0;\n }\ndiff --git a/drivers/xen/xenfs/super.c b/drivers/xen/xenfs/super.c\nindex 37ea7c5c034695..aba7d038ed735f 100644\n--- a/drivers/xen/xenfs/super.c\n+++ b/drivers/xen/xenfs/super.c\n@@ -15,6 +15,7 @@\n #include \u003clinux/module.h\u003e\n #include \u003clinux/fs.h\u003e\n #include \u003clinux/fs_context.h\u003e\n+#include \u003clinux/pseudo_fs.h\u003e\n #include \u003clinux/magic.h\u003e\n \n #include \u003cxen/xen.h\u003e\n@@ -80,6 +81,7 @@ static const struct fs_context_operations xenfs_context_ops = {\n \n static int xenfs_init_fs_context(struct fs_context *fc)\n {\n+\tfc_init_pseudo(fc);\n \tfc-\u003eops = \u0026xenfs_context_ops;\n \treturn 0;\n }\ndiff --git a/fs/binfmt_misc.c b/fs/binfmt_misc.c\nindex d945b4f6e15813..7dc233becd98db 100644\n--- a/fs/binfmt_misc.c\n+++ b/fs/binfmt_misc.c\n@@ -22,6 +22,7 @@\n #include \u003clinux/file.h\u003e\n #include \u003clinux/fs.h\u003e\n #include \u003clinux/fs_context.h\u003e\n+#include \u003clinux/pseudo_fs.h\u003e\n #include \u003clinux/init.h\u003e\n #include \u003clinux/kstrtox.h\u003e\n #include \u003clinux/limits.h\u003e\n@@ -1575,8 +1576,7 @@ static int bm_fill_super(struct super_block *sb, struct fs_context *fc)\n \tif (user_ns != current_user_ns())\n \t\treturn -EINVAL;\n \n-\t/* Never exec off this instance and never let anything stack on it. */\n-\tsb-\u003es_iflags |= SB_I_NOEXEC | SB_I_NODEV;\n+\t/* Never let anything stack on this instance. */\n \tsb-\u003es_stack_depth = FILESYSTEM_MAX_STACK_DEPTH;\n \n \t/*\n@@ -1660,6 +1660,7 @@ static void bm_kill_sb(struct super_block *sb)\n \n static int bm_init_fs_context(struct fs_context *fc)\n {\n+\tfc_init_pseudo(fc);\n \tfc-\u003eops = \u0026bm_context_ops;\n \treturn 0;\n }\ndiff --git a/fs/configfs/mount.c b/fs/configfs/mount.c\nindex d8cac1cbf3bd57..60ba24e7ae2b96 100644\n--- a/fs/configfs/mount.c\n+++ b/fs/configfs/mount.c\n@@ -13,6 +13,7 @@\n #include \u003clinux/module.h\u003e\n #include \u003clinux/mount.h\u003e\n #include \u003clinux/fs_context.h\u003e\n+#include \u003clinux/pseudo_fs.h\u003e\n #include \u003clinux/pagemap.h\u003e\n #include \u003clinux/init.h\u003e\n #include \u003clinux/slab.h\u003e\n@@ -106,6 +107,7 @@ static const struct fs_context_operations configfs_context_ops = {\n \n static int configfs_init_fs_context(struct fs_context *fc)\n {\n+\tfc_init_pseudo(fc);\n \tfc-\u003eops = \u0026configfs_context_ops;\n \treturn 0;\n }\ndiff --git a/fs/debugfs/inode.c b/fs/debugfs/inode.c\nindex b4915551ad315a..f163f0bc5703a3 100644\n--- a/fs/debugfs/inode.c\n+++ b/fs/debugfs/inode.c\n@@ -15,6 +15,7 @@\n #include \u003clinux/module.h\u003e\n #include \u003clinux/fs.h\u003e\n #include \u003clinux/fs_context.h\u003e\n+#include \u003clinux/pseudo_fs.h\u003e\n #include \u003clinux/fs_parser.h\u003e\n #include \u003clinux/pagemap.h\u003e\n #include \u003clinux/init.h\u003e\n@@ -317,6 +318,7 @@ static int debugfs_init_fs_context(struct fs_context *fc)\n \tfsi-\u003emode = DEBUGFS_DEFAULT_MODE;\n \n \tfc-\u003es_fs_info = fsi;\n+\tfc_init_pseudo(fc);\n \tfc-\u003eops = \u0026debugfs_context_ops;\n \treturn 0;\n }\ndiff --git a/fs/devpts/inode.c b/fs/devpts/inode.c\nindex bd1e8eb26edb70..47ef12241d92d7 100644\n--- a/fs/devpts/inode.c\n+++ b/fs/devpts/inode.c\n@@ -13,6 +13,7 @@\n #include \u003clinux/init.h\u003e\n #include \u003clinux/fs.h\u003e\n #include \u003clinux/fs_context.h\u003e\n+#include \u003clinux/pseudo_fs.h\u003e\n #include \u003clinux/fs_parser.h\u003e\n #include \u003clinux/sched.h\u003e\n #include \u003clinux/namei.h\u003e\n@@ -438,6 +439,7 @@ static int devpts_init_fs_context(struct fs_context *fc)\n \t\tfsi-\u003emount_opts.reserve = true;\n \n \tfc-\u003es_fs_info = fsi;\n+\tfc_init_pseudo(fc);\n \tfc-\u003eops = \u0026devpts_context_ops;\n \treturn 0;\n }\ndiff --git a/fs/efivarfs/super.c b/fs/efivarfs/super.c\nindex 12746ced6dc639..e598d42c5f42c4 100644\n--- a/fs/efivarfs/super.c\n+++ b/fs/efivarfs/super.c\n@@ -8,6 +8,7 @@\n #include \u003clinux/efi.h\u003e\n #include \u003clinux/fs.h\u003e\n #include \u003clinux/fs_context.h\u003e\n+#include \u003clinux/pseudo_fs.h\u003e\n #include \u003clinux/fs_parser.h\u003e\n #include \u003clinux/module.h\u003e\n #include \u003clinux/pagemap.h\u003e\n@@ -554,6 +555,7 @@ static int efivarfs_init_fs_context(struct fs_context *fc)\n \t}\n \n \tfc-\u003es_fs_info = sfi;\n+\tfc_init_pseudo(fc);\n \tfc-\u003eops = \u0026efivarfs_context_ops;\n \n \treturn 0;\ndiff --git a/fs/erofs/super.c b/fs/erofs/super.c\nindex ce05557bd99836..980d5fc2b57619 100644\n--- a/fs/erofs/super.c\n+++ b/fs/erofs/super.c\n@@ -158,7 +158,8 @@ static int erofs_init_device(struct erofs_buf *buf, struct super_block *sb,\n \t\tif (!erofs_is_fileio_mode(sbi)) {\n \t\t\tdif-\u003edax_dev = fs_dax_get_by_bdev(file_bdev(file),\n \t\t\t\t\t\u0026dif-\u003edax_part_off, NULL, NULL);\n-\t\t} else if (!S_ISREG(file_inode(file)-\u003ei_mode)) {\n+\t\t} else if (!S_ISREG(file_inode(file)-\u003ei_mode) ||\n+\t\t\t   file_is_pseudo(file)) {\n \t\t\tfput(file);\n \t\t\treturn -EINVAL;\n \t\t}\n@@ -835,6 +836,9 @@ static int erofs_file_get_tree(struct fs_context *fc)\n {\n \tstruct erofs_sb_info *sbi = fc-\u003es_fs_info;\n \n+\tif (file_is_pseudo(sbi-\u003edif0.file))\n+\t\treturn invalfc(fc, \"source is on a pseudo filesystem\");\n+\n \tif (!test_opt(\u0026sbi-\u003eopt, SUPERBLOCK_SHARE))\n \t\treturn get_tree_nodev(fc, erofs_fc_fill_super);\n \ndiff --git a/fs/failfs.c b/fs/failfs.c\nindex 437cdc981c2ded..f03334f361c0ed 100644\n--- a/fs/failfs.c\n+++ b/fs/failfs.c\n@@ -3,6 +3,7 @@\n #include \u003clinux/fs.h\u003e\n #include \u003clinux/fs/super_types.h\u003e\n #include \u003clinux/fs_context.h\u003e\n+#include \u003clinux/pseudo_fs.h\u003e\n #include \u003clinux/fs_struct.h\u003e\n #include \u003clinux/magic.h\u003e\n #include \u003clinux/mount.h\u003e\n@@ -132,7 +133,7 @@ static int failfs_init_fs_context(struct fs_context *fc)\n \tfc-\u003eops\t\t= \u0026failfs_context_ops;\n \tfc-\u003eglobal\t= true;\n \tfc-\u003esb_flags\t|= SB_NOUSER;\n-\tfc-\u003es_iflags\t|= SB_I_NOEXEC | SB_I_NODEV;\n+\tfc_init_pseudo(fc);\n \treturn 0;\n }\n \ndiff --git a/fs/fuse/backing.c b/fs/fuse/backing.c\nindex 8c21a8a74efb9c..4e4fb810ddaa88 100644\n--- a/fs/fuse/backing.c\n+++ b/fs/fuse/backing.c\n@@ -147,6 +147,9 @@ static int fuse_backing_open_file(struct fuse_conn *fc, struct fuse_backing *fb,\n \t\tif (inode-\u003ei_sb-\u003es_stack_depth \u003e= fc-\u003emax_stack_depth)\n \t\t\treturn -ELOOP;\n \n+\t\tif (file_is_pseudo(file))\n+\t\t\treturn -EINVAL;\n+\n \t\tfb-\u003etype = FUSE_BACKING_PATH;\n \t\tfb-\u003epath = file-\u003ef_path;\n \t\tpath_get(\u0026fb-\u003epath);\ndiff --git a/fs/fuse/control.c b/fs/fuse/control.c\nindex 21ffde596d6116..4497362e7df069 100644\n--- a/fs/fuse/control.c\n+++ b/fs/fuse/control.c\n@@ -10,6 +10,7 @@\n #include \u003clinux/init.h\u003e\n #include \u003clinux/module.h\u003e\n #include \u003clinux/fs_context.h\u003e\n+#include \u003clinux/pseudo_fs.h\u003e\n #include \u003clinux/namei.h\u003e\n \n #define FUSE_CTL_SUPER_MAGIC 0x65735543\n@@ -334,6 +335,7 @@ static const struct fs_context_operations fuse_ctl_context_ops = {\n \n static int fuse_ctl_init_fs_context(struct fs_context *fsc)\n {\n+\tfc_init_pseudo(fsc);\n \tfsc-\u003eops = \u0026fuse_ctl_context_ops;\n \treturn 0;\n }\ndiff --git a/fs/kernfs/mount.c b/fs/kernfs/mount.c\nindex a0be784bfb0646..6b60d212b003d6 100644\n--- a/fs/kernfs/mount.c\n+++ b/fs/kernfs/mount.c\n@@ -8,6 +8,7 @@\n  */\n \n #include \u003clinux/fs.h\u003e\n+#include \u003clinux/pseudo_fs.h\u003e\n #include \u003clinux/mount.h\u003e\n #include \u003clinux/init.h\u003e\n #include \u003clinux/magic.h\u003e\n@@ -298,8 +299,6 @@ static int kernfs_fill_super(struct super_block *sb, struct kernfs_fs_context *k\n \tstruct dentry *root;\n \n \tinfo-\u003esb = sb;\n-\t/* Userspace would break if executables or devices appear on sysfs */\n-\tsb-\u003es_iflags |= SB_I_NOEXEC | SB_I_NODEV;\n \tsb-\u003es_blocksize = PAGE_SIZE;\n \tsb-\u003es_blocksize_bits = PAGE_SHIFT;\n \tsb-\u003es_magic = kfc-\u003emagic;\n@@ -388,6 +387,7 @@ int kernfs_get_tree(struct fs_context *fc)\n \tinfo-\u003ens = kfc-\u003ens_tag;\n \tINIT_LIST_HEAD(\u0026info-\u003enode);\n \n+\tfc_init_pseudo(fc);\n \tfc-\u003es_fs_info = info;\n \tsb = sget_fc(fc, kernfs_test_super, kernfs_set_super);\n \tif (IS_ERR(sb))\ndiff --git a/fs/libfs.c b/fs/libfs.c\nindex 96a6e9b1535fb7..8c8789489fdf96 100644\n--- a/fs/libfs.c\n+++ b/fs/libfs.c\n@@ -735,7 +735,7 @@ struct pseudo_fs_context *init_pseudo(struct fs_context *fc,\n \t\tfc-\u003efs_private = ctx;\n \t\tfc-\u003eops = \u0026pseudo_fs_context_ops;\n \t\tfc-\u003esb_flags |= SB_NOUSER;\n-\t\tfc-\u003es_iflags |= SB_I_NOEXEC | SB_I_NODEV;\n+\t\tfc_init_pseudo(fc);\n \t\tfc-\u003eglobal = true;\n \t}\n \treturn ctx;\ndiff --git a/fs/nfsd/nfsctl.c b/fs/nfsd/nfsctl.c\nindex f32311f2d7cf96..ce2666deddbd94 100644\n--- a/fs/nfsd/nfsctl.c\n+++ b/fs/nfsd/nfsctl.c\n@@ -9,6 +9,7 @@\n #include \u003clinux/namei.h\u003e\n #include \u003clinux/ctype.h\u003e\n #include \u003clinux/fs_context.h\u003e\n+#include \u003clinux/pseudo_fs.h\u003e\n \n #include \u003clinux/sunrpc/cache.h\u003e\n #include \u003clinux/sunrpc/svcsock.h\u003e\n@@ -1375,6 +1376,7 @@ static int nfsd_init_fs_context(struct fs_context *fc)\n {\n \tput_user_ns(fc-\u003euser_ns);\n \tfc-\u003euser_ns = get_user_ns(fc-\u003enet_ns-\u003euser_ns);\n+\tfc_init_pseudo(fc);\n \tfc-\u003eops = \u0026nfsd_fs_context_ops;\n \treturn 0;\n }\ndiff --git a/fs/nullfs.c b/fs/nullfs.c\nindex 319c2f5c5a6714..2fe24cb97160ec 100644\n--- a/fs/nullfs.c\n+++ b/fs/nullfs.c\n@@ -2,6 +2,7 @@\n /* Copyright (c) 2026 Christian Brauner \u003cbrauner@kernel.org\u003e */\n #include \u003clinux/fs/super_types.h\u003e\n #include \u003clinux/fs_context.h\u003e\n+#include \u003clinux/pseudo_fs.h\u003e\n #include \u003clinux/magic.h\u003e\n #include \u003clinux/splice.h\u003e\n #include \u003clinux/uio.h\u003e\n@@ -174,7 +175,7 @@ static int nullfs_init_fs_context(struct fs_context *fc)\n {\n \tfc-\u003eops\t\t= \u0026nullfs_fs_context_ops;\n \tfc-\u003esb_flags\t|= SB_NOUSER;\n-\tfc-\u003es_iflags\t|= SB_I_NOEXEC | SB_I_NODEV;\n+\tfc_init_pseudo(fc);\n \treturn 0;\n }\n \ndiff --git a/fs/ocfs2/dlmfs/dlmfs.c b/fs/ocfs2/dlmfs/dlmfs.c\nindex d3bfcada3e3bf5..1789ec96dc130f 100644\n--- a/fs/ocfs2/dlmfs/dlmfs.c\n+++ b/fs/ocfs2/dlmfs/dlmfs.c\n@@ -21,6 +21,7 @@\n #include \u003clinux/module.h\u003e\n #include \u003clinux/fs.h\u003e\n #include \u003clinux/fs_context.h\u003e\n+#include \u003clinux/pseudo_fs.h\u003e\n #include \u003clinux/pagemap.h\u003e\n #include \u003clinux/types.h\u003e\n #include \u003clinux/slab.h\u003e\n@@ -563,6 +564,7 @@ static const struct fs_context_operations dlmfs_context_ops = {\n \n static int dlmfs_init_fs_context(struct fs_context *fc)\n {\n+\tfc_init_pseudo(fc);\n \tfc-\u003eops = \u0026dlmfs_context_ops;\n \n \treturn 0;\ndiff --git a/fs/openpromfs/inode.c b/fs/openpromfs/inode.c\nindex fb8d84bdedfb20..6cd02d456bac95 100644\n--- a/fs/openpromfs/inode.c\n+++ b/fs/openpromfs/inode.c\n@@ -10,6 +10,7 @@\n #include \u003clinux/string.h\u003e\n #include \u003clinux/fs.h\u003e\n #include \u003clinux/fs_context.h\u003e\n+#include \u003clinux/pseudo_fs.h\u003e\n #include \u003clinux/init.h\u003e\n #include \u003clinux/slab.h\u003e\n #include \u003clinux/seq_file.h\u003e\n@@ -419,6 +420,7 @@ static const struct fs_context_operations openpromfs_context_ops = {\n \n static int openpromfs_init_fs_context(struct fs_context *fc)\n {\n+\tfc_init_pseudo(fc);\n \tfc-\u003eops = \u0026openpromfs_context_ops;\n \treturn 0;\n }\ndiff --git a/fs/proc/root.c b/fs/proc/root.c\nindex 7fbbe92bf73a71..ca0e75081934fc 100644\n--- a/fs/proc/root.c\n+++ b/fs/proc/root.c\n@@ -17,6 +17,7 @@\n #include \u003clinux/bitops.h\u003e\n #include \u003clinux/user_namespace.h\u003e\n #include \u003clinux/fs_context.h\u003e\n+#include \u003clinux/pseudo_fs.h\u003e\n #include \u003clinux/mount.h\u003e\n #include \u003clinux/pid_namespace.h\u003e\n #include \u003clinux/fs_parser.h\u003e\n@@ -265,8 +266,6 @@ static int proc_fill_super(struct super_block *s, struct fs_context *fc)\n \tif (ret)\n \t\treturn ret;\n \n-\t/* User space would break if executables or devices appear on proc */\n-\ts-\u003es_iflags |= SB_I_NOEXEC | SB_I_NODEV;\n \ts-\u003es_flags |= SB_NODIRATIME | SB_NOSUID | SB_NOEXEC;\n \ts-\u003es_blocksize = 1024;\n \ts-\u003es_blocksize_bits = 10;\n@@ -350,6 +349,7 @@ static int proc_init_fs_context(struct fs_context *fc)\n \tput_user_ns(fc-\u003euser_ns);\n \tfc-\u003euser_ns = get_user_ns(ctx-\u003epid_ns-\u003euser_ns);\n \tfc-\u003efs_private = ctx;\n+\tfc_init_pseudo(fc);\n \tfc-\u003eops = \u0026proc_fs_context_ops;\n \treturn 0;\n }\ndiff --git a/fs/pstore/inode.c b/fs/pstore/inode.c\nindex cf499ba727026e..4658561cf90b7d 100644\n--- a/fs/pstore/inode.c\n+++ b/fs/pstore/inode.c\n@@ -18,6 +18,7 @@\n #include \u003clinux/ramfs.h\u003e\n #include \u003clinux/fs_parser.h\u003e\n #include \u003clinux/fs_context.h\u003e\n+#include \u003clinux/pseudo_fs.h\u003e\n #include \u003clinux/sched.h\u003e\n #include \u003clinux/magic.h\u003e\n #include \u003clinux/pstore.h\u003e\n@@ -491,6 +492,7 @@ static int pstore_init_fs_context(struct fs_context *fc)\n \tctx-\u003ekmsg_bytes = kmsg_bytes;\n \n \tfc-\u003efs_private = ctx;\n+\tfc_init_pseudo(fc);\n \tfc-\u003eops = \u0026pstore_context_ops;\n \n \treturn 0;\ndiff --git a/fs/tracefs/inode.c b/fs/tracefs/inode.c\nindex 5020365ca70487..e04febd868eb41 100644\n--- a/fs/tracefs/inode.c\n+++ b/fs/tracefs/inode.c\n@@ -12,6 +12,7 @@\n #include \u003clinux/module.h\u003e\n #include \u003clinux/fs.h\u003e\n #include \u003clinux/fs_context.h\u003e\n+#include \u003clinux/pseudo_fs.h\u003e\n #include \u003clinux/fs_parser.h\u003e\n #include \u003clinux/kobject.h\u003e\n #include \u003clinux/namei.h\u003e\n@@ -510,6 +511,7 @@ static int tracefs_init_fs_context(struct fs_context *fc)\n \tfsi-\u003emode = TRACEFS_DEFAULT_MODE;\n \n \tfc-\u003es_fs_info = fsi;\n+\tfc_init_pseudo(fc);\n \tfc-\u003eops = \u0026tracefs_context_ops;\n \treturn 0;\n }\ndiff --git a/include/linux/fs.h b/include/linux/fs.h\nindex 99caef43ff3c47..407ffb6342ec6c 100644\n--- a/include/linux/fs.h\n+++ b/include/linux/fs.h\n@@ -2553,6 +2553,18 @@ static inline const struct inode *file_user_inode(const struct file *f)\n \treturn file_inode(f);\n }\n \n+/*\n+ * Regular files on pseudo filesystems are kernel interfaces and must not be\n+ * used as storage. Look through stacking filesystems at the inode that\n+ * provides the data.\n+ */\n+static inline bool file_is_pseudo(const struct file *file)\n+{\n+\tconst struct inode *inode = d_real_inode(file-\u003ef_path.dentry);\n+\n+\treturn S_ISREG(inode-\u003ei_mode) \u0026\u0026 (inode-\u003ei_sb-\u003es_iflags \u0026 SB_I_PSEUDO);\n+}\n+\n static inline struct file *file_clone_open(struct file *file)\n {\n \treturn dentry_open(\u0026file-\u003ef_path, file-\u003ef_flags, file-\u003ef_cred);\ndiff --git a/include/linux/fs/super_types.h b/include/linux/fs/super_types.h\nindex 72f4288e16c526..472200bdf081a4 100644\n--- a/include/linux/fs/super_types.h\n+++ b/include/linux/fs/super_types.h\n@@ -359,5 +359,6 @@ struct super_block {\n #define SB_I_NOIDMAP\t0x00002000\t/* No idmapped mounts on this superblock */\n #define SB_I_ALLOW_HSM\t0x00004000\t/* Allow HSM events on this superblock */\n #define SB_I_NO_DATA_INTEGRITY\t0x00008000 /* fs cannot guarantee data persistence on sync */\n+#define SB_I_PSEUDO\t0x00010000\t/* regular files are kernel interfaces, not storage */\n \n #endif /* _LINUX_FS_SUPER_TYPES_H */\ndiff --git a/include/linux/pseudo_fs.h b/include/linux/pseudo_fs.h\nindex a651e60d94107e..0ca408aa60aff4 100644\n--- a/include/linux/pseudo_fs.h\n+++ b/include/linux/pseudo_fs.h\n@@ -2,6 +2,7 @@\n #define __LINUX_PSEUDO_FS__\n \n #include \u003clinux/fs_context.h\u003e\n+#include \u003clinux/fs/super_types.h\u003e\n \n struct pseudo_fs_context {\n \tconst struct super_operations *ops;\n@@ -15,4 +16,14 @@ struct pseudo_fs_context {\n struct pseudo_fs_context *init_pseudo(struct fs_context *fc,\n \t\t\t\t      unsigned long magic);\n \n+/*\n+ * Common initialization for all pseudo filesystems, mountable or not. Their\n+ * regular files are kernel interfaces. They don't store data and pseudo\n+ * filesystems never hold executables or device nodes.\n+ */\n+static inline void fc_init_pseudo(struct fs_context *fc)\n+{\n+\tfc-\u003es_iflags |= SB_I_PSEUDO | SB_I_NOEXEC | SB_I_NODEV;\n+}\n+\n #endif\ndiff --git a/ipc/mqueue.c b/ipc/mqueue.c\nindex 322c3dd98c4477..8bbe32d0881f23 100644\n--- a/ipc/mqueue.c\n+++ b/ipc/mqueue.c\n@@ -18,6 +18,7 @@\n #include \u003clinux/file.h\u003e\n #include \u003clinux/mount.h\u003e\n #include \u003clinux/fs_context.h\u003e\n+#include \u003clinux/pseudo_fs.h\u003e\n #include \u003clinux/namei.h\u003e\n #include \u003clinux/sysctl.h\u003e\n #include \u003clinux/poll.h\u003e\n@@ -405,7 +406,6 @@ static int mqueue_fill_super(struct super_block *sb, struct fs_context *fc)\n \tstruct inode *inode;\n \tstruct ipc_namespace *ns = sb-\u003es_fs_info;\n \n-\tsb-\u003es_iflags |= SB_I_NOEXEC | SB_I_NODEV;\n \tsb-\u003es_blocksize = PAGE_SIZE;\n \tsb-\u003es_blocksize_bits = PAGE_SHIFT;\n \tsb-\u003es_magic = MQUEUE_MAGIC;\n@@ -457,6 +457,7 @@ static int mqueue_init_fs_context(struct fs_context *fc)\n \tput_user_ns(fc-\u003euser_ns);\n \tfc-\u003euser_ns = get_user_ns(ctx-\u003eipc_ns-\u003euser_ns);\n \tfc-\u003efs_private = ctx;\n+\tfc_init_pseudo(fc);\n \tfc-\u003eops = \u0026mqueue_fs_context_ops;\n \treturn 0;\n }\ndiff --git a/kernel/bpf/inode.c b/kernel/bpf/inode.c\nindex c6f328e4752e1d..57cf3775c07669 100644\n--- a/kernel/bpf/inode.c\n+++ b/kernel/bpf/inode.c\n@@ -15,6 +15,7 @@\n #include \u003clinux/namei.h\u003e\n #include \u003clinux/fs.h\u003e\n #include \u003clinux/fs_context.h\u003e\n+#include \u003clinux/pseudo_fs.h\u003e\n #include \u003clinux/fs_parser.h\u003e\n #include \u003clinux/kdev_t.h\u003e\n #include \u003clinux/filter.h\u003e\n@@ -1197,8 +1198,6 @@ static int bpf_fill_super(struct super_block *sb, struct fs_context *fc)\n \tsb-\u003es_magic = BPF_FS_MAGIC;\n \tsb-\u003es_op = \u0026bpf_super_ops;\n \tsb-\u003es_xattr = bpf_fs_xattr_handlers;\n-\tsb-\u003es_iflags |= SB_I_NOEXEC;\n-\tsb-\u003es_iflags |= SB_I_NODEV;\n \tsb-\u003es_time_gran = 1;\n \n \tinode = bpf_get_inode(sb, NULL, S_IFDIR | 0777);\n@@ -1261,6 +1260,7 @@ static int bpf_init_fs_context(struct fs_context *fc)\n \topts-\u003edelegate_attachs = 0;\n \n \tfc-\u003es_fs_info = opts;\n+\tfc_init_pseudo(fc);\n \tfc-\u003eops = \u0026bpf_context_ops;\n \treturn 0;\n }\ndiff --git a/net/sunrpc/rpc_pipe.c b/net/sunrpc/rpc_pipe.c\nindex 9d349cfbc48312..37277a6d241562 100644\n--- a/net/sunrpc/rpc_pipe.c\n+++ b/net/sunrpc/rpc_pipe.c\n@@ -15,6 +15,7 @@\n #include \u003clinux/pagemap.h\u003e\n #include \u003clinux/mount.h\u003e\n #include \u003clinux/fs_context.h\u003e\n+#include \u003clinux/pseudo_fs.h\u003e\n #include \u003clinux/namei.h\u003e\n #include \u003clinux/fsnotify.h\u003e\n #include \u003clinux/kernel.h\u003e\n@@ -1181,6 +1182,7 @@ static int rpc_init_fs_context(struct fs_context *fc)\n {\n \tput_user_ns(fc-\u003euser_ns);\n \tfc-\u003euser_ns = get_user_ns(fc-\u003enet_ns-\u003euser_ns);\n+\tfc_init_pseudo(fc);\n \tfc-\u003eops = \u0026rpc_fs_context_ops;\n \treturn 0;\n }\ndiff --git a/security/apparmor/apparmorfs.c b/security/apparmor/apparmorfs.c\nindex a9936646721733..351ea3a7120e39 100644\n--- a/security/apparmor/apparmorfs.c\n+++ b/security/apparmor/apparmorfs.c\n@@ -21,6 +21,7 @@\n #include \u003clinux/rcupdate.h\u003e\n #include \u003clinux/fs.h\u003e\n #include \u003clinux/fs_context.h\u003e\n+#include \u003clinux/pseudo_fs.h\u003e\n #include \u003clinux/poll.h\u003e\n #include \u003clinux/zstd.h\u003e\n #include \u003clinux/string.h\u003e\n@@ -263,6 +264,7 @@ static const struct fs_context_operations apparmorfs_context_ops = {\n \n static int apparmorfs_init_fs_context(struct fs_context *fc)\n {\n+\tfc_init_pseudo(fc);\n \tfc-\u003eops = \u0026apparmorfs_context_ops;\n \treturn 0;\n }\ndiff --git a/security/inode.c b/security/inode.c\nindex 08040236767418..93997a9f16fcb3 100644\n--- a/security/inode.c\n+++ b/security/inode.c\n@@ -14,6 +14,7 @@\n #include \u003clinux/kobject.h\u003e\n #include \u003clinux/fs.h\u003e\n #include \u003clinux/fs_context.h\u003e\n+#include \u003clinux/pseudo_fs.h\u003e\n #include \u003clinux/mount.h\u003e\n #include \u003clinux/pagemap.h\u003e\n #include \u003clinux/init.h\u003e\n@@ -64,6 +65,7 @@ static const struct fs_context_operations securityfs_context_ops = {\n \n static int securityfs_init_fs_context(struct fs_context *fc)\n {\n+\tfc_init_pseudo(fc);\n \tfc-\u003eops = \u0026securityfs_context_ops;\n \treturn 0;\n }\ndiff --git a/security/selinux/selinuxfs.c b/security/selinux/selinuxfs.c\nindex 310e19efff1d0c..d7ae853b6d6854 100644\n--- a/security/selinux/selinuxfs.c\n+++ b/security/selinux/selinuxfs.c\n@@ -18,6 +18,7 @@\n #include \u003clinux/vmalloc.h\u003e\n #include \u003clinux/fs.h\u003e\n #include \u003clinux/fs_context.h\u003e\n+#include \u003clinux/pseudo_fs.h\u003e\n #include \u003clinux/hex.h\u003e\n #include \u003clinux/mount.h\u003e\n #include \u003clinux/mutex.h\u003e\n@@ -1852,6 +1853,9 @@ static int sel_fill_super(struct super_block *sb, struct fs_context *fc)\n \t\t/* last one */ {\"\", NULL, 0}\n \t};\n \n+\t/* Android init opens the null device below by path. */\n+\tsb-\u003es_iflags \u0026= ~SB_I_NODEV;\n+\n \tret = selinux_fs_info_create(sb);\n \tif (ret)\n \t\tgoto err;\n@@ -1955,6 +1959,7 @@ static const struct fs_context_operations sel_context_ops = {\n \n static int sel_init_fs_context(struct fs_context *fc)\n {\n+\tfc_init_pseudo(fc);\n \tfc-\u003eops = \u0026sel_context_ops;\n \treturn 0;\n }\ndiff --git a/security/smack/smackfs.c b/security/smack/smackfs.c\nindex a72bc7fabea998..4a56bbeaeca370 100644\n--- a/security/smack/smackfs.c\n+++ b/security/smack/smackfs.c\n@@ -25,6 +25,7 @@\n #include \u003clinux/magic.h\u003e\n #include \u003clinux/mount.h\u003e\n #include \u003clinux/fs_context.h\u003e\n+#include \u003clinux/pseudo_fs.h\u003e\n #include \"smack.h\"\n \n #define BEBITS\t(sizeof(__be32) * 8)\n@@ -2880,6 +2881,7 @@ static const struct fs_context_operations smk_context_ops = {\n  */\n static int smk_init_fs_context(struct fs_context *fc)\n {\n+\tfc_init_pseudo(fc);\n \tfc-\u003eops = \u0026smk_context_ops;\n \treturn 0;\n }\ndiff --git a/tools/testing/selftests/filesystems/.gitignore b/tools/testing/selftests/filesystems/.gitignore\nindex cf79000e4092a1..8df38eabb1252d 100644\n--- a/tools/testing/selftests/filesystems/.gitignore\n+++ b/tools/testing/selftests/filesystems/.gitignore\n@@ -7,3 +7,4 @@ kernfs_test\n idmapped_tmpfile\n ustat_test\n rw_hint_test\n+pseudo_backing_test\ndiff --git a/tools/testing/selftests/filesystems/Makefile b/tools/testing/selftests/filesystems/Makefile\nindex fbd5c27505ef58..0ebb9005bcd289 100644\n--- a/tools/testing/selftests/filesystems/Makefile\n+++ b/tools/testing/selftests/filesystems/Makefile\n@@ -2,7 +2,7 @@\n \n CFLAGS += $(KHDR_INCLUDES)\n TEST_GEN_PROGS := devpts_pts anon_inode_test kernfs_test fclog ustat_test rw_hint_test\n-TEST_GEN_PROGS += idmapped_tmpfile\n+TEST_GEN_PROGS += idmapped_tmpfile pseudo_backing_test\n TEST_GEN_PROGS_EXTENDED := dnotify_test\n \n include ../lib.mk\ndiff --git a/tools/testing/selftests/filesystems/config b/tools/testing/selftests/filesystems/config\nindex 9f45bc493a30a8..228196160d29f8 100644\n--- a/tools/testing/selftests/filesystems/config\n+++ b/tools/testing/selftests/filesystems/config\n@@ -6,3 +6,12 @@ CONFIG_NET=y\n CONFIG_NET_NS=y\n CONFIG_INET=y\n CONFIG_SYSFS=y\n+CONFIG_BLK_DEV_LOOP=y\n+CONFIG_OVERLAY_FS=y\n+CONFIG_TMPFS=y\n+CONFIG_CONFIGFS_FS=y\n+CONFIG_USB_GADGET=y\n+CONFIG_USB_CONFIGFS=y\n+CONFIG_USB_CONFIGFS_MASS_STORAGE=y\n+CONFIG_EROFS_FS=y\n+CONFIG_EROFS_FS_BACKED_BY_FILE=y\ndiff --git a/tools/testing/selftests/filesystems/pseudo_backing_test.c b/tools/testing/selftests/filesystems/pseudo_backing_test.c\nnew file mode 100644\nindex 00000000000000..bc8e17ab8e6ea3\n--- /dev/null\n+++ b/tools/testing/selftests/filesystems/pseudo_backing_test.c\n@@ -0,0 +1,274 @@\n+// SPDX-License-Identifier: GPL-2.0\n+#define _GNU_SOURCE\n+\n+#include \u003cerrno.h\u003e\n+#include \u003cfcntl.h\u003e\n+#include \u003climits.h\u003e\n+#include \u003csched.h\u003e\n+#include \u003cstdbool.h\u003e\n+#include \u003cstdio.h\u003e\n+#include \u003cstdlib.h\u003e\n+#include \u003cstring.h\u003e\n+#include \u003cunistd.h\u003e\n+#include \u003clinux/loop.h\u003e\n+#include \u003clinux/magic.h\u003e\n+#include \u003csys/ioctl.h\u003e\n+#include \u003csys/mman.h\u003e\n+#include \u003csys/mount.h\u003e\n+#include \u003csys/stat.h\u003e\n+#include \u003csys/vfs.h\u003e\n+\n+#include \"kselftest_harness.h\"\n+#include \"wrappers.h\"\n+\n+/*\n+ * Put @fd behind a free loop device. The device is set up with\n+ * LO_FLAGS_AUTOCLEAR and goes away again when it is closed here.\n+ */\n+static int loop_attach(int fd, bool rw, char *dev, size_t len)\n+{\n+\tstruct loop_config cfg = {};\n+\tint ctl, nr, lfd, ret = 0;\n+\n+\tctl = open(\"/dev/loop-control\", O_RDWR | O_CLOEXEC);\n+\tif (ctl \u003c 0)\n+\t\treturn -errno;\n+\tnr = ioctl(ctl, LOOP_CTL_GET_FREE);\n+\tif (nr \u003c 0)\n+\t\tret = -errno;\n+\tclose(ctl);\n+\tif (ret)\n+\t\treturn ret;\n+\n+\tsnprintf(dev, len, \"/dev/loop%d\", nr);\n+\tlfd = open(dev, (rw ? O_RDWR : O_RDONLY) | O_CLOEXEC);\n+\tif (lfd \u003c 0)\n+\t\treturn -errno;\n+\n+\tcfg.fd = fd;\n+\tcfg.info.lo_flags = LO_FLAGS_AUTOCLEAR;\n+\tif (!rw)\n+\t\tcfg.info.lo_flags |= LO_FLAGS_READ_ONLY;\n+\tif (ioctl(lfd, LOOP_CONFIGURE, \u0026cfg)) {\n+\t\tret = -errno;\n+\t\tclose(lfd);\n+\t} else {\n+\t\tret = lfd;\n+\t}\n+\treturn ret;\n+}\n+\n+static int attach_path(const char *path, bool rw)\n+{\n+\tchar dev[PATH_MAX];\n+\tint fd, ret;\n+\n+\tfd = open(path, (rw ? O_RDWR : O_RDONLY) | O_CLOEXEC);\n+\tif (fd \u003c 0)\n+\t\treturn -errno;\n+\tret = loop_attach(fd, rw, dev, sizeof(dev));\n+\tclose(fd);\n+\tif (ret \u003e= 0) {\n+\t\tclose(ret);\n+\t\tret = 0;\n+\t}\n+\treturn ret;\n+}\n+\n+static bool can_use_loop(void)\n+{\n+\treturn geteuid() == 0 \u0026\u0026 access(\"/dev/loop-control\", R_OK | W_OK) == 0;\n+}\n+\n+TEST(memfd_backing_file)\n+{\n+\tchar dev[PATH_MAX];\n+\tint fd, lfd;\n+\n+\tif (!can_use_loop())\n+\t\tSKIP(return, \"loop devices unavailable\");\n+\n+\tfd = memfd_create(\"pseudo_backing_test\", MFD_CLOEXEC);\n+\tASSERT_GE(fd, 0);\n+\tASSERT_EQ(ftruncate(fd, 1 \u003c\u003c 20), 0);\n+\n+\tlfd = loop_attach(fd, true, dev, sizeof(dev));\n+\tASSERT_GE(lfd, 0);\n+\tEXPECT_EQ(close(lfd), 0);\n+\tEXPECT_EQ(close(fd), 0);\n+}\n+\n+TEST(loop_device_backing_file)\n+{\n+\tchar dev[PATH_MAX], dev2[PATH_MAX];\n+\tint fd, lfd, bfd, lfd2;\n+\n+\tif (!can_use_loop())\n+\t\tSKIP(return, \"loop devices unavailable\");\n+\n+\tfd = memfd_create(\"pseudo_backing_test\", MFD_CLOEXEC);\n+\tASSERT_GE(fd, 0);\n+\tASSERT_EQ(ftruncate(fd, 1 \u003c\u003c 20), 0);\n+\tlfd = loop_attach(fd, true, dev, sizeof(dev));\n+\tASSERT_GE(lfd, 0);\n+\n+\t/* A block device stays fine as a backing file. */\n+\tbfd = open(dev, O_RDWR | O_CLOEXEC);\n+\tASSERT_GE(bfd, 0);\n+\tlfd2 = loop_attach(bfd, true, dev2, sizeof(dev2));\n+\tASSERT_GE(lfd2, 0);\n+\n+\tEXPECT_EQ(close(lfd2), 0);\n+\tEXPECT_EQ(close(bfd), 0);\n+\tEXPECT_EQ(close(lfd), 0);\n+\tEXPECT_EQ(close(fd), 0);\n+}\n+\n+TEST(write_only_backing_file)\n+{\n+\tchar dev[PATH_MAX], path[PATH_MAX];\n+\tint fd, wfd, lfd;\n+\n+\tif (!can_use_loop())\n+\t\tSKIP(return, \"loop devices unavailable\");\n+\n+\tfd = memfd_create(\"pseudo_backing_test\", MFD_CLOEXEC);\n+\tASSERT_GE(fd, 0);\n+\tASSERT_EQ(ftruncate(fd, 1 \u003c\u003c 20), 0);\n+\n+\t/* Loop reads from its backing file so it must be open for reading. */\n+\tsnprintf(path, sizeof(path), \"/proc/self/fd/%d\", fd);\n+\twfd = open(path, O_WRONLY | O_CLOEXEC);\n+\tASSERT_GE(wfd, 0);\n+\n+\tlfd = loop_attach(wfd, true, dev, sizeof(dev));\n+\tif (lfd \u003e= 0)\n+\t\tclose(lfd);\n+\tEXPECT_EQ(lfd, -EBADF);\n+\tEXPECT_EQ(close(wfd), 0);\n+\tEXPECT_EQ(close(fd), 0);\n+}\n+\n+TEST(procfs_backing_file)\n+{\n+\tif (!can_use_loop())\n+\t\tSKIP(return, \"loop devices unavailable\");\n+\n+\tASSERT_EQ(attach_path(\"/proc/cpuinfo\", false), -EINVAL);\n+}\n+\n+TEST(sysfs_backing_file)\n+{\n+\tif (!can_use_loop())\n+\t\tSKIP(return, \"loop devices unavailable\");\n+\n+\tASSERT_EQ(attach_path(\"/sys/kernel/warn_count\", false), -EINVAL);\n+\n+\tif (access(\"/sys/kernel/reboot/mode\", F_OK))\n+\t\tSKIP(return, \"no /sys/kernel/reboot/mode\");\n+\tASSERT_EQ(attach_path(\"/sys/kernel/reboot/mode\", true), -EINVAL);\n+}\n+\n+TEST(overlayfs_on_sysfs_backing_file)\n+{\n+\tif (!can_use_loop())\n+\t\tSKIP(return, \"loop devices unavailable\");\n+\n+\tASSERT_EQ(unshare(CLONE_NEWNS), 0);\n+\tASSERT_EQ(mount(NULL, \"/\", NULL, MS_REC | MS_PRIVATE, NULL), 0);\n+\tASSERT_EQ(mount(\"tmpfs\", \"/tmp\", \"tmpfs\", 0, NULL), 0);\n+\tASSERT_EQ(mkdir(\"/tmp/empty\", 0755), 0);\n+\tASSERT_EQ(mkdir(\"/tmp/merged\", 0755), 0);\n+\n+\t/* A lower-only overlayfs serves reads from sysfs. */\n+\tif (mount(\"overlay\", \"/tmp/merged\", \"overlay\", MS_RDONLY,\n+\t\t  \"lowerdir=/sys/kernel:/tmp/empty\"))\n+\t\tSKIP(return, \"no overlayfs on top of sysfs: %s\", strerror(errno));\n+\n+\tASSERT_EQ(attach_path(\"/tmp/merged/warn_count\", false), -EINVAL);\n+}\n+\n+#define CONFIGFS_DIR \"/sys/kernel/config\"\n+#define GADGET_DIR CONFIGFS_DIR \"/usb_gadget/pseudo_backing_test\"\n+#define MASS_STORAGE_DIR GADGET_DIR \"/functions/mass_storage.0\"\n+\n+TEST(usb_mass_storage_backing_file)\n+{\n+\tconst char *path = \"/sys/kernel/warn_count\";\n+\tstruct statfs sfs;\n+\tssize_t ret;\n+\tint fd, err;\n+\n+\tif (geteuid())\n+\t\tSKIP(return, \"needs root\");\n+\n+\t/* Mounting configfs on top of itself fails with EBUSY. */\n+\tif (statfs(CONFIGFS_DIR, \u0026sfs) || sfs.f_type != CONFIGFS_MAGIC) {\n+\t\tASSERT_EQ(unshare(CLONE_NEWNS), 0);\n+\t\tASSERT_EQ(mount(NULL, \"/\", NULL, MS_REC | MS_PRIVATE, NULL), 0);\n+\t\tif (mount(\"configfs\", CONFIGFS_DIR, \"configfs\", 0, NULL))\n+\t\t\tSKIP(return, \"no configfs: %s\", strerror(errno));\n+\t}\n+\n+\tif (mkdir(GADGET_DIR, 0755))\n+\t\tSKIP(return, \"no usb gadget configfs: %s\", strerror(errno));\n+\tif (mkdir(MASS_STORAGE_DIR, 0755)) {\n+\t\terr = errno;\n+\t\trmdir(GADGET_DIR);\n+\t\tSKIP(return, \"no usb mass storage function: %s\", strerror(err));\n+\t}\n+\n+\t/* Writing the path opens the LUN's backing file right away. */\n+\tfd = open(MASS_STORAGE_DIR \"/lun.0/file\", O_WRONLY | O_CLOEXEC);\n+\tEXPECT_GE(fd, 0);\n+\tif (fd \u003e= 0) {\n+\t\tret = write(fd, path, strlen(path));\n+\t\terr = errno;\n+\t\tEXPECT_EQ(ret, -1);\n+\t\tEXPECT_EQ(err, EINVAL);\n+\t\tEXPECT_EQ(close(fd), 0);\n+\t}\n+\n+\tEXPECT_EQ(rmdir(MASS_STORAGE_DIR), 0);\n+\tEXPECT_EQ(rmdir(GADGET_DIR), 0);\n+}\n+\n+TEST(erofs_backing_file)\n+{\n+\tbool refused = false;\n+\tchar buf[256];\n+\tint fsfd, ret, err;\n+\tssize_t n;\n+\n+\tif (geteuid())\n+\t\tSKIP(return, \"needs root\");\n+\n+\tfsfd = sys_fsopen(\"erofs\", FSOPEN_CLOEXEC);\n+\tif (fsfd \u003c 0)\n+\t\tSKIP(return, \"no erofs: %s\", strerror(errno));\n+\n+\tASSERT_EQ(sys_fsconfig(fsfd, FSCONFIG_SET_STRING, \"source\",\n+\t\t\t       \"/sys/kernel/warn_count\", 0), 0);\n+\tret = sys_fsconfig(fsfd, FSCONFIG_CMD_CREATE, NULL, NULL, 0);\n+\terr = errno;\n+\tif (ret \u0026\u0026 err == ENOTBLK) {\n+\t\tclose(fsfd);\n+\t\tSKIP(return, \"no file-backed erofs mounts\");\n+\t}\n+\tASSERT_EQ(ret, -1);\n+\tASSERT_EQ(err, EINVAL);\n+\n+\t/*\n+\t * Something that isn't an erofs image fails with EINVAL as well so\n+\t * check that the source itself was refused.\n+\t */\n+\twhile ((n = read(fsfd, buf, sizeof(buf) - 1)) \u003e 0) {\n+\t\tbuf[n] = '\\0';\n+\t\tif (strstr(buf, \"pseudo filesystem\"))\n+\t\t\trefused = true;\n+\t}\n+\tEXPECT_TRUE(refused);\n+\tEXPECT_EQ(close(fsfd), 0);\n+}\n+\n+TEST_HARNESS_MAIN\n"
}

2/1 2026/11/13 12:16 agent patch-evaluator
27m Model:
core

Args:
null

Results:
{
  "EnableConfigs": [
    "BLK_DEV_LOOP",
    "BLK_DEV_ZONED",
    "BLK_DEV_ZONED_LOOP",
    "NVME_TARGET",
    "TARGET_CORE",
    "TCM_FILEIO",
    "FUSE_FS",
    "FUSE_PASSTHROUGH",
    "EROFS_FS",
    "EROFS_FS_BACKED_BY_FILE",
    "USB_GADGET",
    "USB_CONFIGFS",
    "USB_CONFIGFS_MASS_STORAGE"
  ],
  "FocusSymbols": [
    "loop_check_backing_file",
    "loop_configure",
    "zloop_init_zone",
    "nvmet_file_ns_enable",
    "fd_configure_device",
    "fsg_lun_open",
    "fuse_backing_open_file",
    "fuse_backing_open",
    "erofs_file_get_tree",
    "erofs_init_device"
  ],
  "Reasoning": "The patch introduces SB_I_PSEUDO to designate regular files on pseudo-filesystems as kernel interfaces that must not be used as storage backends, and integrates file_is_pseudo() validation into loop devices, zoned loop devices, NVMe target fileio, LIO target FILEIO, USB mass storage gadget, FUSE passthrough backing files, and file-backed EROFS. These are reachable, user-accessible storage and filesystem interfaces in amd64 virtualized environments, making them suitable targets for fuzzing to uncover edge cases and regressions in backing file validation.",
  "WorthFuzzing": true
}

Instruction:
You are an expert Linux kernel maintainer and security engineer.
Your job is to review a provided patch series and evaluate whether it warrants fuzzing with syzkaller.

IMPORTANT: The changes have ALREADY been applied and committed as the HEAD commit in
your workspace. Do NOT rely on internal assumptions. You must actively use your code access
tools to inspect the actual source code, callers, and surrounding context.

================================================================================
1. CORE TRIAGE PHILOSOPHY
================================================================================
The goal of patch fuzzing is to discover crashes, regressions, exposed latent bugs,
and newly triggered assertions introduced by the patch series.

- REACHABILITY IS THE PRIMARY GATE:
  Fuzzing can only discover bugs in code that can actually execute in standard virtualized
  environments (GCE or QEMU, utilizing software-emulated devices like USB gadgets, netdev, tun/tap).
  If the modified code is structurally unreachable (see Section 2), it MUST NOT be fuzzed,
  regardless of whether it adds assertions or complex logic.

- DO NOT BLINDLY TRUST "NO FUNCTIONAL CHANGE" (NFCI) OR "REFACTORING" CLAIMS:
  Patch authors routinely label changes as "cleanups", "refactorings", or state
  "No functional change intended". Do NOT take these claims at face value.
  Code refactorings that rearrange logic, introduce helper functions, or alter state management
  in core subsystems frequently introduce subtle semantic shifts or uncover latent kernel bugs.
  If reachable executable code is modified or refactored, it MUST be fuzzed.

- NEW OR MODIFIED ASSERTIONS IN REACHABLE CODE MUST BE FUZZED:
  When a patch introduces or modifies runtime checks or assertions (e.g., WARN_ON*, VM_WARN_ON*,
  BUG_ON*, lockdep_assert*) in reachable code paths, it enforces new or stricter invariants.
  Even if the author believes the invariant always holds, fuzzing is essential to verify whether
  an unusual sequence of operations can violate it.

================================================================================
2. WHEN TO RETURN WorthFuzzing=false (NEGATIVE CRITERIA)
================================================================================
Return WorthFuzzing=false ONLY IF all modified code falls strictly into one or more of these categories:

- Non-kernel and non-executable changes:
  * Modifications to Documentation/, comments, or spelling fixes.
  * User-space directories, self-tests, samples, or scripts (e.g., tools/, samples/, scripts/, usr/)
    that do not affect the compiled kernel image (vmlinux) or kernel modules.
  * Purely decorative logging (e.g., message strings in pr_err, printk, dev_info) or tracepoints
    that do not alter control flow or data structures.
  * Build system or Kconfig changes that do not alter compiled C logic.
- Structurally unreachable hardware:
  * Vendor-specific PCIe switches, SmartNICs, or GPU drivers (e.g., mlxsw, pds_core, qed,
    ionic, amdgpu) requiring physical ASIC/PCIe cards not emulated in standard QEMU.
- Unreachable execution paths:
  * Driver teardown callbacks (.remove, .shutdown, pci_unregister_driver) executed only during
    physical PCI hot-unplug or manual sysfs driver unbinding.
  * Code paths exclusive to architectures other than the target architecture.

================================================================================
3. WHEN TO RETURN WorthFuzzing=true (POSITIVE CRITERIA)
================================================================================
Return WorthFuzzing=true whenever the patch touches reachable executable code, including:
- Core Subsystems:
  * Any logic modifications in memory management (mm/), synchronization/locking (kernel/locking/),
    BPF, scheduler, core networking, VFS, or syscall handling.
- Refactorings and Code Cleanups:
  * Any restructuring of reachable data structures, helper abstractions, or algorithm flows.
- Runtime Assertions and Defensive Checks:
  * Any introduction or alteration of assertions (WARN_ON*, VM_WARN_ON*, BUG_ON*, etc.) in reachable paths.
- Reachable Drivers and Protocols:
  * Drivers accessible via virtual buses (virtio, USB gadget, loopback, netlink, binder, sockets, etc.).

================================================================================
4. EXTRACTING FocusSymbols (PREVENTING DILUTION)
================================================================================
When WorthFuzzing=true, you must extract specific kernel functions into FocusSymbols to guide the fuzzer:

- AVOID UBIQUITOUS LIFECYCLE HOT-PATHS:
  Do NOT list generic, ubiquitous functions called by almost every program in the corpus
  (including, but not limited to: general memory allocators and deallocators, page fault
  and trap handlers, or core synchronization primitives; this is not an exhaustive list).
  Listing ubiquitous functions causes the fuzzer to classify thousands of unrelated tests as "focused",
  which severely dilutes fuzzing effort away from the actual changes.

- TARGET SPECIFIC FEATURE LOGIC AND ENTRYPOINTS:
  List functions that specifically implement the logic being added or altered, or direct API entrypoints
  for the subsystem feature under review.

- HANDLING STATIC INLINE FUNCTIONS IN HEADERS (.h):
  Compiler-inlined static functions (such as static inlines in mm/*.h or include/linux/*.h) lack
  distinct symbol addresses in vmlinux and cannot be targeted directly by symbol coverage filters.
  If the changes are primarily in static inline helpers, identify non-static, feature-specific caller
  functions in .c files that exercise them (avoiding ubiquitous lifecycle wrappers).

================================================================================
5. IDENTIFYING EnableConfigs
================================================================================
Identify any specific CONFIG_ options required to properly compile and reach the modified code:
- Inspect Kconfig files and #ifdef guards; do not make assumptions.
- Check "depends on" lines in Kconfig to include any non-standard parent subsystem configs needed.
- Strip any 'CONFIG_' prefix (e.g., return "NET_IPV4" instead of "CONFIG_NET_IPV4").
Prefer calling several tools at the same time to save round-trips.


Use set-results tool to provide results of the analysis.
It must be called exactly once before the final reply.
Ignore results of this tool.

Prompt:
Target architecture: amd64

For your convenience, here is the diff of the changes:
commit da40508d66ebfc12e02da88b0a4c015923f8f10a
Author: syz-cluster <triage@syzkaller.com>
Date:   Fri Nov 13 12:16:12 2026 +0000

    syz-cluster: applied patch under review

diff --git a/arch/powerpc/platforms/cell/spufs/inode.c b/arch/powerpc/platforms/cell/spufs/inode.c
index f066d9c7344d37..54b45932aecd22 100644
--- a/arch/powerpc/platforms/cell/spufs/inode.c
+++ b/arch/powerpc/platforms/cell/spufs/inode.c
@@ -11,6 +11,7 @@
 #include <linux/file.h>
 #include <linux/fs.h>
 #include <linux/fs_context.h>
+#include <linux/pseudo_fs.h>
 #include <linux/fs_parser.h>
 #include <linux/fsnotify.h>
 #include <linux/backing-dev.h>
@@ -741,6 +742,7 @@ static int spufs_init_fs_context(struct fs_context *fc)
 
 	fc->fs_private = ctx;
 	fc->s_fs_info = sbi;
+	fc_init_pseudo(fc);
 	fc->ops = &spufs_context_ops;
 	return 0;
 
diff --git a/arch/s390/hypfs/inode.c b/arch/s390/hypfs/inode.c
index 559b011e68800f..8662169de477ab 100644
--- a/arch/s390/hypfs/inode.c
+++ b/arch/s390/hypfs/inode.c
@@ -12,6 +12,7 @@
 #include <linux/errno.h>
 #include <linux/fs.h>
 #include <linux/fs_context.h>
+#include <linux/pseudo_fs.h>
 #include <linux/fs_parser.h>
 #include <linux/namei.h>
 #include <linux/vfs.h>
@@ -301,6 +302,7 @@ static int hypfs_init_fs_context(struct fs_context *fc)
 	sbi->gid = current_gid();
 
 	fc->s_fs_info = sbi;
+	fc_init_pseudo(fc);
 	fc->ops = &hypfs_context_ops;
 	return 0;
 }
diff --git a/drivers/android/binder/rust_binderfs.c b/drivers/android/binder/rust_binderfs.c
index 5f020226720dba..04468c5b5c116c 100644
--- a/drivers/android/binder/rust_binderfs.c
+++ b/drivers/android/binder/rust_binderfs.c
@@ -3,6 +3,7 @@
 #include <linux/compiler_types.h>
 #include <linux/errno.h>
 #include <linux/fs.h>
+#include <linux/pseudo_fs.h>
 #include <linux/fsnotify.h>
 #include <linux/gfp.h>
 #include <linux/idr.h>
@@ -667,7 +668,6 @@ static int binderfs_fill_super(struct super_block *sb, struct fs_context *fc)
 	 * necessary and safe.
 	 */
 	sb->s_iflags &= ~SB_I_NODEV;
-	sb->s_iflags |= SB_I_NOEXEC;
 	sb->s_magic = RUST_BINDERFS_SUPER_MAGIC;
 	sb->s_op = &binderfs_super_ops;
 	sb->s_time_gran = 1;
@@ -759,6 +759,7 @@ static int binderfs_init_fs_context(struct fs_context *fc)
 	ctx->stats_mode = binderfs_stats_mode_unset;
 
 	fc->fs_private = ctx;
+	fc_init_pseudo(fc);
 	fc->ops = &binderfs_fs_context_ops;
 
 	return 0;
diff --git a/drivers/block/loop.c b/drivers/block/loop.c
index a3325ceab484a4..1482580a19795a 100644
--- a/drivers/block/loop.c
+++ b/drivers/block/loop.c
@@ -528,12 +528,18 @@ static void loop_assign_backing_file(struct loop_device *lo, struct file *file)
 
 static int loop_check_backing_file(struct file *file)
 {
+	if (!(file->f_mode & FMODE_READ))
+		return -EBADF;
+
 	if (!file->f_op->read_iter)
 		return -EINVAL;
 
 	if ((file->f_mode & FMODE_WRITE) && !file->f_op->write_iter)
 		return -EINVAL;
 
+	if (file_is_pseudo(file))
+		return -EINVAL;
+
 	return 0;
 }
 
diff --git a/drivers/block/zloop.c b/drivers/block/zloop.c
index 65634a39b0bfcb..dcc06dd47b040e 100644
--- a/drivers/block/zloop.c
+++ b/drivers/block/zloop.c
@@ -1137,6 +1137,11 @@ static int zloop_init_zone(struct zloop_device *zlo, struct zloop_options *opts,
 		goto out_fput;
 	}
 
+	if (file_is_pseudo(zone->file)) {
+		ret = -EINVAL;
+		goto out_fput;
+	}
+
 	if (zlo->block_size) {
 		ret = zloop_get_block_size(zlo, zone);
 		if (ret)
diff --git a/drivers/nvme/target/io-cmd-file.c b/drivers/nvme/target/io-cmd-file.c
index 695963dd932ee7..71c69bac539436 100644
--- a/drivers/nvme/target/io-cmd-file.c
+++ b/drivers/nvme/target/io-cmd-file.c
@@ -47,6 +47,16 @@ int nvmet_file_ns_enable(struct nvmet_ns *ns)
 		return ret;
 	}
 
+	if (!ns->file->f_op->read_iter || !ns->file->f_op->write_iter) {
+		ret = -EINVAL;
+		goto err;
+	}
+
+	if (file_is_pseudo(ns->file)) {
+		ret = -EINVAL;
+		goto err;
+	}
+
 	nvmet_file_ns_revalidate(ns);
 
 	/*
diff --git a/drivers/target/target_core_file.c b/drivers/target/target_core_file.c
index ab9824a4852f1e..7a3cf63dc979b5 100644
--- a/drivers/target/target_core_file.c
+++ b/drivers/target/target_core_file.c
@@ -144,6 +144,21 @@ static int fd_configure_device(struct se_device *dev)
 		goto fail;
 	}
 	fd_dev->fd_file = file;
+
+	if (!file->f_op->read_iter || !file->f_op->write_iter) {
+		pr_err("FILEIO: %s lacks ->read_iter or ->write_iter\n",
+		       fd_dev->fd_dev_name);
+		ret = -EINVAL;
+		goto fail;
+	}
+
+	if (file_is_pseudo(file)) {
+		pr_err("FILEIO: %s is on a pseudo filesystem\n",
+		       fd_dev->fd_dev_name);
+		ret = -EINVAL;
+		goto fail;
+	}
+
 	/*
 	 * If using a block backend with this struct file, we extract
 	 * fd_dev->fd_[block,dev]_size from struct block_device.
diff --git a/drivers/usb/gadget/function/f_fs.c b/drivers/usb/gadget/function/f_fs.c
index c64a268e98a433..a6b3788399a560 100644
--- a/drivers/usb/gadget/function/f_fs.c
+++ b/drivers/usb/gadget/function/f_fs.c
@@ -15,6 +15,7 @@
 /* #define VERBOSE_DEBUG */
 
 #include <linux/blkdev.h>
+#include <linux/pseudo_fs.h>
 #include <linux/dma-buf.h>
 #include <linux/dma-fence.h>
 #include <linux/dma-resv.h>
@@ -2166,6 +2167,7 @@ static int ffs_fs_init_fs_context(struct fs_context *fc)
 	ctx->no_disconnect = false;
 
 	fc->fs_private = ctx;
+	fc_init_pseudo(fc);
 	fc->ops = &ffs_fs_context_ops;
 	return 0;
 }
diff --git a/drivers/usb/gadget/function/storage_common.c b/drivers/usb/gadget/function/storage_common.c
index 75831f2c7abeb0..83683ade20c240 100644
--- a/drivers/usb/gadget/function/storage_common.c
+++ b/drivers/usb/gadget/function/storage_common.c
@@ -211,6 +211,11 @@ int fsg_lun_open(struct fsg_lun *curlun, const char *filename)
 		goto out;
 	}
 
+	if (file_is_pseudo(filp)) {
+		LINFO(curlun, "file on a pseudo filesystem: %s\n", filename);
+		goto out;
+	}
+
 	/*
 	 * If we can't read the file, it's no good.
 	 * If we can't write the file, use it read-only.
diff --git a/drivers/usb/gadget/legacy/inode.c b/drivers/usb/gadget/legacy/inode.c
index 7f6d8460152f90..8490e5d0351e1a 100644
--- a/drivers/usb/gadget/legacy/inode.c
+++ b/drivers/usb/gadget/legacy/inode.c
@@ -13,6 +13,7 @@
 #include <linux/module.h>
 #include <linux/fs.h>
 #include <linux/fs_context.h>
+#include <linux/pseudo_fs.h>
 #include <linux/pagemap.h>
 #include <linux/uts.h>
 #include <linux/wait.h>
@@ -2223,6 +2224,7 @@ static const struct fs_context_operations gadgetfs_context_ops = {
 
 static int gadgetfs_init_fs_context(struct fs_context *fc)
 {
+	fc_init_pseudo(fc);
 	fc->ops = &gadgetfs_context_ops;
 	return 0;
 }
diff --git a/drivers/xen/xenfs/super.c b/drivers/xen/xenfs/super.c
index 37ea7c5c034695..aba7d038ed735f 100644
--- a/drivers/xen/xenfs/super.c
+++ b/drivers/xen/xenfs/super.c
@@ -15,6 +15,7 @@
 #include <linux/module.h>
 #include <linux/fs.h>
 #include <linux/fs_context.h>
+#include <linux/pseudo_fs.h>
 #include <linux/magic.h>
 
 #include <xen/xen.h>
@@ -80,6 +81,7 @@ static const struct fs_context_operations xenfs_context_ops = {
 
 static int xenfs_init_fs_context(struct fs_context *fc)
 {
+	fc_init_pseudo(fc);
 	fc->ops = &xenfs_context_ops;
 	return 0;
 }
diff --git a/fs/binfmt_misc.c b/fs/binfmt_misc.c
index d945b4f6e15813..7dc233becd98db 100644
--- a/fs/binfmt_misc.c
+++ b/fs/binfmt_misc.c
@@ -22,6 +22,7 @@
 #include <linux/file.h>
 #include <linux/fs.h>
 #include <linux/fs_context.h>
+#include <linux/pseudo_fs.h>
 #include <linux/init.h>
 #include <linux/kstrtox.h>
 #include <linux/limits.h>
@@ -1575,8 +1576,7 @@ static int bm_fill_super(struct super_block *sb, struct fs_context *fc)
 	if (user_ns != current_user_ns())
 		return -EINVAL;
 
-	/* Never exec off this instance and never let anything stack on it. */
-	sb->s_iflags |= SB_I_NOEXEC | SB_I_NODEV;
+	/* Never let anything stack on this instance. */
 	sb->s_stack_depth = FILESYSTEM_MAX_STACK_DEPTH;
 
 	/*
@@ -1660,6 +1660,7 @@ static void bm_kill_sb(struct super_block *sb)
 
 static int bm_init_fs_context(struct fs_context *fc)
 {
+	fc_init_pseudo(fc);
 	fc->ops = &bm_context_ops;
 	return 0;
 }
diff --git a/fs/configfs/mount.c b/fs/configfs/mount.c
index d8cac1cbf3bd57..60ba24e7ae2b96 100644
--- a/fs/configfs/mount.c
+++ b/fs/configfs/mount.c
@@ -13,6 +13,7 @@
 #include <linux/module.h>
 #include <linux/mount.h>
 #include <linux/fs_context.h>
+#include <linux/pseudo_fs.h>
 #include <linux/pagemap.h>
 #include <linux/init.h>
 #include <linux/slab.h>
@@ -106,6 +107,7 @@ static const struct fs_context_operations configfs_context_ops = {
 
 static int configfs_init_fs_context(struct fs_context *fc)
 {
+	fc_init_pseudo(fc);
 	fc->ops = &configfs_context_ops;
 	return 0;
 }
diff --git a/fs/debugfs/inode.c b/fs/debugfs/inode.c
index b4915551ad315a..f163f0bc5703a3 100644
--- a/fs/debugfs/inode.c
+++ b/fs/debugfs/inode.c
@@ -15,6 +15,7 @@
 #include <linux/module.h>
 #include <linux/fs.h>
 #include <linux/fs_context.h>
+#include <linux/pseudo_fs.h>
 #include <linux/fs_parser.h>
 #include <linux/pagemap.h>
 #include <linux/init.h>
@@ -317,6 +318,7 @@ static int debugfs_init_fs_context(struct fs_context *fc)
 	fsi->mode = DEBUGFS_DEFAULT_MODE;
 
 	fc->s_fs_info = fsi;
+	fc_init_pseudo(fc);
 	fc->ops = &debugfs_context_ops;
 	return 0;
 }
diff --git a/fs/devpts/inode.c b/fs/devpts/inode.c
index bd1e8eb26edb70..47ef12241d92d7 100644
--- a/fs/devpts/inode.c
+++ b/fs/devpts/inode.c
@@ -13,6 +13,7 @@
 #include <linux/init.h>
 #include <linux/fs.h>
 #include <linux/fs_context.h>
+#include <linux/pseudo_fs.h>
 #include <linux/fs_parser.h>
 #include <linux/sched.h>
 #include <linux/namei.h>
@@ -438,6 +439,7 @@ static int devpts_init_fs_context(struct fs_context *fc)
 		fsi->mount_opts.reserve = true;
 
 	fc->s_fs_info = fsi;
+	fc_init_pseudo(fc);
 	fc->ops = &devpts_context_ops;
 	return 0;
 }
diff --git a/fs/efivarfs/super.c b/fs/efivarfs/super.c
index 12746ced6dc639..e598d42c5f42c4 100644
--- a/fs/efivarfs/super.c
+++ b/fs/efivarfs/super.c
@@ -8,6 +8,7 @@
 #include <linux/efi.h>
 #include <linux/fs.h>
 #include <linux/fs_context.h>
+#include <linux/pseudo_fs.h>
 #include <linux/fs_parser.h>
 #include <linux/module.h>
 #include <linux/pagemap.h>
@@ -554,6 +555,7 @@ static int efivarfs_init_fs_context(struct fs_context *fc)
 	}
 
 	fc->s_fs_info = sfi;
+	fc_init_pseudo(fc);
 	fc->ops = &efivarfs_context_ops;
 
 	return 0;
diff --git a/fs/erofs/super.c b/fs/erofs/super.c
index ce05557bd99836..980d5fc2b57619 100644
--- a/fs/erofs/super.c
+++ b/fs/erofs/super.c
@@ -158,7 +158,8 @@ static int erofs_init_device(struct erofs_buf *buf, struct super_block *sb,
 		if (!erofs_is_fileio_mode(sbi)) {
 			dif->dax_dev = fs_dax_get_by_bdev(file_bdev(file),
 					&dif->dax_part_off, NULL, NULL);
-		} else if (!S_ISREG(file_inode(file)->i_mode)) {
+		} else if (!S_ISREG(file_inode(file)->i_mode) ||
+			   file_is_pseudo(file)) {
 			fput(file);
 			return -EINVAL;
 		}
@@ -835,6 +836,9 @@ static int erofs_file_get_tree(struct fs_context *fc)
 {
 	struct erofs_sb_info *sbi = fc->s_fs_info;
 
+	if (file_is_pseudo(sbi->dif0.file))
+		return invalfc(fc, "source is on a pseudo filesystem");
+
 	if (!test_opt(&sbi->opt, SUPERBLOCK_SHARE))
 		return get_tree_nodev(fc, erofs_fc_fill_super);
 
diff --git a/fs/failfs.c b/fs/failfs.c
index 437cdc981c2ded..f03334f361c0ed 100644
--- a/fs/failfs.c
+++ b/fs/failfs.c
@@ -3,6 +3,7 @@
 #include <linux/fs.h>
 #include <linux/fs/super_types.h>
 #include <linux/fs_context.h>
+#include <linux/pseudo_fs.h>
 #include <linux/fs_struct.h>
 #include <linux/magic.h>
 #include <linux/mount.h>
@@ -132,7 +133,7 @@ static int failfs_init_fs_context(struct fs_context *fc)
 	fc->ops		= &failfs_context_ops;
 	fc->global	= true;
 	fc->sb_flags	|= SB_NOUSER;
-	fc->s_iflags	|= SB_I_NOEXEC | SB_I_NODEV;
+	fc_init_pseudo(fc);
 	return 0;
 }
 
diff --git a/fs/fuse/backing.c b/fs/fuse/backing.c
index 8c21a8a74efb9c..4e4fb810ddaa88 100644
--- a/fs/fuse/backing.c
+++ b/fs/fuse/backing.c
@@ -147,6 +147,9 @@ static int fuse_backing_open_file(struct fuse_conn *fc, struct fuse_backing *fb,
 		if (inode->i_sb->s_stack_depth >= fc->max_stack_depth)
 			return -ELOOP;
 
+		if (file_is_pseudo(file))
+			return -EINVAL;
+
 		fb->type = FUSE_BACKING_PATH;
 		fb->path = file->f_path;
 		path_get(&fb->path);
diff --git a/fs/fuse/control.c b/fs/fuse/control.c
index 21ffde596d6116..4497362e7df069 100644
--- a/fs/fuse/control.c
+++ b/fs/fuse/control.c
@@ -10,6 +10,7 @@
 #include <linux/init.h>
 #include <linux/module.h>
 #include <linux/fs_context.h>
+#include <linux/pseudo_fs.h>
 #include <linux/namei.h>
 
 #define FUSE_CTL_SUPER_MAGIC 0x65735543
@@ -334,6 +335,7 @@ static const struct fs_context_operations fuse_ctl_context_ops = {
 
 static int fuse_ctl_init_fs_context(struct fs_context *fsc)
 {
+	fc_init_pseudo(fsc);
 	fsc->ops = &fuse_ctl_context_ops;
 	return 0;
 }
diff --git a/fs/kernfs/mount.c b/fs/kernfs/mount.c
index a0be784bfb0646..6b60d212b003d6 100644
--- a/fs/kernfs/mount.c
+++ b/fs/kernfs/mount.c
@@ -8,6 +8,7 @@
  */
 
 #include <linux/fs.h>
+#include <linux/pseudo_fs.h>
 #include <linux/mount.h>
 #include <linux/init.h>
 #include <linux/magic.h>
@@ -298,8 +299,6 @@ static int kernfs_fill_super(struct super_block *sb, struct kernfs_fs_context *k
 	struct dentry *root;
 
 	info->sb = sb;
-	/* Userspace would break if executables or devices appear on sysfs */
-	sb->s_iflags |= SB_I_NOEXEC | SB_I_NODEV;
 	sb->s_blocksize = PAGE_SIZE;
 	sb->s_blocksize_bits = PAGE_SHIFT;
 	sb->s_magic = kfc->magic;
@@ -388,6 +387,7 @@ int kernfs_get_tree(struct fs_context *fc)
 	info->ns = kfc->ns_tag;
 	INIT_LIST_HEAD(&info->node);
 
+	fc_init_pseudo(fc);
 	fc->s_fs_info = info;
 	sb = sget_fc(fc, kernfs_test_super, kernfs_set_super);
 	if (IS_ERR(sb))
diff --git a/fs/libfs.c b/fs/libfs.c
index 96a6e9b1535fb7..8c8789489fdf96 100644
--- a/fs/libfs.c
+++ b/fs/libfs.c
@@ -735,7 +735,7 @@ struct pseudo_fs_context *init_pseudo(struct fs_context *fc,
 		fc->fs_private = ctx;
 		fc->ops = &pseudo_fs_context_ops;
 		fc->sb_flags |= SB_NOUSER;
-		fc->s_iflags |= SB_I_NOEXEC | SB_I_NODEV;
+		fc_init_pseudo(fc);
 		fc->global = true;
 	}
 	return ctx;
diff --git a/fs/nfsd/nfsctl.c b/fs/nfsd/nfsctl.c
index f32311f2d7cf96..ce2666deddbd94 100644
--- a/fs/nfsd/nfsctl.c
+++ b/fs/nfsd/nfsctl.c
@@ -9,6 +9,7 @@
 #include <linux/namei.h>
 #include <linux/ctype.h>
 #include <linux/fs_context.h>
+#include <linux/pseudo_fs.h>
 
 #include <linux/sunrpc/cache.h>
 #include <linux/sunrpc/svcsock.h>
@@ -1375,6 +1376,7 @@ static int nfsd_init_fs_context(struct fs_context *fc)
 {
 	put_user_ns(fc->user_ns);
 	fc->user_ns = get_user_ns(fc->net_ns->user_ns);
+	fc_init_pseudo(fc);
 	fc->ops = &nfsd_fs_context_ops;
 	return 0;
 }
diff --git a/fs/nullfs.c b/fs/nullfs.c
index 319c2f5c5a6714..2fe24cb97160ec 100644
--- a/fs/nullfs.c
+++ b/fs/nullfs.c
@@ -2,6 +2,7 @@
 /* Copyright (c) 2026 Christian Brauner <brauner@kernel.org> */
 #include <linux/fs/super_types.h>
 #include <linux/fs_context.h>
+#include <linux/pseudo_fs.h>
 #include <linux/magic.h>
 #include <linux/splice.h>
 #include <linux/uio.h>
@@ -174,7 +175,7 @@ static int nullfs_init_fs_context(struct fs_context *fc)
 {
 	fc->ops		= &nullfs_fs_context_ops;
 	fc->sb_flags	|= SB_NOUSER;
-	fc->s_iflags	|= SB_I_NOEXEC | SB_I_NODEV;
+	fc_init_pseudo(fc);
 	return 0;
 }
 
diff --git a/fs/ocfs2/dlmfs/dlmfs.c b/fs/ocfs2/dlmfs/dlmfs.c
index d3bfcada3e3bf5..1789ec96dc130f 100644
--- a/fs/ocfs2/dlmfs/dlmfs.c
+++ b/fs/ocfs2/dlmfs/dlmfs.c
@@ -21,6 +21,7 @@
 #include <linux/module.h>
 #include <linux/fs.h>
 #include <linux/fs_context.h>
+#include <linux/pseudo_fs.h>
 #include <linux/pagemap.h>
 #include <linux/types.h>
 #include <linux/slab.h>
@@ -563,6 +564,7 @@ static const struct fs_context_operations dlmfs_context_ops = {
 
 static int dlmfs_init_fs_context(struct fs_context *fc)
 {
+	fc_init_pseudo(fc);
 	fc->ops = &dlmfs_context_ops;
 
 	return 0;
diff --git a/fs/openpromfs/inode.c b/fs/openpromfs/inode.c
index fb8d84bdedfb20..6cd02d456bac95 100644
--- a/fs/openpromfs/inode.c
+++ b/fs/openpromfs/inode.c
@@ -10,6 +10,7 @@
 #include <linux/string.h>
 #include <linux/fs.h>
 #include <linux/fs_context.h>
+#include <linux/pseudo_fs.h>
 #include <linux/init.h>
 #include <linux/slab.h>
 #include <linux/seq_file.h>
@@ -419,6 +420,7 @@ static const struct fs_context_operations openpromfs_context_ops = {
 
 static int openpromfs_init_fs_context(struct fs_context *fc)
 {
+	fc_init_pseudo(fc);
 	fc->ops = &openpromfs_context_ops;
 	return 0;
 }
diff --git a/fs/proc/root.c b/fs/proc/root.c
index 7fbbe92bf73a71..ca0e75081934fc 100644
--- a/fs/proc/root.c
+++ b/fs/proc/root.c
@@ -17,6 +17,7 @@
 #include <linux/bitops.h>
 #include <linux/user_namespace.h>
 #include <linux/fs_context.h>
+#include <linux/pseudo_fs.h>
 #include <linux/mount.h>
 #include <linux/pid_namespace.h>
 #include <linux/fs_parser.h>
@@ -265,8 +266,6 @@ static int proc_fill_super(struct super_block *s, struct fs_context *fc)
 	if (ret)
 		return ret;
 
-	/* User space would break if executables or devices appear on proc */
-	s->s_iflags |= SB_I_NOEXEC | SB_I_NODEV;
 	s->s_flags |= SB_NODIRATIME | SB_NOSUID | SB_NOEXEC;
 	s->s_blocksize = 1024;
 	s->s_blocksize_bits = 10;
@@ -350,6 +349,7 @@ static int proc_init_fs_context(struct fs_context *fc)
 	put_user_ns(fc->user_ns);
 	fc->user_ns = get_user_ns(ctx->pid_ns->user_ns);
 	fc->fs_private = ctx;
+	fc_init_pseudo(fc);
 	fc->ops = &proc_fs_context_ops;
 	return 0;
 }
diff --git a/fs/pstore/inode.c b/fs/pstore/inode.c
index cf499ba727026e..4658561cf90b7d 100644
--- a/fs/pstore/inode.c
+++ b/fs/pstore/inode.c
@@ -18,6 +18,7 @@
 #include <linux/ramfs.h>
 #include <linux/fs_parser.h>
 #include <linux/fs_context.h>
+#include <linux/pseudo_fs.h>
 #include <linux/sched.h>
 #include <linux/magic.h>
 #include <linux/pstore.h>
@@ -491,6 +492,7 @@ static int pstore_init_fs_context(struct fs_context *fc)
 	ctx->kmsg_bytes = kmsg_bytes;
 
 	fc->fs_private = ctx;
+	fc_init_pseudo(fc);
 	fc->ops = &pstore_context_ops;
 
 	return 0;
diff --git a/fs/tracefs/inode.c b/fs/tracefs/inode.c
index 5020365ca70487..e04febd868eb41 100644
--- a/fs/tracefs/inode.c
+++ b/fs/tracefs/inode.c
@@ -12,6 +12,7 @@
 #include <linux/module.h>
 #include <linux/fs.h>
 #include <linux/fs_context.h>
+#include <linux/pseudo_fs.h>
 #include <linux/fs_parser.h>
 #include <linux/kobject.h>
 #include <linux/namei.h>
@@ -510,6 +511,7 @@ static int tracefs_init_fs_context(struct fs_context *fc)
 	fsi->mode = TRACEFS_DEFAULT_MODE;
 
 	fc->s_fs_info = fsi;
+	fc_init_pseudo(fc);
 	fc->ops = &tracefs_context_ops;
 	return 0;
 }
diff --git a/include/linux/fs.h b/include/linux/fs.h
index 99caef43ff3c47..407ffb6342ec6c 100644
--- a/include/linux/fs.h
+++ b/include/linux/fs.h
@@ -2553,6 +2553,18 @@ static inline const struct inode *file_user_inode(const struct file *f)
 	return file_inode(f);
 }
 
+/*
+ * Regular files on pseudo filesystems are kernel interfaces and must not be
+ * used as storage. Look through stacking filesystems at the inode that
+ * provides the data.
+ */
+static inline bool file_is_pseudo(const struct file *file)
+{
+	const struct inode *inode = d_real_inode(file->f_path.dentry);
+
+	return S_ISREG(inode->i_mode) && (inode->i_sb->s_iflags & SB_I_PSEUDO);
+}
+
 static inline struct file *file_clone_open(struct file *file)
 {
 	return dentry_open(&file->f_path, file->f_flags, file->f_cred);
diff --git a/include/linux/fs/super_types.h b/include/linux/fs/super_types.h
index 72f4288e16c526..472200bdf081a4 100644
--- a/include/linux/fs/super_types.h
+++ b/include/linux/fs/super_types.h
@@ -359,5 +359,6 @@ struct super_block {
 #define SB_I_NOIDMAP	0x00002000	/* No idmapped mounts on this superblock */
 #define SB_I_ALLOW_HSM	0x00004000	/* Allow HSM events on this superblock */
 #define SB_I_NO_DATA_INTEGRITY	0x00008000 /* fs cannot guarantee data persistence on sync */
+#define SB_I_PSEUDO	0x00010000	/* regular files are kernel interfaces, not storage */
 
 #endif /* _LINUX_FS_SUPER_TYPES_H */
diff --git a/include/linux/pseudo_fs.h b/include/linux/pseudo_fs.h
index a651e60d94107e..0ca408aa60aff4 100644
--- a/include/linux/pseudo_fs.h
+++ b/include/linux/pseudo_fs.h
@@ -2,6 +2,7 @@
 #define __LINUX_PSEUDO_FS__
 
 #include <linux/fs_context.h>
+#include <linux/fs/super_types.h>
 
 struct pseudo_fs_context {
 	const struct super_operations *ops;
@@ -15,4 +16,14 @@ struct pseudo_fs_context {
 struct pseudo_fs_context *init_pseudo(struct fs_context *fc,
 				      unsigned long magic);
 
+/*
+ * Common initialization for all pseudo filesystems, mountable or not. Their
+ * regular files are kernel interfaces. They don't store data and pseudo
+ * filesystems never hold executables or device nodes.
+ */
+static inline void fc_init_pseudo(struct fs_context *fc)
+{
+	fc->s_iflags |= SB_I_PSEUDO | SB_I_NOEXEC | SB_I_NODEV;
+}
+
 #endif
diff --git a/ipc/mqueue.c b/ipc/mqueue.c
index 322c3dd98c4477..8bbe32d0881f23 100644
--- a/ipc/mqueue.c
+++ b/ipc/mqueue.c
@@ -18,6 +18,7 @@
 #include <linux/file.h>
 #include <linux/mount.h>
 #include <linux/fs_context.h>
+#include <linux/pseudo_fs.h>
 #include <linux/namei.h>
 #include <linux/sysctl.h>
 #include <linux/poll.h>
@@ -405,7 +406,6 @@ static int mqueue_fill_super(struct super_block *sb, struct fs_context *fc)
 	struct inode *inode;
 	struct ipc_namespace *ns = sb->s_fs_info;
 
-	sb->s_iflags |= SB_I_NOEXEC | SB_I_NODEV;
 	sb->s_blocksize = PAGE_SIZE;
 	sb->s_blocksize_bits = PAGE_SHIFT;
 	sb->s_magic = MQUEUE_MAGIC;
@@ -457,6 +457,7 @@ static int mqueue_init_fs_context(struct fs_context *fc)
 	put_user_ns(fc->user_ns);
 	fc->user_ns = get_user_ns(ctx->ipc_ns->user_ns);
 	fc->fs_private = ctx;
+	fc_init_pseudo(fc);
 	fc->ops = &mqueue_fs_context_ops;
 	return 0;
 }
diff --git a/kernel/bpf/inode.c b/kernel/bpf/inode.c
index c6f328e4752e1d..57cf3775c07669 100644
--- a/kernel/bpf/inode.c
+++ b/kernel/bpf/inode.c
@@ -15,6 +15,7 @@
 #include <linux/namei.h>
 #include <linux/fs.h>
 #include <linux/fs_context.h>
+#include <linux/pseudo_fs.h>
 #include <linux/fs_parser.h>
 #include <linux/kdev_t.h>
 #include <linux/filter.h>
@@ -1197,8 +1198,6 @@ static int bpf_fill_super(struct super_block *sb, struct fs_context *fc)
 	sb->s_magic = BPF_FS_MAGIC;
 	sb->s_op = &bpf_super_ops;
 	sb->s_xattr = bpf_fs_xattr_handlers;
-	sb->s_iflags |= SB_I_NOEXEC;
-	sb->s_iflags |= SB_I_NODEV;
 	sb->s_time_gran = 1;
 
 	inode = bpf_get_inode(sb, NULL, S_IFDIR | 0777);
@@ -1261,6 +1260,7 @@ static int bpf_init_fs_context(struct fs_context *fc)
 	opts->delegate_attachs = 0;
 
 	fc->s_fs_info = opts;
+	fc_init_pseudo(fc);
 	fc->ops = &bpf_context_ops;
 	return 0;
 }
diff --git a/net/sunrpc/rpc_pipe.c b/net/sunrpc/rpc_pipe.c
index 9d349cfbc48312..37277a6d241562 100644
--- a/net/sunrpc/rpc_pipe.c
+++ b/net/sunrpc/rpc_pipe.c
@@ -15,6 +15,7 @@
 #include <linux/pagemap.h>
 #include <linux/mount.h>
 #include <linux/fs_context.h>
+#include <linux/pseudo_fs.h>
 #include <linux/namei.h>
 #include <linux/fsnotify.h>
 #include <linux/kernel.h>
@@ -1181,6 +1182,7 @@ static int rpc_init_fs_context(struct fs_context *fc)
 {
 	put_user_ns(fc->user_ns);
 	fc->user_ns = get_user_ns(fc->net_ns->user_ns);
+	fc_init_pseudo(fc);
 	fc->ops = &rpc_fs_context_ops;
 	return 0;
 }
diff --git a/security/apparmor/apparmorfs.c b/security/apparmor/apparmorfs.c
index a9936646721733..351ea3a7120e39 100644
--- a/security/apparmor/apparmorfs.c
+++ b/security/apparmor/apparmorfs.c
@@ -21,6 +21,7 @@
 #include <linux/rcupdate.h>
 #include <linux/fs.h>
 #include <linux/fs_context.h>
+#include <linux/pseudo_fs.h>
 #include <linux/poll.h>
 #include <linux/zstd.h>
 #include <linux/string.h>
@@ -263,6 +264,7 @@ static const struct fs_context_operations apparmorfs_context_ops = {
 
 static int apparmorfs_init_fs_context(struct fs_context *fc)
 {
+	fc_init_pseudo(fc);
 	fc->ops = &apparmorfs_context_ops;
 	return 0;
 }
diff --git a/security/inode.c b/security/inode.c
index 08040236767418..93997a9f16fcb3 100644
--- a/security/inode.c
+++ b/security/inode.c
@@ -14,6 +14,7 @@
 #include <linux/kobject.h>
 #include <linux/fs.h>
 #include <linux/fs_context.h>
+#include <linux/pseudo_fs.h>
 #include <linux/mount.h>
 #include <linux/pagemap.h>
 #include <linux/init.h>
@@ -64,6 +65,7 @@ static const struct fs_context_operations securityfs_context_ops = {
 
 static int securityfs_init_fs_context(struct fs_context *fc)
 {
+	fc_init_pseudo(fc);
 	fc->ops = &securityfs_context_ops;
 	return 0;
 }
diff --git a/security/selinux/selinuxfs.c b/security/selinux/selinuxfs.c
index 310e19efff1d0c..d7ae853b6d6854 100644
--- a/security/selinux/selinuxfs.c
+++ b/security/selinux/selinuxfs.c
@@ -18,6 +18,7 @@
 #include <linux/vmalloc.h>
 #include <linux/fs.h>
 #include <linux/fs_context.h>
+#include <linux/pseudo_fs.h>
 #include <linux/hex.h>
 #include <linux/mount.h>
 #include <linux/mutex.h>
@@ -1852,6 +1853,9 @@ static int sel_fill_super(struct super_block *sb, struct fs_context *fc)
 		/* last one */ {"", NULL, 0}
 	};
 
+	/* Android init opens the null device below by path. */
+	sb->s_iflags &= ~SB_I_NODEV;
+
 	ret = selinux_fs_info_create(sb);
 	if (ret)
 		goto err;
@@ -1955,6 +1959,7 @@ static const struct fs_context_operations sel_context_ops = {
 
 static int sel_init_fs_context(struct fs_context *fc)
 {
+	fc_init_pseudo(fc);
 	fc->ops = &sel_context_ops;
 	return 0;
 }
diff --git a/security/smack/smackfs.c b/security/smack/smackfs.c
index a72bc7fabea998..4a56bbeaeca370 100644
--- a/security/smack/smackfs.c
+++ b/security/smack/smackfs.c
@@ -25,6 +25,7 @@
 #include <linux/magic.h>
 #include <linux/mount.h>
 #include <linux/fs_context.h>
+#include <linux/pseudo_fs.h>
 #include "smack.h"
 
 #define BEBITS	(sizeof(__be32) * 8)
@@ -2880,6 +2881,7 @@ static const struct fs_context_operations smk_context_ops = {
  */
 static int smk_init_fs_context(struct fs_context *fc)
 {
+	fc_init_pseudo(fc);
 	fc->ops = &smk_context_ops;
 	return 0;
 }
diff --git a/tools/testing/selftests/filesystems/.gitignore b/tools/testing/selftests/filesystems/.gitignore
index cf79000e4092a1..8df38eabb1252d 100644
--- a/tools/testing/selftests/filesystems/.gitignore
+++ b/tools/testing/selftests/filesystems/.gitignore
@@ -7,3 +7,4 @@ kernfs_test
 idmapped_tmpfile
 ustat_test
 rw_hint_test
+pseudo_backing_test
diff --git a/tools/testing/selftests/filesystems/Makefile b/tools/testing/selftests/filesystems/Makefile
index fbd5c27505ef58..0ebb9005bcd289 100644
--- a/tools/testing/selftests/filesystems/Makefile
+++ b/tools/testing/selftests/filesystems/Makefile
@@ -2,7 +2,7 @@
 
 CFLAGS += $(KHDR_INCLUDES)
 TEST_GEN_PROGS := devpts_pts anon_inode_test kernfs_test fclog ustat_test rw_hint_test
-TEST_GEN_PROGS += idmapped_tmpfile
+TEST_GEN_PROGS += idmapped_tmpfile pseudo_backing_test
 TEST_GEN_PROGS_EXTENDED := dnotify_test
 
 include ../lib.mk
diff --git a/tools/testing/selftests/filesystems/config b/tools/testing/selftests/filesystems/config
index 9f45bc493a30a8..228196160d29f8 100644
--- a/tools/testing/selftests/filesystems/config
+++ b/tools/testing/selftests/filesystems/config
@@ -6,3 +6,12 @@ CONFIG_NET=y
 CONFIG_NET_NS=y
 CONFIG_INET=y
 CONFIG_SYSFS=y
+CONFIG_BLK_DEV_LOOP=y
+CONFIG_OVERLAY_FS=y
+CONFIG_TMPFS=y
+CONFIG_CONFIGFS_FS=y
+CONFIG_USB_GADGET=y
+CONFIG_USB_CONFIGFS=y
+CONFIG_USB_CONFIGFS_MASS_STORAGE=y
+CONFIG_EROFS_FS=y
+CONFIG_EROFS_FS_BACKED_BY_FILE=y
diff --git a/tools/testing/selftests/filesystems/pseudo_backing_test.c b/tools/testing/selftests/filesystems/pseudo_backing_test.c
new file mode 100644
index 00000000000000..bc8e17ab8e6ea3
--- /dev/null
+++ b/tools/testing/selftests/filesystems/pseudo_backing_test.c
@@ -0,0 +1,274 @@
+// SPDX-License-Identifier: GPL-2.0
+#define _GNU_SOURCE
+
+#include <errno.h>
+#include <fcntl.h>
+#include <limits.h>
+#include <sched.h>
+#include <stdbool.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <unistd.h>
+#include <linux/loop.h>
+#include <linux/magic.h>
+#include <sys/ioctl.h>
+#include <sys/mman.h>
+#include <sys/mount.h>
+#include <sys/stat.h>
+#include <sys/vfs.h>
+
+#include "kselftest_harness.h"
+#include "wrappers.h"
+
+/*
+ * Put @fd behind a free loop device. The device is set up with
+ * LO_FLAGS_AUTOCLEAR and goes away again when it is closed here.
+ */
+static int loop_attach(int fd, bool rw, char *dev, size_t len)
+{
+	struct loop_config cfg = {};
+	int ctl, nr, lfd, ret = 0;
+
+	ctl = open("/dev/loop-control", O_RDWR | O_CLOEXEC);
+	if (ctl < 0)
+		return -errno;
+	nr = ioctl(ctl, LOOP_CTL_GET_FREE);
+	if (nr < 0)
+		ret = -errno;
+	close(ctl);
+	if (ret)
+		return ret;
+
+	snprintf(dev, len, "/dev/loop%d", nr);
+	lfd = open(dev, (rw ? O_RDWR : O_RDONLY) | O_CLOEXEC);
+	if (lfd < 0)
+		return -errno;
+
+	cfg.fd = fd;
+	cfg.info.lo_flags = LO_FLAGS_AUTOCLEAR;
+	if (!rw)
+		cfg.info.lo_flags |= LO_FLAGS_READ_ONLY;
+	if (ioctl(lfd, LOOP_CONFIGURE, &cfg)) {
+		ret = -errno;
+		close(lfd);
+	} else {
+		ret = lfd;
+	}
+	return ret;
+}
+
+static int attach_path(const char *path, bool rw)
+{
+	char dev[PATH_MAX];
+	int fd, ret;
+
+	fd = open(path, (rw ? O_RDWR : O_RDONLY) | O_CLOEXEC);
+	if (fd < 0)
+		return -errno;
+	ret = loop_attach(fd, rw, dev, sizeof(dev));
+	close(fd);
+	if (ret >= 0) {
+		close(ret);
+		ret = 0;
+	}
+	return ret;
+}
+
+static bool can_use_loop(void)
+{
+	return geteuid() == 0 && access("/dev/loop-control", R_OK | W_OK) == 0;
+}
+
+TEST(memfd_backing_file)
+{
+	char dev[PATH_MAX];
+	int fd, lfd;
+
+	if (!can_use_loop())
+		SKIP(return, "loop devices unavailable");
+
+	fd = memfd_create("pseudo_backing_test", MFD_CLOEXEC);
+	ASSERT_GE(fd, 0);
+	ASSERT_EQ(ftruncate(fd, 1 << 20), 0);
+
+	lfd = loop_attach(fd, true, dev, sizeof(dev));
+	ASSERT_GE(lfd, 0);
+	EXPECT_EQ(close(lfd), 0);
+	EXPECT_EQ(close(fd), 0);
+}
+
+TEST(loop_device_backing_file)
+{
+	char dev[PATH_MAX], dev2[PATH_MAX];
+	int fd, lfd, bfd, lfd2;
+
+	if (!can_use_loop())
+		SKIP(return, "loop devices unavailable");
+
+	fd = memfd_create("pseudo_backing_test", MFD_CLOEXEC);
+	ASSERT_GE(fd, 0);
+	ASSERT_EQ(ftruncate(fd, 1 << 20), 0);
+	lfd = loop_attach(fd, true, dev, sizeof(dev));
+	ASSERT_GE(lfd, 0);
+
+	/* A block device stays fine as a backing file. */
+	bfd = open(dev, O_RDWR | O_CLOEXEC);
+	ASSERT_GE(bfd, 0);
+	lfd2 = loop_attach(bfd, true, dev2, sizeof(dev2));
+	ASSERT_GE(lfd2, 0);
+
+	EXPECT_EQ(close(lfd2), 0);
+	EXPECT_EQ(close(bfd), 0);
+	EXPECT_EQ(close(lfd), 0);
+	EXPECT_EQ(close(fd), 0);
+}
+
+TEST(write_only_backing_file)
+{
+	char dev[PATH_MAX], path[PATH_MAX];
+	int fd, wfd, lfd;
+
+	if (!can_use_loop())
+		SKIP(return, "loop devices unavailable");
+
+	fd = memfd_create("pseudo_backing_test", MFD_CLOEXEC);
+	ASSERT_GE(fd, 0);
+	ASSERT_EQ(ftruncate(fd, 1 << 20), 0);
+
+	/* Loop reads from its backing file so it must be open for reading. */
+	snprintf(path, sizeof(path), "/proc/self/fd/%d", fd);
+	wfd = open(path, O_WRONLY | O_CLOEXEC);
+	ASSERT_GE(wfd, 0);
+
+	lfd = loop_attach(wfd, true, dev, sizeof(dev));
+	if (lfd >= 0)
+		close(lfd);
+	EXPECT_EQ(lfd, -EBADF);
+	EXPECT_EQ(close(wfd), 0);
+	EXPECT_EQ(close(fd), 0);
+}
+
+TEST(procfs_backing_file)
+{
+	if (!can_use_loop())
+		SKIP(return, "loop devices unavailable");
+
+	ASSERT_EQ(attach_path("/proc/cpuinfo", false), -EINVAL);
+}
+
+TEST(sysfs_backing_file)
+{
+	if (!can_use_loop())
+		SKIP(return, "loop devices unavailable");
+
+	ASSERT_EQ(attach_path("/sys/kernel/warn_count", false), -EINVAL);
+
+	if (access("/sys/kernel/reboot/mode", F_OK))
+		SKIP(return, "no /sys/kernel/reboot/mode");
+	ASSERT_EQ(attach_path("/sys/kernel/reboot/mode", true), -EINVAL);
+}
+
+TEST(overlayfs_on_sysfs_backing_file)
+{
+	if (!can_use_loop())
+		SKIP(return, "loop devices unavailable");
+
+	ASSERT_EQ(unshare(CLONE_NEWNS), 0);
+	ASSERT_EQ(mount(NULL, "/", NULL, MS_REC | MS_PRIVATE, NULL), 0);
+	ASSERT_EQ(mount("tmpfs", "/tmp", "tmpfs", 0, NULL), 0);
+	ASSERT_EQ(mkdir("/tmp/empty", 0755), 0);
+	ASSERT_EQ(mkdir("/tmp/merged", 0755), 0);
+
+	/* A lower-only overlayfs serves reads from sysfs. */
+	if (mount("overlay", "/tmp/merged", "overlay", MS_RDONLY,
+		  "lowerdir=/sys/kernel:/tmp/empty"))
+		SKIP(return, "no overlayfs on top of sysfs: %s", strerror(errno));
+
+	ASSERT_EQ(attach_path("/tmp/merged/warn_count", false), -EINVAL);
+}
+
+#define CONFIGFS_DIR "/sys/kernel/config"
+#define GADGET_DIR CONFIGFS_DIR "/usb_gadget/pseudo_backing_test"
+#define MASS_STORAGE_DIR GADGET_DIR "/functions/mass_storage.0"
+
+TEST(usb_mass_storage_backing_file)
+{
+	const char *path = "/sys/kernel/warn_count";
+	struct statfs sfs;
+	ssize_t ret;
+	int fd, err;
+
+	if (geteuid())
+		SKIP(return, "needs root");
+
+	/* Mounting configfs on top of itself fails with EBUSY. */
+	if (statfs(CONFIGFS_DIR, &sfs) || sfs.f_type != CONFIGFS_MAGIC) {
+		ASSERT_EQ(unshare(CLONE_NEWNS), 0);
+		ASSERT_EQ(mount(NULL, "/", NULL, MS_REC | MS_PRIVATE, NULL), 0);
+		if (mount("configfs", CONFIGFS_DIR, "configfs", 0, NULL))
+			SKIP(return, "no configfs: %s", strerror(errno));
+	}
+
+	if (mkdir(GADGET_DIR, 0755))
+		SKIP(return, "no usb gadget configfs: %s", strerror(errno));
+	if (mkdir(MASS_STORAGE_DIR, 0755)) {
+		err = errno;
+		rmdir(GADGET_DIR);
+		SKIP(return, "no usb mass storage function: %s", strerror(err));
+	}
+
+	/* Writing the path opens the LUN's backing file right away. */
+	fd = open(MASS_STORAGE_DIR "/lun.0/file", O_WRONLY | O_CLOEXEC);
+	EXPECT_GE(fd, 0);
+	if (fd >= 0) {
+		ret = write(fd, path, strlen(path));
+		err = errno;
+		EXPECT_EQ(ret, -1);
+		EXPECT_EQ(err, EINVAL);
+		EXPECT_EQ(close(fd), 0);
+	}
+
+	EXPECT_EQ(rmdir(MASS_STORAGE_DIR), 0);
+	EXPECT_EQ(rmdir(GADGET_DIR), 0);
+}
+
+TEST(erofs_backing_file)
+{
+	bool refused = false;
+	char buf[256];
+	int fsfd, ret, err;
+	ssize_t n;
+
+	if (geteuid())
+		SKIP(return, "needs root");
+
+	fsfd = sys_fsopen("erofs", FSOPEN_CLOEXEC);
+	if (fsfd < 0)
+		SKIP(return, "no erofs: %s", strerror(errno));
+
+	ASSERT_EQ(sys_fsconfig(fsfd, FSCONFIG_SET_STRING, "source",
+			       "/sys/kernel/warn_count", 0), 0);
+	ret = sys_fsconfig(fsfd, FSCONFIG_CMD_CREATE, NULL, NULL, 0);
+	err = errno;
+	if (ret && err == ENOTBLK) {
+		close(fsfd);
+		SKIP(return, "no file-backed erofs mounts");
+	}
+	ASSERT_EQ(ret, -1);
+	ASSERT_EQ(err, EINVAL);
+
+	/*
+	 * Something that isn't an erofs image fails with EINVAL as well so
+	 * check that the source itself was refused.
+	 */
+	while ((n = read(fsfd, buf, sizeof(buf) - 1)) > 0) {
+		buf[n] = '\0';
+		if (strstr(buf, "pseudo filesystem"))
+			refused = true;
+	}
+	EXPECT_TRUE(refused);
+	EXPECT_EQ(close(fsfd), 0);
+}
+
+TEST_HARNESS_MAIN

3/2 2026/11/13 12:16 llm patch-evaluator
1m Model:
gemini-3.8-flash

Args:
null

Results:
null

Tokens:
							input: 18378
							output: 27
							thoughts: 2226
						

Thoughts:
**Patch Evaluation: Syzkaller Fuzzing Suitability**

Alright, let's break this down. My goal is to determine if this patch warrants fuzzing with syzkaller, keeping in mind the established guidelines. First, I'm noting the clear intention: This patch is about preventing the use of regular files from "pseudo" filesystems (proc, sysfs, debugfs, bpf, etc.) as backing files for loop, target, NVMe, erofs, FUSE, and USB mass storage. The fundamental problem is that these pseudo files aren't normal storage and using them this way could trigger serious issues.

Now, let's dissect the modifications. I see changes in `include/linux/fs.h`, `include/linux/fs/super_types.h`, and `include/linux/pseudo_fs.h`. `file_is_pseudo` is the key function here, along with the `SB_I_PSEUDO` flag. The patch then propagates this logic to numerous filesystems: loop, erofs, target, FUSE, NVMe-oF, and USB gadget mass storage, along with numerous psuedofilesystems: `kernfs`, `procfs`, `bpf`, `devpts`, `tracefs`, and so on.

Now, the crucial question: Is this syzkaller-worthy? Following the "positive criteria," this *should* be a "yes." The patch dives deep into VFS, touches the loop device, has interaction with erofs, target core, FUSE, NVMe, USB mass storage... all of which are, of course, reachable on amd64 in a syzkaller context. The patch modifies VFS, loop device, erofs, FUSE, NVMe, and USB mass storage directly!

But there's an interesting detail. In many filesystems, `fc_init_pseudo(fc)` is called to set `SB_I_PSEUDO | SB_I_NOEXEC | SB_I_NODEV`. Where this was previously done in `fill_super` calls, it is now performed in `init_fs_context` or `kernfs_get_tree`. Wait, I need to understand how this flag is propagated from `fc->s_iflags` to `sb->s_iflags`. I need to ensure that the pseudo filesystem superblock is, in fact, getting the right flags. I need to grep for the flag propagation now.

So, in conclusion... YES, this is almost certainly worth fuzzing. It's a fundamental change with potential for serious consequences if not handled correctly. I just need to verify how `fc->s_iflags` and `sb->s_iflags` interact. Then, syzkaller it is.



4/2 2026/11/13 12:17 tool grepper
0m Args:
{
  "Expression": "s_iflags",
  "PathPrefixes": [
    "fs/"
  ]
}

Results:
{
  "Output": "\nFull output is too long, showing 200 out of 604 lines.\nUse more precise expression or PathPrefixes if possible.\n\nNumber of matching lines per file (37 files in total):\nfs/btrfs/super.c:1\nfs/devpts/inode.c:1\nfs/erofs/super.c:1\nfs/exec.c:2\nfs/ext2/super.c:1\nfs/ext4/super.c:2\nfs/f2fs/file.c:2\nfs/f2fs/super.c:1\nfs/fs-writeback.c:1\nfs/fuse/dir.c:1\nfs/fuse/inode.c:5\nfs/fuse/req.c:1\nfs/inode.c:1\nfs/namei.c:1\nfs/namespace.c:9\nfs/nfs/fs_context.c:1\nfs/nfs/super.c:1\nfs/notify/fanotify/fanotify_user.c:1\nfs/overlayfs/super.c:3\nfs/proc/root.c:1\nfs/super.c:9\nfs/sync.c:1\nfs/xfs/libxfs/xfs_inode_buf.c:1\nfs/xfs/libxfs/xfs_trans_inode.c:2\nfs/xfs/scrub/tempfile.c:3\nfs/xfs/xfs_aops.c:2\nfs/xfs/xfs_file.c:7\nfs/xfs/xfs_health.c:1\nfs/xfs/xfs_icache.c:15\nfs/xfs/xfs_inode.c:17\nfs/xfs/xfs_inode.h:10\nfs/xfs/xfs_inode_item.c:10\nfs/xfs/xfs_iops.c:1\nfs/xfs/xfs_log_recover.c:2\nfs/xfs/xfs_qm.c:1\nfs/xfs/xfs_reflink.c:1\nfs/xfs/xfs_super.c:1\n\nfs/btrfs/super.c=946=static int btrfs_fill_super(struct super_block *sb,\n--\nfs/btrfs/super.c-962-\tsb-\u003es_time_gran = 1;\nfs/btrfs/super.c:963:\tsb-\u003es_iflags |= SB_I_CGROUPWB | SB_I_ALLOW_HSM;\nfs/btrfs/super.c-964-\n--\nfs/devpts/inode.c=363=static int devpts_fill_super(struct super_block *s, struct fs_context *fc)\n--\nfs/devpts/inode.c-367-\nfs/devpts/inode.c:368:\ts-\u003es_iflags \u0026= ~SB_I_NODEV;\nfs/devpts/inode.c-369-\ts-\u003es_blocksize = 1024;\n--\nfs/erofs/super.c=819=static int erofs_sb_share_test_super(struct super_block *sb,\n--\nfs/erofs/super.c-824-\nfs/erofs/super.c:825:\tif (sb-\u003es_iflags \u0026 SB_I_RETIRED)\nfs/erofs/super.c-826-\t\treturn 0;\n--\nfs/exec.c=117=bool path_noexec(const struct path *path)\n--\nfs/exec.c-120-\tVFS_WARN_ON_ONCE(IS_ANON_FILE(d_inode(path-\u003edentry)) \u0026\u0026\nfs/exec.c:121:\t\t\t !(path-\u003emnt-\u003emnt_sb-\u003es_iflags \u0026 SB_I_NOEXEC));\nfs/exec.c-122-\treturn (path-\u003emnt-\u003emnt_flags \u0026 MNT_NOEXEC) ||\nfs/exec.c:123:\t       (path-\u003emnt-\u003emnt_sb-\u003es_iflags \u0026 SB_I_NOEXEC);\nfs/exec.c-124-}\n--\nfs/ext2/super.c=867=static int ext2_fill_super(struct super_block *sb, struct fs_context *fc)\n--\nfs/ext2/super.c-944-\t\t(test_opt(sb, POSIX_ACL) ? SB_POSIXACL : 0);\nfs/ext2/super.c:945:\tsb-\u003es_iflags |= SB_I_CGROUPWB;\nfs/ext2/super.c-946-\n--\nfs/ext4/super.c=5099=static int ext4_check_journal_data_mode(struct super_block *sb)\n--\nfs/ext4/super.c-5126-\t} else {\nfs/ext4/super.c:5127:\t\tsb-\u003es_iflags |= SB_I_CGROUPWB;\nfs/ext4/super.c-5128-\t}\n--\nfs/ext4/super.c=5400=static int __ext4_fill_super(struct fs_context *fc, struct super_block *sb)\n--\nfs/ext4/super.c-5479-\t/* HSM events are allowed by default. */\nfs/ext4/super.c:5480:\tsb-\u003es_iflags |= SB_I_ALLOW_HSM;\nfs/ext4/super.c-5481-\n--\nfs/f2fs/file.c=2291=static const struct {\n--\nfs/f2fs/file.c-2337-/* Convert f2fs on-disk i_flags to FS_IOC_{GET,SET}FLAGS flags */\nfs/f2fs/file.c:2338:static inline u32 f2fs_iflags_to_fsflags(u32 iflags)\nfs/f2fs/file.c-2339-{\n--\nfs/f2fs/file.c=3574=int f2fs_fileattr_get(struct dentry *dentry, struct file_kattr *fa)\n--\nfs/f2fs/file.c-3577-\tstruct f2fs_inode_info *fi = F2FS_I(inode);\nfs/f2fs/file.c:3578:\tu32 fsflags = f2fs_iflags_to_fsflags(fi-\u003ei_flags);\nfs/f2fs/file.c-3579-\n--\nfs/f2fs/super.c=5204=static int f2fs_fill_super(struct super_block *sb, struct fs_context *fc)\n--\nfs/f2fs/super.c-5337-\tsuper_set_sysfs_name_bdev(sb);\nfs/f2fs/super.c:5338:\tsb-\u003es_iflags |= SB_I_CGROUPWB;\nfs/f2fs/super.c-5339-\n--\nfs/fs-writeback.c=3035=void sync_inodes_sb(struct super_block *sb)\n--\nfs/fs-writeback.c-3061-\t */\nfs/fs-writeback.c:3062:\tif (sb-\u003es_iflags \u0026 SB_I_NO_DATA_INTEGRITY) {\nfs/fs-writeback.c-3063-\t\twakeup_flusher_threads_bdi(bdi, WB_REASON_SYNC);\n--\nfs/fuse/dir.c=1709=static int fuse_access(struct inode *inode, int mask)\n--\nfs/fuse/dir.c-1723-\t */\nfs/fuse/dir.c:1724:\tWARN_ON_ONCE(!(fm-\u003esb-\u003es_iflags \u0026 SB_I_NOIDMAP));\nfs/fuse/dir.c-1725-\n--\nfs/fuse/inode.c=1300=static void process_init_reply(struct fuse_args *args, int error)\n--\nfs/fuse/inode.c-1435-\t\t\t\tif (fc-\u003edefault_permissions)\nfs/fuse/inode.c:1436:\t\t\t\t\tfm-\u003esb-\u003es_iflags \u0026= ~SB_I_NOIDMAP;\nfs/fuse/inode.c-1437-\t\t\t\telse\n--\nfs/fuse/inode.c=1640=static void fuse_sb_defaults(struct super_block *sb)\n--\nfs/fuse/inode.c-1647-\tsb-\u003es_export_op = \u0026fuse_export_operations;\nfs/fuse/inode.c:1648:\tsb-\u003es_iflags |= SB_I_IMA_UNVERIFIABLE_SIGNATURE;\nfs/fuse/inode.c:1649:\tsb-\u003es_iflags |= SB_I_NOIDMAP;\nfs/fuse/inode.c:1650:\tsb-\u003es_iflags |= SB_I_NO_DATA_INTEGRITY;\nfs/fuse/inode.c-1651-\tif (sb-\u003es_user_ns != \u0026init_user_ns)\nfs/fuse/inode.c:1652:\t\tsb-\u003es_iflags |= SB_I_UNTRUSTED_MOUNTER;\nfs/fuse/inode.c-1653-\tsb-\u003es_flags \u0026= ~(SB_NOSEC | SB_I_VERSION);\n--\nfs/fuse/req.c=6=static int fuse_fill_creds(struct fuse_mount *fm, struct fuse_args *args,\n--\nfs/fuse/req.c-9-\tstruct fuse_conn *fc = fm-\u003efc;\nfs/fuse/req.c:10:\tbool no_idmap = !fm-\u003esb || (fm-\u003esb-\u003es_iflags \u0026 SB_I_NOIDMAP);\nfs/fuse/req.c-11-\tkuid_t fsuid = mapped_fsuid(idmap, fc-\u003euser_ns);\n--\nfs/inode.c=223=int inode_init_always_gfp(struct super_block *sb, struct inode *inode, gfp_t gfp)\n--\nfs/inode.c-283-\t\t\t\t   \"mapping.invalidate_lock\");\nfs/inode.c:284:\tif (sb-\u003es_iflags \u0026 SB_I_STABLE_WRITES)\nfs/inode.c-285-\t\tmapping_set_stable_writes(mapping);\n--\nfs/namei.c=4231=bool may_open_dev(const struct path *path)\n--\nfs/namei.c-4233-\treturn !(path-\u003emnt-\u003emnt_flags \u0026 MNT_NODEV) \u0026\u0026\nfs/namei.c:4234:\t\t!(path-\u003emnt-\u003emnt_sb-\u003es_iflags \u0026 SB_I_NODEV);\nfs/namei.c-4235-}\n--\nfs/namespace.c=3435=static void mnt_warn_timestamp_expiry(const struct path *mountpoint,\n--\nfs/namespace.c-3440-\tif (!__mnt_is_readonly(mnt) \u0026\u0026\nfs/namespace.c:3441:\t   (!(sb-\u003es_iflags \u0026 SB_I_TS_EXPIRY_WARNED)) \u0026\u0026\nfs/namespace.c-3442-\t   (ktime_get_real_seconds() + TIME_UPTIME_SEC_MAX \u003e sb-\u003es_time_max)) {\n--\nfs/namespace.c-3458-\nfs/namespace.c:3459:\t\tsb-\u003es_iflags |= SB_I_TS_EXPIRY_WARNED;\nfs/namespace.c-3460-\t\t__putname(buf);\n--\nfs/namespace.c=4975=static int can_idmap_mount(const struct mount_kattr *kattr, struct mount *mnt)\n--\nfs/namespace.c-5001-\t/* The filesystem has turned off idmapped mounts. */\nfs/namespace.c:5002:\tif (m-\u003emnt_sb-\u003es_iflags \u0026 SB_I_NOIDMAP)\nfs/namespace.c-5003-\t\treturn -EINVAL;\n--\nfs/namespace.c=6583=static bool mnt_already_visible(struct mnt_namespace *ns,\n--\nfs/namespace.c-6606-\t\t */\nfs/namespace.c:6607:\t\tif (sb_visible-\u003es_iflags \u0026 SB_I_RESTRICTED_VARIANT)\nfs/namespace.c-6608-\t\t\tcontinue;\n--\nfs/namespace.c=6649=static bool mount_too_revealing(const struct super_block *sb, int *new_mnt_flags)\n--\nfs/namespace.c-6652-\tstruct mnt_namespace *ns = current-\u003ensproxy-\u003emnt_ns;\nfs/namespace.c:6653:\tunsigned long s_iflags;\nfs/namespace.c-6654-\n--\nfs/namespace.c-6661-\nfs/namespace.c:6662:\ts_iflags = sb-\u003es_iflags;\nfs/namespace.c:6663:\tif ((s_iflags \u0026 required_iflags) != required_iflags) {\nfs/namespace.c:6664:\t\tWARN_ONCE(1, \"Expected s_iflags to contain 0x%lx\\n\",\nfs/namespace.c-6665-\t\t\t  required_iflags);\n--\nfs/namespace.c-6672-\t */\nfs/namespace.c:6673:\tif (s_iflags \u0026 SB_I_RESTRICTED_VARIANT)\nfs/namespace.c-6674-\t\treturn false;\n--\nfs/nfs/fs_context.c=1692=static int nfs_init_fs_context(struct fs_context *fc)\n--\nfs/nfs/fs_context.c-1760-\nfs/nfs/fs_context.c:1761:\t\tfc-\u003es_iflags\t\t|= SB_I_STABLE_WRITES;\nfs/nfs/fs_context.c-1762-\t}\n--\nfs/nfs/super.c=1047=static void nfs_fill_super(struct super_block *sb, struct nfs_fs_context *ctx)\n--\nfs/nfs/super.c-1076-\tcase 4:\nfs/nfs/super.c:1077:\t\tsb-\u003es_iflags |= SB_I_NOUMASK;\nfs/nfs/super.c-1078-\t\tsb-\u003es_time_gran = 1;\n--\nfs/notify/fanotify/fanotify_user.c=1803=static int fanotify_events_supported(struct fsnotify_group *group,\n--\nfs/notify/fanotify/fanotify_user.c-1818-\tif (mask \u0026 FANOTIFY_PRE_CONTENT_EVENTS) {\nfs/notify/fanotify/fanotify_user.c:1819:\t\tif (!(path-\u003emnt-\u003emnt_sb-\u003es_iflags \u0026 SB_I_ALLOW_HSM))\nfs/notify/fanotify/fanotify_user.c-1820-\t\t\treturn -EOPNOTSUPP;\n--\nfs/overlayfs/super.c=1415=static int ovl_fill_super_creds(struct fs_context *fc, struct super_block *sb)\n--\nfs/overlayfs/super.c-1563-#endif\nfs/overlayfs/super.c:1564:\tsb-\u003es_iflags |= SB_I_SKIP_SYNC;\nfs/overlayfs/super.c-1565-\t/*\n--\nfs/overlayfs/super.c-1569-\t */\nfs/overlayfs/super.c:1570:\tsb-\u003es_iflags |= SB_I_NOUMASK;\nfs/overlayfs/super.c:1571:\tsb-\u003es_iflags |= SB_I_EVM_HMAC_UNSUPPORTED;\nfs/overlayfs/super.c-1572-\n--\nfs/proc/root.c=252=static int proc_fill_super(struct super_block *s, struct fs_context *fc)\n--\nfs/proc/root.c-277-\tif (fs_info-\u003epidonly == PROC_PIDONLY_ON)\nfs/proc/root.c:278:\t\ts-\u003es_iflags |= SB_I_RESTRICTED_VARIANT;\nfs/proc/root.c-279-\n--\nfs/super.c=319=static struct super_block *alloc_super(struct file_system_type *type, int flags,\n--\nfs/super.c-360-\tif (s-\u003es_user_ns != \u0026init_user_ns)\nfs/super.c:361:\t\ts-\u003es_iflags |= SB_I_NODEV;\nfs/super.c-362-\tINIT_HLIST_NODE(\u0026s-\u003es_instances);\n--\nfs/super.c=668=void retire_super(struct super_block *sb)\n--\nfs/super.c-671-\t__super_lock_excl(sb);\nfs/super.c:672:\tif (sb-\u003es_iflags \u0026 SB_I_PERSB_BDI) {\nfs/super.c-673-\t\tbdi_unregister(sb-\u003es_bdi);\nfs/super.c:674:\t\tsb-\u003es_iflags \u0026= ~SB_I_PERSB_BDI;\nfs/super.c-675-\t}\nfs/super.c:676:\tsb-\u003es_iflags |= SB_I_RETIRED;\nfs/super.c-677-\tsuper_unlock_excl(sb);\n--\nfs/super.c=695=void generic_shutdown_super(struct super_block *sb)\n--\nfs/super.c-761-\tif (sb-\u003es_bdi != \u0026noop_backing_dev_info) {\n\n"
}

5/2 2026/11/13 12:17 llm patch-evaluator
0m Model:
gemini-3.8-flash

Args:
null

Results:
null

Tokens:
							input: 25731
							output: 29
							thoughts: 46
						

Thoughts:
Here's my thought process, as if I were considering this myself:

**Investigating Superblock Flag Usage**

Okay, so I need to understand how `fc->s_iflags` is being utilized within the filesystem code. My immediate thought is to check within the superblock and filesystem context, specifically looking at the files `fs/super.c` and `fs/fs_context.c`. I expect to find some key references in there.

To accelerate this, I'll leverage `grep`. I'll execute a search for instances of `s_iflags` within the entire `fs/` directory. That should give me a concise list of uses, and I can then quickly examine the surrounding code to determine its specific purpose and meaning in each context. This is a common and efficient way to explore codebases when you're focusing on a particular variable or flag. From there, I can analyze the results and hopefully build a clear picture of how those flags affect the relevant superblocks.



6/2 2026/11/13 12:18 tool grepper
0m Args:
{
  "Expression": "fc-\u003es_iflags",
  "PathPrefixes": [
    "fs/"
  ]
}

Results:
{
  "Output": "fs/nfs/fs_context.c=1692=static int nfs_init_fs_context(struct fs_context *fc)\n--\nfs/nfs/fs_context.c-1760-\nfs/nfs/fs_context.c:1761:\t\tfc-\u003es_iflags\t\t|= SB_I_STABLE_WRITES;\nfs/nfs/fs_context.c-1762-\t}\n--\nfs/super.c=811=struct super_block *sget_fc(struct fs_context *fc,\n--\nfs/super.c-862-\ts-\u003es_type = fc-\u003efs_type;\nfs/super.c:863:\ts-\u003es_iflags |= fc-\u003es_iflags;\nfs/super.c-864-\tstrscpy(s-\u003es_id, s-\u003es_type-\u003ename, sizeof(s-\u003es_id));\n"
}

7/2 2026/11/13 12:18 llm patch-evaluator
1m Model:
gemini-3.8-flash

Args:
null

Results:
null

Tokens:
							input: 26255
							output: 34
							thoughts: 187
						

Thoughts:
Okay, let's break this down.

**Investigating Superblock Initialization and Flags**

Right, so I'm looking at `fs/super.c`, specifically line 863. I see `sget_fc`: `s->s_iflags |= fc->s_iflags;`. This is interesting because `sget_fc` seems to be responsible for copying flags from `fs_context` (`fc`) into the superblock (`s`). And, from what I'm seeing, `fc_init_pseudo` sets `fc->s_iflags` with `SB_I_PSEUDO | SB_I_NOEXEC | SB_I_NODEV`. So, essentially, when `sget_fc` runs, it's taking those flags (pseudo, noexec, nodev) and applying them to the superblock.

But then the critical question hits me: What happens if a filesystem doesn't actually *use* `sget_fc`? We can't assume that this is the *only* way superblocks are initialized. There's a lot of code, and a lot of ways to do things. It's a valid concern.

So, the next step is to examine the other superblock creation paths: `get_tree_nodev`, `get_tree_single`, `get_tree_keyed`, `mount_pseudo`, all of those. I need to make sure I understand all the potential superblock initialization pathways. Time to grep the codebase, and search for the direct calls to `sget_fc` *and* anything else that creates superblocks from a `fs_context`. I need a complete picture of the landscape to be sure.



8/2 2026/11/13 12:19 tool grepper
0m Args:
{
  "Expression": "sget_fc|alloc_super",
  "PathPrefixes": [
    "fs/super.c"
  ]
}

Results:
{
  "Output": "fs/super.c=298=static void destroy_unused_super(struct super_block *s)\n--\nfs/super.c-310-/**\nfs/super.c:311: *\talloc_super\t-\tcreate new superblock\nfs/super.c-312- *\t@type:\tfilesystem type superblock should belong to\n--\nfs/super.c-315- *\nfs/super.c:316: *\tAllocates and initializes a new \u0026struct super_block.  alloc_super()\nfs/super.c-317- *\treturns a pointer new superblock or %NULL if allocation had failed.\nfs/super.c-318- */\nfs/super.c:319:static struct super_block *alloc_super(struct file_system_type *type, int flags,\nfs/super.c-320-\t\t\t\t       struct user_namespace *user_ns)\n--\nfs/super.c-332-\t/*\nfs/super.c:333:\t * sget_fc() can have s_umount recursion.\nfs/super.c-334-\t *\n--\nfs/super.c=412=void put_super(struct super_block *s)\n--\nfs/super.c-431-/*\nfs/super.c:432: * Superblocks hashed by the devices they claim: s_dev from sget_fc() to\nfs/super.c-433- * kill_super_notify() and every block device opened through\n--\nfs/super.c=518=static void kill_super_notify(struct super_block *sb)\n--\nfs/super.c-525-\nfs/super.c:526:\t/* Drop sget_fc()'s claim on s_dev. */\nfs/super.c-527-\tsuper_dev_put(\u0026sb-\u003es_super_dev);\n--\nfs/super.c-530-\t * Let concurrent mounts know that this thing is really dead.\nfs/super.c:531:\t * sget_fc() skips SB_DEAD superblocks and calls test() under\nfs/super.c-532-\t * sb_lock, so set it under sb_lock: once we return no test()\n--\nfs/super.c=590=EXPORT_SYMBOL(deactivate_super);\n--\nfs/super.c-596- * Acquire a temporary reference on a superblock and try to trade it for\nfs/super.c:597: * an active reference. This is used in sget_fc() to wait for a\nfs/super.c-598- * superblock to either become SB_BORN or for it to pass through\n--\nfs/super.c=695=void generic_shutdown_super(struct super_block *sb)\n--\nfs/super.c-752-\t * superblock that it is dying. Every walker of @fs_supers outside\nfs/super.c:753:\t * of sget_fc() will now discard this superblock and treat it as\nfs/super.c-754-\t * dead.\nfs/super.c-755-\t *\nfs/super.c:756:\t * sget_fc() keeps finding the superblock until SB_DEAD is set, so\nfs/super.c-757-\t * a concurrent mounter waits until we passed sb-\u003ekill_sb().\n--\nfs/super.c=771=bool mount_capable(struct fs_context *fc)\n--\nfs/super.c-779-/**\nfs/super.c:780: * sget_fc - Find or create a superblock\nfs/super.c-781- * @fc:\tFilesystem context.\n--\nfs/super.c-810- */\nfs/super.c:811:struct super_block *sget_fc(struct fs_context *fc,\nfs/super.c-812-\t\t\t    int (*test)(struct super_block *, struct fs_context *),\n--\nfs/super.c-845-\nfs/super.c:846:\t\ts = alloc_super(fc-\u003efs_type, fc-\u003esb_flags, user_ns);\nfs/super.c-847-\t\tif (!s)\n--\nfs/super.c-893-}\nfs/super.c:894:EXPORT_SYMBOL(sget_fc);\nfs/super.c-895-\n--\nfs/super.c=1347=int get_tree_super(struct fs_context *fc,\n--\nfs/super.c-1354-\nfs/super.c:1355:\tsb = sget_fc(fc, test, set_anon_super_fc);\nfs/super.c-1356-\tif (IS_ERR(sb))\n--\nfs/super.c=1439=struct super_block *sget_dev(struct fs_context *fc, dev_t dev)\n--\nfs/super.c-1441-\tfc-\u003esget_key = \u0026dev;\nfs/super.c:1442:\treturn sget_fc(fc, super_s_dev_test, super_s_dev_set);\nfs/super.c-1443-}\n--\nfs/super.c=1734=int setup_bdev_super(struct super_block *sb, int sb_flags,\n--\nfs/super.c-1758-\nfs/super.c:1759:\t/* sget_fc() hashed @sb, super_dev_lock orders that against bdev_freeze(). */\nfs/super.c-1760-\tif (atomic_read(\u0026bdev-\u003ebd_fsfreeze_count) \u003e 0) {\n"
}

9/2 2026/11/13 12:19 llm patch-evaluator
1m Model:
gemini-3.8-flash

Args:
null

Results:
null

Tokens:
							input: 28253
							output: 34
							thoughts: 275
						

Thoughts:
**My Analysis of the `get_tree_*` Functions**

Okay, so `get_tree_super` calls `sget_fc`. Got it. And it looks like all those other `get_tree_*` functions, like `get_tree_nodev`, `get_tree_single`, `get_tree_keyed`, they all funnel down to `sget_fc`. That's a reasonable design, I suppose, trying to share code where you can. Now, I'm curious what `init_pseudo` is doing in all of this. It's probably important, so let's dig into `fs/libfs.c`.

Right, `init_pseudo` takes a `fs_context` and a magic number. It allocates a `pseudo_fs_context`, sets the magic, attaches it to the `fs_context` through `fs_private`, assigns `pseudo_fs_context_ops`, sets some flags and calls `fc_init_pseudo`. Finally, it sets the `global` flag. This seems pretty standard for setting up file system context, but I want to understand how it interfaces with what `sget_fc` may be doing with it. I suppose it's the `pseudo_fs_context_ops` that matters. So, what's `pseudo_fs_context_ops`' role in the creation of a superblock? Let's check that out in `fs/libfs.c` as well.



10/2 2026/11/13 12:20 tool grepper
0m Args:
{
  "Expression": "pseudo_fs_context_ops",
  "PathPrefixes": [
    "fs/libfs.c"
  ]
}

Results:
{
  "Output": "fs/libfs.c=713=static void pseudo_fs_free(struct fs_context *fc)\n--\nfs/libfs.c-717-\nfs/libfs.c:718:static const struct fs_context_operations pseudo_fs_context_ops = {\nfs/libfs.c-719-\t.free\t\t= pseudo_fs_free,\n--\nfs/libfs.c=727=struct pseudo_fs_context *init_pseudo(struct fs_context *fc,\n--\nfs/libfs.c-735-\t\tfc-\u003efs_private = ctx;\nfs/libfs.c:736:\t\tfc-\u003eops = \u0026pseudo_fs_context_ops;\nfs/libfs.c-737-\t\tfc-\u003esb_flags |= SB_NOUSER;\n"
}

11/2 2026/11/13 12:20 llm patch-evaluator
0m Model:
gemini-3.8-flash

Args:
null

Results:
null

Tokens:
							input: 29086
							output: 34
							thoughts: 23
						

Thoughts:
Here's my take on those thoughts:

**Analyzing `pseudo_fs_context_ops` in `fs/libfs.c`**

Alright, let's dive straight in. I need to refresh my memory on the implementation details of this specific data structure, `pseudo_fs_context_ops`. I know it's defined within `fs/libfs.c`, and I should refresh on this, as I believe I know how it's used elsewhere, but want to make sure I am on the right track. Time to get down to brass tacks and inspect its core definition in the codebase. Let's see how it's structured and, more importantly, what methods it defines and how it interacts with other filesystem components. It's often the subtle interplay between structures that holds the key to understanding a module's function.



12/2 2026/11/13 12:21 tool read-file
0m Args:
{
  "File": "fs/libfs.c",
  "FirstLine": 710,
  "LineCount": 35
}

Results:
{
  "Contents": " 710:\t\treturn get_tree_nodev(fc, pseudo_fs_fill_super);\n 711:\t}\n 712:\t\n 713:\tstatic void pseudo_fs_free(struct fs_context *fc)\n 714:\t{\n 715:\t\tkfree(fc-\u003efs_private);\n 716:\t}\n 717:\t\n 718:\tstatic const struct fs_context_operations pseudo_fs_context_ops = {\n 719:\t\t.free\t\t= pseudo_fs_free,\n 720:\t\t.get_tree\t= pseudo_fs_get_tree,\n 721:\t};\n 722:\t\n 723:\t/*\n 724:\t * Common helper for pseudo-filesystems (sockfs, pipefs, bdev - stuff that\n 725:\t * will never be mountable)\n 726:\t */\n 727:\tstruct pseudo_fs_context *init_pseudo(struct fs_context *fc,\n 728:\t\t\t\t\t\tunsigned long magic)\n 729:\t{\n 730:\t\tstruct pseudo_fs_context *ctx;\n 731:\t\n 732:\t\tctx = kzalloc_obj(struct pseudo_fs_context);\n 733:\t\tif (likely(ctx)) {\n 734:\t\t\tctx-\u003emagic = magic;\n 735:\t\t\tfc-\u003efs_private = ctx;\n 736:\t\t\tfc-\u003eops = \u0026pseudo_fs_context_ops;\n 737:\t\t\tfc-\u003esb_flags |= SB_NOUSER;\n 738:\t\t\tfc_init_pseudo(fc);\n 739:\t\t\tfc-\u003eglobal = true;\n 740:\t\t}\n 741:\t\treturn ctx;\n 742:\t}\n 743:\tEXPORT_SYMBOL(init_pseudo);\n 744:\t\n"
}

13/2 2026/11/13 12:21 llm patch-evaluator
1m Model:
gemini-3.8-flash

Args:
null

Results:
null

Tokens:
							input: 29813
							output: 35
							thoughts: 1651
						

Thoughts:
**WorthFuzzing: Pseudo Filesystems and Backing Files**

Okay, so I've been digging into this code, and it's pretty clear this is something we *absolutely* need to fuzz. Let me walk you through my thought process.

First, I see that the `pseudo_fs_get_tree` function is crucial, as it calls `get_tree_nodev`, which in turn leads to `sget_fc`. This entire process is initiated by `init_pseudo`, which sets up `fc_init_pseudo`. Got it.

Now, this `file_is_pseudo` function... I need to understand it. Looking at `include/linux/fs.h`, it boils down to checking if an inode is a regular file and has the `SB_I_PSEUDO` flag set on its superblock. Critically, it uses `d_real_inode`, meaning it needs to traverse stack filesystems like `overlayfs`. Good to keep in mind.

Where is `file_is_pseudo` actually *used*? Okay, this is key. It's called from several places: `loop.c`, `zloop.c`, `nvme`, `target_core_file`, `storage_common.c`, `erofs`, and `fuse/backing.c`. This is all core functionality!

Specifically, I see that `loop_check_backing_file` now checks for this `file_is_pseudo` condition, as do `nvmet_file_ns_enable` and `fd_configure_device`. Essentially, if a file is marked as pseudo and doesn't meet certain requirements, it now returns `-EINVAL`. This is what I need to target.

*   **So, Is this fuzzer-worthy?**
    Absolutely YES! This touches core subsystems – VFS, block devices (loop devices, `zloop`), erofs, fuse, USB gadget, target/LIO, and NVMe.
*   Loop devices, filesystems are extensively tested and fuzzed.
*   The system calls `ioctl(loop_fd, LOOP_SET_FD, ...)` or `LOOP_CONFIGURE` call `loop_check_backing_file`.
*   Mount system calls (mount, fsopen, fsconfig, etc.) for erofs call `erofs_file_get_tree` / `erofs_init_device`.
*   Fuse backing file ioctl / open calls `fuse_backing_open_file`.
*   Configfs / USB gadget operations call `fsg_lun_open`.
*   Target / NVMet file operations.
*   Pseudo filesystem mounting logic (`kernfs`, `proc`, `sysfs`, `bpf`, `mqueue`, `binfmt_misc`, `devpts`, `securityfs`, `tracefs`, etc.) all now have `fc_init_pseudo` added, which changes their `s_iflags`. This removes direct settings of `SB_I_NOEXEC | SB_I_NODEV` from fill_super routines.

We've got all the criteria here: it's reachable executable code, it's touching core subsystems, and it's interacting with drivers accessible via virtual buses. This is precisely the kind of thing we want to target with fuzzing.

Now, the next thing I'm thinking about: potential bugs and interactions. I'm wondering if `d_real_inode` could be problematic with NULL or strange `file->f_path.dentry` values. We need to know how it interacts with `overlayfs`, making sure that functions that use it work as expected. And what about those pseudo filesystems that may depend on execution or devices, and if `fc_init_pseudo` has impacted this, and potentially created edge cases? I see something in `selinuxfs` about Android init opening null devices, and the code removing `SB_I_NODEV`. This, and how it effects other filesystems is something to consider.

According to the triage philosophy, this is definitely worth fuzzing: "Return WorthFuzzing=true whenever the patch touches reachable executable code".

So, now we have to figure out the right `FocusSymbols` and `EnableConfigs`. We need to be smart about this.

*   We're *avoiding* the very generic life-cycle functions that are called by every single program, and we don't want to list generic memory allocators, page fault and trap handlers, core synchronization primitives, etc.
*   We will want to *target* the specific feature logic and entrypoints.

The guideline is: we are *handling static inline functions in headers* and, because they lack distinct symbol addresses in `vmlinux`, we should identify non-static, feature-specific caller functions in `.c


14/2 2026/11/13 12:23 tool grepper
0m Args:
{
  "Expression": "loop_check_backing_file",
  "PathPrefixes": [
    "drivers/block/loop.c"
  ]
}

Results:
{
  "Output": "drivers/block/loop.c=518=static void loop_assign_backing_file(struct loop_device *lo, struct file *file)\n--\ndrivers/block/loop.c-528-\ndrivers/block/loop.c:529:static int loop_check_backing_file(struct file *file)\ndrivers/block/loop.c-530-{\n--\ndrivers/block/loop.c=908=static int loop_configure(struct loop_device *lo, blk_mode_t mode,\n--\ndrivers/block/loop.c-921-\ndrivers/block/loop.c:922:\terror = loop_check_backing_file(file);\ndrivers/block/loop.c-923-\tif (error) {\n"
}

15/2 2026/11/13 12:23 llm patch-evaluator
0m Model:
gemini-3.8-flash

Args:
null

Results:
null

Tokens:
							input: 32723
							output: 31
							thoughts: 11
						

Thoughts:
Okay, here's my take on those thoughts, tailored for an expert audience:

**Analyzing the `loop_configure` Call**

Right, let's dissect this. My primary thought is, "Okay, `loop_configure` is the key here. What functions or procedures are calling it?" I need to understand the control flow around that particular routine. I need to figure out where and how `loop_configure` is being called to establish its context within the broader system. I'm focusing on the call sites – knowing the callers provides critical information about the execution path, potential dependencies, and ultimately, the purpose this configuration step serves. This is about understanding the *why* of this particular configuration. This will give me an understanding of the conditions that trigger the reconfiguration. I'm particularly interested in possible side effects of that function. The architecture diagram is in my mind, so I'm trying to fit the pieces together to find this subroutine. I'm trying to understand the configuration model, and what changes or adaptations are possible.



16/2 2026/11/13 12:23 tool grepper
0m Args:
{
  "Expression": "loop_configure",
  "PathPrefixes": [
    "drivers/block/loop.c"
  ]
}

Results:
{
  "Output": "drivers/block/loop.c=96=static DEFINE_MUTEX(loop_validate_mutex);\n--\ndrivers/block/loop.c-107- * is_loop_device() is true, we need a global lock for serializing concurrent\ndrivers/block/loop.c:108: * loop_configure()/__loop_clr_fd() calls.\ndrivers/block/loop.c-109- */\n--\ndrivers/block/loop.c=493=static int loop_validate_file(struct file *file, struct block_device *bdev)\n--\ndrivers/block/loop.c-508-\t\t\treturn -EINVAL;\ndrivers/block/loop.c:509:\t\t/* Order wrt setting lo-\u003elo_backing_file in loop_configure(). */\ndrivers/block/loop.c-510-\t\trmb();\n--\ndrivers/block/loop.c=873=static void loop_update_limits(struct loop_device *lo, struct queue_limits *lim,\n--\ndrivers/block/loop.c-907-\ndrivers/block/loop.c:908:static int loop_configure(struct loop_device *lo, blk_mode_t mode,\ndrivers/block/loop.c-909-\t\t\t  struct block_device *bdev,\n--\ndrivers/block/loop.c-937-\tif (!(mode \u0026 BLK_OPEN_EXCL)) {\ndrivers/block/loop.c:938:\t\terror = bd_prepare_to_claim(bdev, loop_configure, NULL);\ndrivers/block/loop.c-939-\t\tif (error)\n--\ndrivers/block/loop.c-1025-\tif (!(mode \u0026 BLK_OPEN_EXCL))\ndrivers/block/loop.c:1026:\t\tbd_abort_claiming(bdev, loop_configure);\ndrivers/block/loop.c-1027-\n--\ndrivers/block/loop.c-1033-\tif (!(mode \u0026 BLK_OPEN_EXCL))\ndrivers/block/loop.c:1034:\t\tbd_abort_claiming(bdev, loop_configure);\ndrivers/block/loop.c-1035-out_putf:\n--\ndrivers/block/loop.c=1115=static int loop_clr_fd(struct loop_device *lo)\n--\ndrivers/block/loop.c-1120-\t * Since lo_ioctl() is called without locks held, it is possible that\ndrivers/block/loop.c:1121:\t * loop_configure() and loop_clr_fd() run in parallel.\ndrivers/block/loop.c-1122-\t *\n--\ndrivers/block/loop.c-1124-\t * make sure that loop_validate_file() will fail if the \"struct file\"\ndrivers/block/loop.c:1125:\t * which loop_configure() found via fget() was this loop device.\ndrivers/block/loop.c-1126-\t */\n--\ndrivers/block/loop.c=1441=static int lo_ioctl(struct block_device *bdev, blk_mode_t mode,\n--\ndrivers/block/loop.c-1459-\ndrivers/block/loop.c:1460:\t\treturn loop_configure(lo, mode, bdev, \u0026config);\ndrivers/block/loop.c-1461-\t}\n--\ndrivers/block/loop.c-1467-\ndrivers/block/loop.c:1468:\t\treturn loop_configure(lo, mode, bdev, \u0026config);\ndrivers/block/loop.c-1469-\t}\n"
}

17/2 2026/11/13 12:23 llm patch-evaluator
0m Model:
gemini-3.8-flash

Args:
null

Results:
null

Tokens:
							input: 33889
							output: 35
							thoughts: 212
						

Thoughts:
**Focusing on Block Device Initialization**

Okay, so I'm diving into this `drivers/block` stuff, specifically the `loop` driver. I see this function, `loop_configure`, in `drivers/block/loop.c`. It's used within `lo_ioctl`, specifically for `LOOP_CONFIGURE` and `LOOP_SET_FD`. My initial thought is to zero in on the `loop_check_backing_file` function. Could that be a useful focus symbol for my analysis?

Hmm, I need to verify something here. Can static functions like that actually be targeted as focus symbols? The Syzkaller/KCOV filters rely on symbol names as they appear in `vmlinux`, so I need to check the symbol table (via `nm vmlinux` or `/proc/kallsyms`). Now, `loop_check_backing_file` might be inlined. Even if it's static, GCC might inline it based on its size. However, `loop_configure` is definitely not inlined – it's a sizeable function, around 130 lines, and its address is passed to `bd_prepare_to_claim`.

But wait, what else might be important? I should also check what `zloop.c` has to offer. Specifically, I'm thinking about `zloop_init_zone`. Let me take a look at the callers of that function, as well.



18/2 2026/11/13 12:24 tool grepper
0m Args:
{
  "Expression": "zloop_init_zone",
  "PathPrefixes": [
    "drivers/block/zloop.c"
  ]
}

Results:
{
  "Output": "drivers/block/zloop.c=1062=static int zloop_get_block_size(struct zloop_device *zlo,\n--\ndrivers/block/zloop.c-1104-\ndrivers/block/zloop.c:1105:static int zloop_init_zone(struct zloop_device *zlo, struct zloop_options *opts,\ndrivers/block/zloop.c-1106-\t\t\t   unsigned int zone_no, bool restore)\n--\ndrivers/block/zloop.c=1215=static int zloop_ctl_add(struct zloop_options *opts)\n--\ndrivers/block/zloop.c-1311-\t * If we already have zone files, we are restoring a device created by a\ndrivers/block/zloop.c:1312:\t * previous add operation. In this case, zloop_init_zone() will check\ndrivers/block/zloop.c-1313-\t * that the zone files are consistent with the zone configuration given.\n--\ndrivers/block/zloop.c-1316-\tfor (i = 0; i \u003c nr_zones; i++) {\ndrivers/block/zloop.c:1317:\t\tret = zloop_init_zone(zlo, opts, i, restore);\ndrivers/block/zloop.c-1318-\t\tif (ret)\n"
}

19/2 2026/11/13 12:24 llm patch-evaluator
1m Model:
gemini-3.8-flash

Args:
null

Results:
null

Tokens:
							input: 34793
							output: 37
							thoughts: 113
						

Thoughts:
**Investigating the NVMe-oF File Namespace Enablement**

Okay, let's dive into this. First, I need to verify how namespace enabling works within the file-backed NVMe target, so I'm going to jump into `drivers/nvme/target/io-cmd-file.c` and specifically look at the `nvmet_file_ns_enable` function. Aha! Good, it's not static; I can see that it's declared as `int nvmet_file_ns_enable(struct nvmet_ns *ns)`. That's critical for how it's potentially exposed and called.

Now, let's follow the breadcrumbs. It seems like the core configuration piece is going to be in `target_core_file.c`. Yep, I see that `fd_configure_device` is a function pointer declared in the `struct target_backend_ops`. That's the key interface here. 

So now I need to figure out how that is set, what that pointer is configured to, and what's going on behind the scenes. Let's head over to `drivers/target/target_core_file.c` and trace that function pointer.



20/2 2026/11/13 12:25 tool grepper
0m Args:
{
  "Expression": "fd_configure_device",
  "PathPrefixes": [
    "drivers/target/target_core_file.c"
  ]
}

Results:
{
  "Output": "drivers/target/target_core_file.c=89=static bool fd_configure_unmap(struct se_device *dev)\n--\ndrivers/target/target_core_file.c-106-\ndrivers/target/target_core_file.c:107:static int fd_configure_device(struct se_device *dev)\ndrivers/target/target_core_file.c-108-{\n--\ndrivers/target/target_core_file.c=927=static const struct target_backend_ops fileio_ops = {\n--\ndrivers/target/target_core_file.c-934-\t.alloc_device\t\t= fd_alloc_device,\ndrivers/target/target_core_file.c:935:\t.configure_device\t= fd_configure_device,\ndrivers/target/target_core_file.c-936-\t.destroy_device\t\t= fd_destroy_device,\n"
}

21/2 2026/11/13 12:25 llm patch-evaluator
0m Model:
gemini-3.8-flash

Args:
null

Results:
null

Tokens:
							input: 35441
							output: 44
							thoughts: 154
						

Thoughts:
**Analyzing Potential Symbol Exposure**

Okay, so `fd_configure_device` is definitely out as a candidate for inlining. The fact that its address is being taken means it *has* to have a symbol present in `kallsyms`. We need to look elsewhere. Let's move on to the storage gadget function code, specifically `fsg_lun_open` in `drivers/usb/gadget/function/storage_common.c`. I need to determine if it's static or not.

Ah, good, a quick check confirms: `int fsg_lun_open(struct fsg_lun *curlun, const char *filename)` - it's non-static. Worthy of more investigation. Next, let's turn our attention to the erofs filesystem code. Let's go through `erofs_file_get_tree` and `erofs_init_device` within `fs/erofs/super.c`. Okay, let's examine the contents of `fs/erofs/super.c`.



22/2 2026/11/13 12:26 tool grepper
0m Args:
{
  "Expression": "erofs_file_get_tree|erofs_init_device",
  "PathPrefixes": [
    "fs/erofs/super.c"
  ]
}

Results:
{
  "Output": "fs/erofs/super.c=91=void *erofs_read_metadata(struct super_block *sb, struct erofs_buf *buf,\n--\nfs/erofs/super.c-124-\nfs/erofs/super.c:125:static int erofs_init_device(struct erofs_buf *buf, struct super_block *sb,\nfs/erofs/super.c-126-\t\t\t     struct erofs_device_info *dif, erofs_off_t *pos)\n--\nfs/erofs/super.c=184=static int erofs_scan_devices(struct super_block *sb,\n--\nfs/erofs/super.c-221-\t\tidr_for_each_entry(\u0026sbi-\u003edevs-\u003etree, dif, id) {\nfs/erofs/super.c:222:\t\t\terr = erofs_init_device(\u0026buf, sb, dif, \u0026pos);\nfs/erofs/super.c-223-\t\t\tif (err)\n--\nfs/erofs/super.c-240-\nfs/erofs/super.c:241:\t\t\terr = erofs_init_device(\u0026buf, sb, dif, \u0026pos);\nfs/erofs/super.c-242-\t\t\tif (err)\n--\nfs/erofs/super.c=819=static int erofs_sb_share_test_super(struct super_block *sb,\n--\nfs/erofs/super.c-834-\nfs/erofs/super.c:835:static int erofs_file_get_tree(struct fs_context *fc)\nfs/erofs/super.c-836-{\n--\nfs/erofs/super.c=848=static int erofs_fc_get_tree(struct fs_context *fc)\n--\nfs/erofs/super.c-861-\t\t}\nfs/erofs/super.c:862:\t\treturn erofs_file_get_tree(fc);\nfs/erofs/super.c-863-\t}\n--\nfs/erofs/super.c-878-\t\tif (S_ISREG(file_inode(sbi-\u003edif0.file)-\u003ei_mode))\nfs/erofs/super.c:879:\t\t\treturn erofs_file_get_tree(fc);\nfs/erofs/super.c-880-\t}\n"
}

23/2 2026/11/13 12:26 llm patch-evaluator
0m Model:
gemini-3.8-flash

Args:
null

Results:
null

Tokens:
							input: 36469
							output: 32
							thoughts: 48
						

Thoughts:
Okay, let's see...

**Analyzing EROFS Tree Retrieval and FUSE Backing Files**

Hmm, so I'm thinking about how EROFS handles its tree structures and file access. I've got `erofs_fc_get_tree` and `erofs_file_get_tree` at the forefront of my mind, as I always consider those when discussing EROFS internals. But now I'm thinking about the implications for FUSE backing files, and something feels like it's missing from my mental map. Specifically, how do we handle the interface if FUSE is involved? I'm wondering if there are any specific interactions with `fuse_backing_open_file` that need consideration. It's time to dig into the code. Let me check `fs/fuse/backing.c`. That's where I'll probably find the key to this interaction.



24/2 2026/11/13 12:26 tool grepper
0m Args:
{
  "Expression": "fuse_backing_open_file",
  "PathPrefixes": [
    "fs/fuse/"
  ]
}

Results:
{
  "Output": "fs/fuse/backing.c=131=static const struct dax_holder_operations fuse_dax_holder_ops = {\n--\nfs/fuse/backing.c-134-\nfs/fuse/backing.c:135:static int fuse_backing_open_file(struct fuse_conn *fc, struct fuse_backing *fb, struct file *file)\nfs/fuse/backing.c-136-{\n--\nfs/fuse/backing.c=189=static struct fuse_backing *fuse_backing_new(struct fuse_conn *fc, int fd)\n--\nfs/fuse/backing.c-200-\nfs/fuse/backing.c:201:\terr = fuse_backing_open_file(fc, fb, fd_file(f));\nfs/fuse/backing.c-202-\tif (err)\n"
}

25/2 2026/11/13 12:26 llm patch-evaluator
0m Model:
gemini-3.8-flash

Args:
null

Results:
null

Tokens:
							input: 36958
							output: 30
							thoughts: 13
						

Thoughts:
Okay, here's my take on those thoughts, tailored for an expert audience, presented in the first person:

**Investigating the `fuse_backing_new` Function Calls**

Alright, let's dive in. My immediate thought is, "Okay, `fuse_backing_new`... what's calling it?" This function is key, obviously, and understanding its usage is critical to grasping how the system's memory model is constructed. I need to trace its callers. I'm thinking, this is probably tied to some core object instantiation or resource allocation. The context here is likely foundational, so I'm expecting to see calls from the higher-level FUSE layer, or perhaps some internal backing store management code. I’ll be looking for object constructors, memory allocation wrappers, or resource initialization routines. Where and how are backing stores being created? That’s the core question that needs to be answered. This should offer insight into how the backing store abstracts away the underlying storage, and how that abstraction is implemented. I expect to be able to use the call graph to gain insight into how concurrency is handled, or how any cache coherency operations are initiated. Let's see what's being initialized and how this thing is actually put into use. Time to get to work!



26/2 2026/11/13 12:26 tool grepper
0m Args:
{
  "Expression": "fuse_backing_new",
  "PathPrefixes": [
    "fs/fuse/"
  ]
}

Results:
{
  "Output": "fs/fuse/backing.c=135=static int fuse_backing_open_file(struct fuse_conn *fc, struct fuse_backing *fb, struct file *file)\n--\nfs/fuse/backing.c-188-\nfs/fuse/backing.c:189:static struct fuse_backing *fuse_backing_new(struct fuse_conn *fc, int fd)\nfs/fuse/backing.c-190-{\n--\nfs/fuse/backing.c=210=int fuse_backing_open_64(struct fuse_conn *fc, struct fuse_backing_create_in *map)\n--\nfs/fuse/backing.c-220-\nfs/fuse/backing.c:221:\tfb = fuse_backing_new(fc, map-\u003efd);\nfs/fuse/backing.c-222-\tif (IS_ERR(fb))\n--\nfs/fuse/backing.c=233=int fuse_backing_open(struct fuse_conn *fc, struct fuse_backing_map *map)\n--\nfs/fuse/backing.c-246-\nfs/fuse/backing.c:247:\tfb = fuse_backing_new(fc, map-\u003efd);\nfs/fuse/backing.c-248-\tres = PTR_ERR(fb);\n"
}

27/2 2026/11/13 12:26 llm patch-evaluator
0m Model:
gemini-3.8-flash

Args:
null

Results:
null

Tokens:
							input: 37597
							output: 27
							thoughts: 208
						

Thoughts:
Here's my analysis of this code snippet:

**Deconstructing Potential Entry Points and Configuration Dependencies**

Okay, so I'm looking at these entry points, `fuse_backing_open_64` and `fuse_backing_open`. These are definitely important starting points. But where do things *really* begin? I need to understand the larger context.

My next question is about `init_pseudo`. I see that it's *not* static, thanks to `EXPORT_SYMBOL(init_pseudo)` in `fs/libfs.c`, which makes it accessible outside of its defining file. Similarly, I spot `kernfs_get_tree` in `fs/kernfs/mount.c` is also exported with `EXPORT_SYMBOL_GPL(kernfs_get_tree)`. Time to dig into both `init_pseudo` and `kernfs_get_tree` and map them to entry points.

Now, a critical piece: Configuration. I want to figure out what build options are involved with the code I'm looking at. Let's see what Kconfig options enable the modified code. I'm focusing on those files that are touched by the changes. First, `drivers/block/loop.c` is using `CONFIG_BLK_DEV_LOOP`. Good.

Next, I need to know what config enables `zloop`. Let's check `drivers/block/Makefile` or `drivers/block/Kconfig`.



28/2 2026/11/13 12:27 tool grepper
0m Args:
{
  "Expression": "zloop",
  "PathPrefixes": [
    "drivers/block/"
  ]
}

Results:
{
  "Output": "\nFull output is too long, showing 200 out of 681 lines.\nUse more precise expression or PathPrefixes if possible.\n\nNumber of matching lines per file (3 files in total):\ndrivers/block/Kconfig:1\ndrivers/block/Makefile:1\ndrivers/block/zloop.c:206\n\ndrivers/block/Kconfig=356=config BLK_DEV_ZONED_LOOP\n--\ndrivers/block/Kconfig-367-\t  echo \"add id=0,zone_size_mb=256,capacity_mb=16384,conv_zones=11\" \u003e \\\ndrivers/block/Kconfig:368:\t\t/dev/zloop-control\ndrivers/block/Kconfig-369-\n--\ndrivers/block/Makefile=40=obj-$(CONFIG_BLK_DEV_UBLK)\t\t\t+= ublk_drv.o\ndrivers/block/Makefile:41:obj-$(CONFIG_BLK_DEV_ZONED_LOOP) += zloop.o\ndrivers/block/Makefile-42-\n--\ndrivers/block/zloop.c=25=enum {\n--\ndrivers/block/zloop.c-41-\ndrivers/block/zloop.c:42:static const match_table_t zloop_opt_tokens = {\ndrivers/block/zloop.c-43-\t{ ZLOOP_OPT_ID,\t\t\t\"id=%d\"\t},\n--\ndrivers/block/zloop.c-64-#define ZLOOP_DEF_MAX_OPEN_ZONES\t0\ndrivers/block/zloop.c:65:#define ZLOOP_DEF_BASE_DIR\t\t\"/var/local/zloop\"\ndrivers/block/zloop.c-66-#define ZLOOP_DEF_NR_QUEUES\t\t1\n--\ndrivers/block/zloop.c-74-\ndrivers/block/zloop.c:75:struct zloop_options {\ndrivers/block/zloop.c-76-\tunsigned int\t\tmask;\n--\ndrivers/block/zloop.c=95=enum {\n--\ndrivers/block/zloop.c-100-\ndrivers/block/zloop.c:101:enum zloop_zone_flags {\ndrivers/block/zloop.c-102-\tZLOOP_ZONE_CONV = 0,\n--\ndrivers/block/zloop.c-109- */\ndrivers/block/zloop.c:110:struct zloop_zone {\ndrivers/block/zloop.c-111-\tstruct list_head\topen_zone_entry;\n--\ndrivers/block/zloop.c-123-\ndrivers/block/zloop.c:124:struct zloop_device {\ndrivers/block/zloop.c-125-\tunsigned int\t\tid;\n--\ndrivers/block/zloop.c-152-\ndrivers/block/zloop.c:153:\tstruct zloop_zone\tzones[] __counted_by(nr_zones);\ndrivers/block/zloop.c-154-};\ndrivers/block/zloop.c-155-\ndrivers/block/zloop.c:156:struct zloop_cmd {\ndrivers/block/zloop.c-157-\tstruct work_struct\twork;\n--\ndrivers/block/zloop.c-165-\ndrivers/block/zloop.c:166:static DEFINE_IDR(zloop_index_idr);\ndrivers/block/zloop.c:167:static DEFINE_MUTEX(zloop_ctl_mutex);\ndrivers/block/zloop.c-168-\ndrivers/block/zloop.c=169=static unsigned int rq_zone_no(struct request *rq)\ndrivers/block/zloop.c-170-{\ndrivers/block/zloop.c:171:\tstruct zloop_device *zlo = rq-\u003eq-\u003equeuedata;\ndrivers/block/zloop.c-172-\n--\ndrivers/block/zloop.c-181- */\ndrivers/block/zloop.c:182:static inline void zloop_lru_rotate_open_zone(struct zloop_device *zlo,\ndrivers/block/zloop.c:183:\t\t\t\t\t      struct zloop_zone *zone)\ndrivers/block/zloop.c-184-{\n--\ndrivers/block/zloop.c-192-\ndrivers/block/zloop.c:193:static inline void zloop_lru_remove_open_zone(struct zloop_device *zlo,\ndrivers/block/zloop.c:194:\t\t\t\t\t      struct zloop_zone *zone)\ndrivers/block/zloop.c-195-{\n--\ndrivers/block/zloop.c-204-\ndrivers/block/zloop.c:205:static inline bool zloop_can_open_zone(struct zloop_device *zlo)\ndrivers/block/zloop.c-206-{\n--\ndrivers/block/zloop.c-214- */\ndrivers/block/zloop.c:215:static bool zloop_close_imp_open_zone(struct zloop_device *zlo)\ndrivers/block/zloop.c-216-{\ndrivers/block/zloop.c:217:\tstruct zloop_zone *zone;\ndrivers/block/zloop.c-218-\n--\ndrivers/block/zloop.c-220-\ndrivers/block/zloop.c:221:\tif (zloop_can_open_zone(zlo))\ndrivers/block/zloop.c-222-\t\treturn true;\n--\ndrivers/block/zloop.c-235-\ndrivers/block/zloop.c:236:static bool zloop_open_closed_or_empty_zone(struct zloop_device *zlo,\ndrivers/block/zloop.c:237:\t\t\t\t\t    struct zloop_zone *zone,\ndrivers/block/zloop.c-238-\t\t\t\t\t    bool explicit)\n--\ndrivers/block/zloop.c-246-\t\t */\ndrivers/block/zloop.c:247:\t\tif (!zloop_can_open_zone(zlo))\ndrivers/block/zloop.c-248-\t\t\tgoto fail;\n--\ndrivers/block/zloop.c-254-\t\t */\ndrivers/block/zloop.c:255:\t\tif (!zloop_close_imp_open_zone(zlo))\ndrivers/block/zloop.c-256-\t\t\tgoto fail;\n--\ndrivers/block/zloop.c-273-\ndrivers/block/zloop.c:274:static bool zloop_do_open_zone(struct zloop_device *zlo,\ndrivers/block/zloop.c:275:\t\t\t       struct zloop_zone *zone, bool explicit)\ndrivers/block/zloop.c-276-{\n--\ndrivers/block/zloop.c-281-\t\t\tzone-\u003econd = BLK_ZONE_COND_EXP_OPEN;\ndrivers/block/zloop.c:282:\t\tzloop_lru_rotate_open_zone(zlo, zone);\ndrivers/block/zloop.c-283-\t\treturn true;\n--\ndrivers/block/zloop.c-285-\tcase BLK_ZONE_COND_CLOSED:\ndrivers/block/zloop.c:286:\t\treturn zloop_open_closed_or_empty_zone(zlo, zone, explicit);\ndrivers/block/zloop.c-287-\tdefault:\n--\ndrivers/block/zloop.c-291-\ndrivers/block/zloop.c:292:static void zloop_mark_full(struct zloop_device *zlo, struct zloop_zone *zone)\ndrivers/block/zloop.c-293-{\n--\ndrivers/block/zloop.c-295-\ndrivers/block/zloop.c:296:\tzloop_lru_remove_open_zone(zlo, zone);\ndrivers/block/zloop.c-297-\tzone-\u003econd = BLK_ZONE_COND_FULL;\n--\ndrivers/block/zloop.c-300-\ndrivers/block/zloop.c:301:static void zloop_mark_empty(struct zloop_device *zlo, struct zloop_zone *zone)\ndrivers/block/zloop.c-302-{\n--\ndrivers/block/zloop.c-304-\ndrivers/block/zloop.c:305:\tzloop_lru_remove_open_zone(zlo, zone);\ndrivers/block/zloop.c-306-\tzone-\u003econd = BLK_ZONE_COND_EMPTY;\n--\ndrivers/block/zloop.c-309-\ndrivers/block/zloop.c:310:static int zloop_update_seq_zone(struct zloop_device *zlo, unsigned int zone_no)\ndrivers/block/zloop.c-311-{\ndrivers/block/zloop.c:312:\tstruct zloop_zone *zone = \u0026zlo-\u003ezones[zone_no];\ndrivers/block/zloop.c-313-\tstruct kstat stat;\n--\ndrivers/block/zloop.c-342-\tif (!file_sectors) {\ndrivers/block/zloop.c:343:\t\tzloop_mark_empty(zlo, zone);\ndrivers/block/zloop.c-344-\t} else if (file_sectors == zlo-\u003ezone_capacity) {\ndrivers/block/zloop.c:345:\t\tzloop_mark_full(zlo, zone);\ndrivers/block/zloop.c-346-\t} else {\n--\ndrivers/block/zloop.c-356-\ndrivers/block/zloop.c:357:static int zloop_open_zone(struct zloop_device *zlo, unsigned int zone_no)\ndrivers/block/zloop.c-358-{\ndrivers/block/zloop.c:359:\tstruct zloop_zone *zone = \u0026zlo-\u003ezones[zone_no];\ndrivers/block/zloop.c-360-\tint ret = 0;\n--\ndrivers/block/zloop.c-367-\tif (test_and_clear_bit(ZLOOP_ZONE_SEQ_ERROR, \u0026zone-\u003eflags)) {\ndrivers/block/zloop.c:368:\t\tret = zloop_update_seq_zone(zlo, zone_no);\ndrivers/block/zloop.c-369-\t\tif (ret)\n--\ndrivers/block/zloop.c-372-\ndrivers/block/zloop.c:373:\tif (!zloop_do_open_zone(zlo, zone, true))\ndrivers/block/zloop.c-374-\t\tret = -EIO;\n--\ndrivers/block/zloop.c-381-\ndrivers/block/zloop.c:382:static int zloop_close_zone(struct zloop_device *zlo, unsigned int zone_no)\ndrivers/block/zloop.c-383-{\ndrivers/block/zloop.c:384:\tstruct zloop_zone *zone = \u0026zlo-\u003ezones[zone_no];\ndrivers/block/zloop.c-385-\tint ret = 0;\n--\ndrivers/block/zloop.c-392-\tif (test_and_clear_bit(ZLOOP_ZONE_SEQ_ERROR, \u0026zone-\u003eflags)) {\ndrivers/block/zloop.c:393:\t\tret = zloop_update_seq_zone(zlo, zone_no);\ndrivers/block/zloop.c-394-\t\tif (ret)\n--\ndrivers/block/zloop.c-403-\t\tspin_lock(\u0026zone-\u003ewp_lock);\ndrivers/block/zloop.c:404:\t\tzloop_lru_remove_open_zone(zlo, zone);\ndrivers/block/zloop.c-405-\t\tif (zone-\u003ewp == zone-\u003estart)\n--\ndrivers/block/zloop.c-423-\ndrivers/block/zloop.c:424:static int zloop_reset_zone(struct zloop_device *zlo, unsigned int zone_no)\ndrivers/block/zloop.c-425-{\ndrivers/block/zloop.c:426:\tstruct zloop_zone *zone = \u0026zlo-\u003ezones[zone_no];\ndrivers/block/zloop.c-427-\tint ret = 0;\n--\ndrivers/block/zloop.c-444-\tspin_lock(\u0026zone-\u003ewp_lock);\ndrivers/block/zloop.c:445:\tzloop_mark_empty(zlo, zone);\ndrivers/block/zloop.c-446-\tclear_bit(ZLOOP_ZONE_SEQ_ERROR, \u0026zone-\u003eflags);\n--\ndrivers/block/zloop.c-454-\ndrivers/block/zloop.c:455:static int zloop_reset_all_zones(struct zloop_device *zlo)\ndrivers/block/zloop.c-456-{\n--\ndrivers/block/zloop.c-460-\tfor (i = zlo-\u003enr_conv_zones; i \u003c zlo-\u003enr_zones; i++) {\ndrivers/block/zloop.c:461:\t\tret = zloop_reset_zone(zlo, i);\ndrivers/block/zloop.c-462-\t\tif (ret)\n--\ndrivers/block/zloop.c-468-\ndrivers/block/zloop.c:469:static int zloop_finish_zone(struct zloop_device *zlo, unsigned int zone_no)\ndrivers/block/zloop.c-470-{\ndrivers/block/zloop.c:471:\tstruct zloop_zone *zone = \u0026zlo-\u003ezones[zone_no];\ndrivers/block/zloop.c-472-\tint ret = 0;\n--\ndrivers/block/zloop.c-490-\tspin_lock(\u0026zone-\u003ewp_lock);\ndrivers/block/zloop.c:491:\tzloop_mark_full(zlo, zone);\ndrivers/block/zloop.c-492-\tclear_bit(ZLOOP_ZONE_SEQ_ERROR, \u0026zone-\u003eflags);\n--\ndrivers/block/zloop.c-500-\ndrivers/block/zloop.c:501:static void zloop_put_cmd(struct zloop_cmd *cmd)\ndrivers/block/zloop.c-502-{\n--\ndrivers/block/zloop.c-512-\ndrivers/block/zloop.c:513:static void zloop_rw_complete(struct kiocb *iocb, long ret)\ndrivers/block/zloop.c-514-{\ndrivers/block/zloop.c:515:\tstruct zloop_cmd *cmd = container_of(iocb, struct zloop_cmd, iocb);\ndrivers/block/zloop.c-516-\ndrivers/block/zloop.c-517-\tcmd-\u003eret = ret;\ndrivers/block/zloop.c:518:\tzloop_put_cmd(cmd);\ndrivers/block/zloop.c-519-}\n\n"
}

29/2 2026/11/13 12:27 llm patch-evaluator
0m Model:
gemini-3.8-flash

Args:
null

Results:
null

Tokens:
							input: 41965
							output: 35
							thoughts: 41
						

Thoughts:
Okay, here's my take on those thoughts, tailored for an expert audience:

**Investigating Zoned Block Device Support in the Loop Driver**

Right, `CONFIG_BLK_DEV_ZONED_LOOP`! That's the key. I need to figure out what's enabling zoned block device support for the loop driver, because I thought I had that working. My first stop has to be the code. Let's dig into `drivers/nvme/target/io-cmd-file.c` to see how it's defined and how it's being used. I need to identify the exact configuration option that's gating its compilation or activation. This could be a configuration flag, a Kconfig dependency, or maybe even a conditional build path. I need the full picture to understand how to correctly enable it in my environment.



30/2 2026/11/13 12:28 tool grepper
0m Args:
{
  "Expression": "io-cmd-file\\.o",
  "PathPrefixes": [
    "drivers/nvme/target/"
  ]
}

Results:
{
  "Output": "drivers/nvme/target/Makefile=13=nvmet-y\t\t+= core.o configfs.o admin-cmd.o fabrics-cmd.o \\\ndrivers/nvme/target/Makefile:14:\t\t\tdiscovery.o io-cmd-file.o io-cmd-bdev.o pr.o\ndrivers/nvme/target/Makefile-15-nvmet-$(CONFIG_NVME_TARGET_DEBUGFS)\t+= debugfs.o\n"
}

31/2 2026/11/13 12:28 llm patch-evaluator
0m Model:
gemini-3.8-flash

Args:
null

Results:
null

Tokens:
							input: 42336
							output: 34
							thoughts: 25
						

Thoughts:
Okay, here's my interpretation of those thoughts, tailored for an expert audience, and delivered as a first-person summary:

**Digging into NVMe-oF Configuration**

Alright, I'm trying to figure out the specific configuration options that enable NVMe over Fabrics support in this kernel. Where's the right place to start looking? My gut says I need to examine the source files that handle the NVMe target functionality – those would be the key. My immediate thought is to check within the driver's directory structure. Specifically, I should look at either the `Kconfig` file, which defines the kernel configuration options, or the `Makefile`, which often handles conditional compilation based on those options. I'll start with the likely path: `drivers/nvme/target/`. Let's see what `Kconfig` or the `Makefile` in there have to say. That should give me the configuration symbol(s) I'm after.



32/2 2026/11/13 12:29 tool grepper
0m Args:
{
  "Expression": "CONFIG_NVME_TARGET",
  "PathPrefixes": [
    "drivers/nvme/target/"
  ]
}

Results:
{
  "Output": "\nFull output is too long, showing 200 out of 256 lines.\nUse more precise expression or PathPrefixes if possible.\n\nNumber of matching lines per file (10 files in total):\ndrivers/nvme/target/Makefile:10\ndrivers/nvme/target/auth.c:7\ndrivers/nvme/target/configfs.c:11\ndrivers/nvme/target/core.c:1\ndrivers/nvme/target/debugfs.c:2\ndrivers/nvme/target/debugfs.h:1\ndrivers/nvme/target/fabrics-cmd-auth.c:1\ndrivers/nvme/target/fabrics-cmd.c:4\ndrivers/nvme/target/nvmet.h:14\ndrivers/nvme/target/tcp.c:3\n\ndrivers/nvme/target/Makefile=3=ccflags-y\t\t\t\t+= -I$(src)\ndrivers/nvme/target/Makefile-4-\ndrivers/nvme/target/Makefile:5:obj-$(CONFIG_NVME_TARGET)\t\t+= nvmet.o\ndrivers/nvme/target/Makefile:6:obj-$(CONFIG_NVME_TARGET_LOOP)\t\t+= nvme-loop.o\ndrivers/nvme/target/Makefile:7:obj-$(CONFIG_NVME_TARGET_RDMA)\t\t+= nvmet-rdma.o\ndrivers/nvme/target/Makefile:8:obj-$(CONFIG_NVME_TARGET_FC)\t\t+= nvmet-fc.o\ndrivers/nvme/target/Makefile:9:obj-$(CONFIG_NVME_TARGET_FCLOOP)\t+= nvme-fcloop.o\ndrivers/nvme/target/Makefile:10:obj-$(CONFIG_NVME_TARGET_TCP)\t\t+= nvmet-tcp.o\ndrivers/nvme/target/Makefile:11:obj-$(CONFIG_NVME_TARGET_PCI_EPF)\t+= nvmet-pci-epf.o\ndrivers/nvme/target/Makefile-12-\ndrivers/nvme/target/Makefile=13=nvmet-y\t\t+= core.o configfs.o admin-cmd.o fabrics-cmd.o \\\ndrivers/nvme/target/Makefile-14-\t\t\tdiscovery.o io-cmd-file.o io-cmd-bdev.o pr.o\ndrivers/nvme/target/Makefile:15:nvmet-$(CONFIG_NVME_TARGET_DEBUGFS)\t+= debugfs.o\ndrivers/nvme/target/Makefile:16:nvmet-$(CONFIG_NVME_TARGET_PASSTHRU)\t+= passthru.o\ndrivers/nvme/target/Makefile-17-nvmet-$(CONFIG_BLK_DEV_ZONED)\t\t+= zns.o\ndrivers/nvme/target/Makefile:18:nvmet-$(CONFIG_NVME_TARGET_AUTH)\t+= fabrics-cmd-auth.o auth.o\ndrivers/nvme/target/Makefile-19-nvme-loop-y\t+= loop.o\n--\ndrivers/nvme/target/auth.c=133=u8 nvmet_setup_auth(struct nvmet_ctrl *ctrl, struct nvmet_sq *sq, bool reset)\n--\ndrivers/nvme/target/auth.c-190-\t}\ndrivers/nvme/target/auth.c:191:#ifdef CONFIG_NVME_TARGET_AUTH_DEBUG\ndrivers/nvme/target/auth.c-192-\tpr_debug(\"%s: using hash %s key %*ph\\n\", __func__,\n--\ndrivers/nvme/target/auth.c-209-\t}\ndrivers/nvme/target/auth.c:210:#ifdef CONFIG_NVME_TARGET_AUTH_DEBUG\ndrivers/nvme/target/auth.c-211-\tpr_debug(\"%s: using ctrl hash %s key %*ph\\n\", __func__,\n--\ndrivers/nvme/target/auth.c=249=void nvmet_destroy_auth(struct nvmet_ctrl *ctrl)\n--\ndrivers/nvme/target/auth.c-268-\t}\ndrivers/nvme/target/auth.c:269:#ifdef CONFIG_NVME_TARGET_TCP_TLS\ndrivers/nvme/target/auth.c-270-\tif (ctrl-\u003etls_key) {\n--\ndrivers/nvme/target/auth.c=429=int nvmet_auth_ctrl_exponential(struct nvmet_req *req,\n--\ndrivers/nvme/target/auth.c-444-\t\tmemcpy(buf, ctrl-\u003edh_key, buf_size);\ndrivers/nvme/target/auth.c:445:#ifdef CONFIG_NVME_TARGET_AUTH_DEBUG\ndrivers/nvme/target/auth.c-446-\t\tpr_debug(\"%s: ctrl %d public key %*ph\\n\", __func__,\n--\ndrivers/nvme/target/auth.c=454=int nvmet_auth_ctrl_sesskey(struct nvmet_req *req,\n--\ndrivers/nvme/target/auth.c-470-\t\tpr_debug(\"failed to compute session key, err %d\\n\", ret);\ndrivers/nvme/target/auth.c:471:#ifdef CONFIG_NVME_TARGET_AUTH_DEBUG\ndrivers/nvme/target/auth.c-472-\telse\n--\ndrivers/nvme/target/auth.c=480=void nvmet_auth_insert_psk(struct nvmet_sq *sq)\n--\ndrivers/nvme/target/auth.c-486-\tint ret;\ndrivers/nvme/target/auth.c:487:#ifdef CONFIG_NVME_TARGET_TCP_TLS\ndrivers/nvme/target/auth.c-488-\tstruct key *tls_key = NULL;\n--\ndrivers/nvme/target/auth.c-515-\t}\ndrivers/nvme/target/auth.c:516:#ifdef CONFIG_NVME_TARGET_TCP_TLS\ndrivers/nvme/target/auth.c-517-\ttls_key = nvme_tls_psk_refresh(NULL, sq-\u003ectrl-\u003ehostnqn,\n--\ndrivers/nvme/target/configfs.c-15-#include \u003clinux/pci-p2pdma.h\u003e\ndrivers/nvme/target/configfs.c:16:#ifdef CONFIG_NVME_TARGET_AUTH\ndrivers/nvme/target/configfs.c-17-#include \u003clinux/nvme-auth.h\u003e\n--\ndrivers/nvme/target/configfs.c=475=static ssize_t nvmet_addr_tsas_store(struct config_item *item,\n--\ndrivers/nvme/target/configfs.c-499-\tif (sectype == NVMF_TCP_SECTYPE_TLS13) {\ndrivers/nvme/target/configfs.c:500:\t\tif (!IS_ENABLED(CONFIG_NVME_TARGET_TCP_TLS)) {\ndrivers/nvme/target/configfs.c-501-\t\t\tpr_err(\"TLS is not supported\\n\");\n--\ndrivers/nvme/target/configfs.c=905=static const struct config_item_type nvmet_namespaces_type = {\n--\ndrivers/nvme/target/configfs.c-909-\ndrivers/nvme/target/configfs.c:910:#ifdef CONFIG_NVME_TARGET_PASSTHRU\ndrivers/nvme/target/configfs.c-911-\n--\ndrivers/nvme/target/configfs.c=1117=static void nvmet_add_passthru_group(struct nvmet_subsys *subsys)\n--\ndrivers/nvme/target/configfs.c-1124-\ndrivers/nvme/target/configfs.c:1125:#else /* CONFIG_NVME_TARGET_PASSTHRU */\ndrivers/nvme/target/configfs.c-1126-\ndrivers/nvme/target/configfs.c=1127=static void nvmet_add_passthru_group(struct nvmet_subsys *subsys)\n--\ndrivers/nvme/target/configfs.c-1130-\ndrivers/nvme/target/configfs.c:1131:#endif /* CONFIG_NVME_TARGET_PASSTHRU */\ndrivers/nvme/target/configfs.c-1132-\n--\ndrivers/nvme/target/configfs.c=2151=static struct config_group *nvmet_ports_make(struct config_group *group,\n--\ndrivers/nvme/target/configfs.c-2164-\ndrivers/nvme/target/configfs.c:2165:\tif (IS_ENABLED(CONFIG_NVME_TARGET_TCP_TLS) \u0026\u0026 nvme_keyring_id()) {\ndrivers/nvme/target/configfs.c-2166-\t\tport-\u003ekeyring = key_lookup(nvme_keyring_id());\n--\ndrivers/nvme/target/configfs.c=2230=static struct config_group nvmet_ports_group;\ndrivers/nvme/target/configfs.c-2231-\ndrivers/nvme/target/configfs.c:2232:#ifdef CONFIG_NVME_TARGET_AUTH\ndrivers/nvme/target/configfs.c-2233-static ssize_t nvmet_host_dhchap_key_show(struct config_item *item,\n--\ndrivers/nvme/target/configfs.c=2353=static struct configfs_attribute *nvmet_host_attrs[] = {\n--\ndrivers/nvme/target/configfs.c-2359-};\ndrivers/nvme/target/configfs.c:2360:#endif /* CONFIG_NVME_TARGET_AUTH */\ndrivers/nvme/target/configfs.c-2361-\ndrivers/nvme/target/configfs.c=2362=static void nvmet_host_release(struct config_item *item)\n--\ndrivers/nvme/target/configfs.c-2365-\ndrivers/nvme/target/configfs.c:2366:#ifdef CONFIG_NVME_TARGET_AUTH\ndrivers/nvme/target/configfs.c-2367-\tkfree(host-\u003edhchap_secret);\n--\ndrivers/nvme/target/configfs.c=2377=static const struct config_item_type nvmet_host_type = {\ndrivers/nvme/target/configfs.c-2378-\t.ct_item_ops\t\t= \u0026nvmet_host_item_ops,\ndrivers/nvme/target/configfs.c:2379:#ifdef CONFIG_NVME_TARGET_AUTH\ndrivers/nvme/target/configfs.c-2380-\t.ct_attrs\t\t= nvmet_host_attrs,\n--\ndrivers/nvme/target/configfs.c=2385=static struct config_group *nvmet_hosts_make_group(struct config_group *group,\n--\ndrivers/nvme/target/configfs.c-2393-\ndrivers/nvme/target/configfs.c:2394:#ifdef CONFIG_NVME_TARGET_AUTH\ndrivers/nvme/target/configfs.c-2395-\t/* Default to SHA256 */\n--\ndrivers/nvme/target/core.c=1615=struct nvmet_ctrl *nvmet_alloc_ctrl(struct nvmet_alloc_ctrl_args *args)\n--\ndrivers/nvme/target/core.c-1653-\ndrivers/nvme/target/core.c:1654:#ifdef CONFIG_NVME_TARGET_PASSTHRU\ndrivers/nvme/target/core.c-1655-\t/* By default, set loop targets to clear IDS by default */\n--\ndrivers/nvme/target/debugfs.c=133=NVMET_DEBUGFS_ATTR(nvmet_ctrl_host_traddr);\ndrivers/nvme/target/debugfs.c-134-\ndrivers/nvme/target/debugfs.c:135:#ifdef CONFIG_NVME_TARGET_TCP_TLS\ndrivers/nvme/target/debugfs.c-136-static int nvmet_ctrl_tls_key_show(struct seq_file *m, void *p)\n--\ndrivers/nvme/target/debugfs.c=259=int nvmet_debugfs_ctrl_setup(struct nvmet_ctrl *ctrl)\n--\ndrivers/nvme/target/debugfs.c-283-\t\t\t    \u0026nvmet_ctrl_host_traddr_fops);\ndrivers/nvme/target/debugfs.c:284:#ifdef CONFIG_NVME_TARGET_TCP_TLS\ndrivers/nvme/target/debugfs.c-285-\tdebugfs_create_file(\"tls_concat\", S_IRUSR, ctrl-\u003edebugfs_dir, ctrl,\n--\ndrivers/nvme/target/debugfs.h-11-\ndrivers/nvme/target/debugfs.h:12:#ifdef CONFIG_NVME_TARGET_DEBUGFS\ndrivers/nvme/target/debugfs.h-13-int nvmet_debugfs_subsys_setup(struct nvmet_subsys *subsys);\n--\ndrivers/nvme/target/fabrics-cmd-auth.c=46=static u8 nvmet_auth_negotiate(struct nvmet_req *req, void *d, u32 tl)\n--\ndrivers/nvme/target/fabrics-cmd-auth.c-63-\tif (data-\u003esc_c != NVME_AUTH_SECP_NOSC) {\ndrivers/nvme/target/fabrics-cmd-auth.c:64:\t\tif (!IS_ENABLED(CONFIG_NVME_TARGET_TCP_TLS))\ndrivers/nvme/target/fabrics-cmd-auth.c-65-\t\t\treturn NVME_AUTH_DHCHAP_FAILURE_CONCAT_MISMATCH;\n--\ndrivers/nvme/target/fabrics-cmd.c=92=u32 nvmet_fabrics_admin_cmd_data_len(struct nvmet_req *req)\n--\ndrivers/nvme/target/fabrics-cmd.c-96-\tswitch (cmd-\u003efabrics.fctype) {\ndrivers/nvme/target/fabrics-cmd.c:97:#ifdef CONFIG_NVME_TARGET_AUTH\ndrivers/nvme/target/fabrics-cmd.c-98-\tcase nvme_fabrics_type_auth_send:\n--\ndrivers/nvme/target/fabrics-cmd.c=108=u16 nvmet_parse_fabrics_admin_cmd(struct nvmet_req *req)\n--\ndrivers/nvme/target/fabrics-cmd.c-118-\t\tbreak;\ndrivers/nvme/target/fabrics-cmd.c:119:#ifdef CONFIG_NVME_TARGET_AUTH\ndrivers/nvme/target/fabrics-cmd.c-120-\tcase nvme_fabrics_type_auth_send:\n--\ndrivers/nvme/target/fabrics-cmd.c=137=u32 nvmet_fabrics_io_cmd_data_len(struct nvmet_req *req)\n--\ndrivers/nvme/target/fabrics-cmd.c-141-\tswitch (cmd-\u003efabrics.fctype) {\ndrivers/nvme/target/fabrics-cmd.c:142:#ifdef CONFIG_NVME_TARGET_AUTH\ndrivers/nvme/target/fabrics-cmd.c-143-\tcase nvme_fabrics_type_auth_send:\n--\ndrivers/nvme/target/fabrics-cmd.c=153=u16 nvmet_parse_fabrics_io_cmd(struct nvmet_req *req)\n--\ndrivers/nvme/target/fabrics-cmd.c-157-\tswitch (cmd-\u003efabrics.fctype) {\ndrivers/nvme/target/fabrics-cmd.c:158:#ifdef CONFIG_NVME_TARGET_AUTH\ndrivers/nvme/target/fabrics-cmd.c-159-\tcase nvme_fabrics_type_auth_send:\n--\ndrivers/nvme/target/nvmet.h=100=struct nvmet_ns {\n--\ndrivers/nvme/target/nvmet.h-132-\tstruct xarray\t\tpr_per_ctrl_refs;\ndrivers/nvme/target/nvmet.h:133:#ifdef CONFIG_NVME_TARGET_DEBUGFS\ndrivers/nvme/target/nvmet.h-134-\tstruct dentry\t\t*debugfs_dir;\n--\ndrivers/nvme/target/nvmet.h=155=struct nvmet_sq {\n--\ndrivers/nvme/target/nvmet.h-162-\tbool\t\t\tsqhd_disabled;\ndrivers/nvme/target/nvmet.h:163:#ifdef CONFIG_NVME_TARGET_AUTH\ndrivers/nvme/target/nvmet.h-164-\tstruct mutex\t\tauth_lock;\n--\ndrivers/nvme/target/nvmet.h-178-#endif\ndrivers/nvme/target/nvmet.h:179:#ifdef CONFIG_NVME_TARGET_TCP_TLS\ndrivers/nvme/target/nvmet.h-180-\tstruct key\t\t*tls_key;\n--\ndrivers/nvme/target/nvmet.h=259=struct nvmet_ctrl {\n--\ndrivers/nvme/target/nvmet.h-301-\tstruct radix_tree_root\tp2p_ns_map;\ndrivers/nvme/target/nvmet.h:302:#ifdef CONFIG_NVME_TARGET_DEBUGFS\ndrivers/nvme/target/nvmet.h-303-\tstruct dentry\t\t*debugfs_dir;\n--\ndrivers/nvme/target/nvmet.h-309-\tbool\t\t\tconcat;\ndrivers/nvme/target/nvmet.h:310:#ifdef CONFIG_NVME_TARGET_AUTH\ndrivers/nvme/target/nvmet.h-311-\tstruct nvme_dhchap_key\t*host_key;\n--\ndrivers/nvme/target/nvmet.h-318-#endif\ndrivers/nvme/target/nvmet.h:319:#ifdef CONFIG_NVME_TARGET_TCP_TLS\ndrivers/nvme/target/nvmet.h-320-\tstruct key\t\t*tls_key;\n--\ndrivers/nvme/target/nvmet.h=338=struct nvmet_subsys {\n--\ndrivers/nvme/target/nvmet.h-353-\tbool\t\t\tallow_any_host;\n\n"
}

33/2 2026/11/13 12:29 llm patch-evaluator
0m Model:
gemini-3.8-flash

Args:
null

Results:
null

Tokens:
							input: 47159
							output: 30
							thoughts: 37
						

Thoughts:
Okay, here's my take on those thoughts, tailored for an expert audience:

**Investigating the NVMe Target Configuration**

Right, let's dive straight in. My immediate thought is, "Ah, `CONFIG_NVME_TARGET`!" I need to understand this target, and I need to understand its relationship to the core file. So, the first step is obvious: I'm going to jump into the `drivers/target/target_core_file.c` source file. My primary question is: What configuration option *actually* enables this core file functionality? I'm assuming there's a dependency chain or a conditional compilation happening here, and I need to unearth the specifics. This is where the magic (or the headache!) often lies in kernel configuration. Let's see what we can find.



34/2 2026/11/13 12:30 tool grepper
0m Args:
{
  "Expression": "target_core_file",
  "PathPrefixes": [
    "drivers/target/"
  ]
}

Results:
{
  "Output": "drivers/target/Makefile=23=obj-$(CONFIG_TCM_IBLOCK)\t+= target_core_iblock.o\ndrivers/target/Makefile:24:obj-$(CONFIG_TCM_FILEIO)\t+= target_core_file.o\ndrivers/target/Makefile-25-obj-$(CONFIG_TCM_PSCSI)\t\t+= target_core_pscsi.o\n--\ndrivers/target/target_core_file.c-2-/*******************************************************************************\ndrivers/target/target_core_file.c:3: * Filename:  target_core_file.c\ndrivers/target/target_core_file.c-4- *\n--\ndrivers/target/target_core_file.c-29-\ndrivers/target/target_core_file.c:30:#include \"target_core_file.h\"\ndrivers/target/target_core_file.c-31-\n--\ndrivers/target/target_core_file.c=249=static void fd_destroy_device(struct se_device *dev)\n--\ndrivers/target/target_core_file.c-258-\ndrivers/target/target_core_file.c:259:struct target_core_file_cmd {\ndrivers/target/target_core_file.c-260-\tunsigned long\tlen;\n--\ndrivers/target/target_core_file.c=266=static void cmd_rw_aio_complete(struct kiocb *iocb, long ret)\ndrivers/target/target_core_file.c-267-{\ndrivers/target/target_core_file.c:268:\tstruct target_core_file_cmd *cmd;\ndrivers/target/target_core_file.c-269-\ndrivers/target/target_core_file.c:270:\tcmd = container_of(iocb, struct target_core_file_cmd, iocb);\ndrivers/target/target_core_file.c-271-\n--\ndrivers/target/target_core_file.c=281=fd_execute_rw_aio(struct se_cmd *cmd, struct scatterlist *sgl, u32 sgl_nents,\n--\ndrivers/target/target_core_file.c-287-\tstruct file *file = fd_dev-\u003efd_file;\ndrivers/target/target_core_file.c:288:\tstruct target_core_file_cmd *aio_cmd;\ndrivers/target/target_core_file.c-289-\tstruct iov_iter iter;\n--\ndrivers/target/target_core_transport.c=196=void transport_subsystem_check_init(void)\n--\ndrivers/target/target_core_transport.c-207-\ndrivers/target/target_core_transport.c:208:\tret = IS_ENABLED(CONFIG_TCM_FILEIO) \u0026\u0026 request_module(\"target_core_file\");\ndrivers/target/target_core_transport.c-209-\tif (ret != 0)\ndrivers/target/target_core_transport.c:210:\t\tpr_err(\"Unable to load target_core_file\\n\");\ndrivers/target/target_core_transport.c-211-\n"
}

35/2 2026/11/13 12:30 llm patch-evaluator
0m Model:
gemini-3.8-flash

Args:
null

Results:
null

Tokens:
							input: 48198
							output: 28
							thoughts: 29
						

Thoughts:
Okay, here's my take on those thoughts, framed as an expert's internal monologue:

**Investigating the `CONFIG_TCM_FILEIO` Kernel Configuration**

Alright, so `CONFIG_TCM_FILEIO` is the key thing I need to understand here. My immediate question is, where's that defined? My gut tells me to check the `fs/fuse/backing.c` file. It's a hunch based on experience; often, related functionalities are grouped logically within the filesystem structure, and FUSE is a likely suspect given the I/O context. Now, what triggers this specific config option to be enabled? I need to quickly identify the upstream dependency or configuration option that enables `CONFIG_TCM_FILEIO`. Time to dig a bit deeper and see what that config's dependencies are.



36/2 2026/11/13 12:30 tool grepper
0m Args:
{
  "Expression": "backing\\.o",
  "PathPrefixes": [
    "fs/fuse/"
  ]
}

Results:
{
  "Output": "fs/fuse/Makefile=17=fuse-$(CONFIG_FUSE_VDAX) += dax.o\nfs/fuse/Makefile:18:fuse-$(CONFIG_FUSE_PASSTHROUGH) += passthrough.o backing.o ext_map.o\nfs/fuse/Makefile-19-fuse-$(CONFIG_SYSCTL) += sysctl.o\n"
}

37/2 2026/11/13 12:30 llm patch-evaluator
0m Model:
gemini-3.8-flash

Args:
null

Results:
null

Tokens:
							input: 48529
							output: 29
							thoughts: 151
						

Thoughts:
**Investigating Filesystem Configuration Options**

Okay, let's break this down systematically. I need to figure out the relevant configuration options based on these filenames. First, I see mention of `CONFIG_FUSE_PASSTHROUGH` and `CONFIG_FUSE_FS`. Those are straightforward; I know those are related to FUSE.

Next, I'm looking at `fs/erofs/super.c`. Based on that, I'm immediately checking for `CONFIG_EROFS_FS` and `CONFIG_EROFS_FS_BACKED_BY_FILE`. That second one is interesting – I seem to recall seeing that in the selftests config diff, so it's fresh in my mind.

Moving on, `drivers/usb/gadget/function/storage_common.c` tells me to look for either `CONFIG_USB_CONFIGFS_MASS_STORAGE` or `CONFIG_USB_MASS_STORAGE`. Those seem like expected USB storage configurations.

Hold on...now I'm looking at `drivers/android/binder/rust_binderfs.c`, and I've hit a snag. I don't immediately recognize the configuration option that enables `rust_binderfs.c`. I need to figure out what config controls that file. I'll need to research that one.



38/2 2026/11/13 12:31 tool grepper
0m Args:
{
  "Expression": "rust_binderfs",
  "PathPrefixes": [
    "drivers/android/"
  ]
}

Results:
{
  "Output": "drivers/android/binder/Makefile=5=binder-y := \\\ndrivers/android/binder/Makefile-6-\trust_binder_main.o\t\\\ndrivers/android/binder/Makefile:7:\trust_binderfs.o\t\t\\\ndrivers/android/binder/Makefile-8-\trust_binder_events.o\n--\ndrivers/android/binder/rust_binder.h-12-/*\ndrivers/android/binder/rust_binder.h:13: * These symbols are exposed by `rust_binderfs.c` and exist here so that Rust\ndrivers/android/binder/rust_binder.h-14- * Binder can call them.\ndrivers/android/binder/rust_binder.h-15- */\ndrivers/android/binder/rust_binder.h:16:int init_rust_binderfs(void);\ndrivers/android/binder/rust_binder.h-17-\n--\ndrivers/android/binder/rust_binder.h=19=struct inode;\ndrivers/android/binder/rust_binder.h:20:struct dentry *rust_binderfs_create_proc_file(struct inode *nodp, int pid);\ndrivers/android/binder/rust_binder.h:21:void rust_binderfs_remove_file(struct dentry *dentry);\ndrivers/android/binder/rust_binder.h-22-\n--\ndrivers/android/binder/rust_binder_main.rs=49=mod binderfs {\n--\ndrivers/android/binder/rust_binder_main.rs-52-    extern \"C\" {\ndrivers/android/binder/rust_binder_main.rs:53:        pub fn init_rust_binderfs() -\u003e kernel::ffi::c_int;\ndrivers/android/binder/rust_binder_main.rs-54-    }\ndrivers/android/binder/rust_binder_main.rs-55-    extern \"C\" {\ndrivers/android/binder/rust_binder_main.rs:56:        pub fn rust_binderfs_create_proc_file(\ndrivers/android/binder/rust_binder_main.rs-57-            nodp: *mut inode,\n--\ndrivers/android/binder/rust_binder_main.rs-61-    extern \"C\" {\ndrivers/android/binder/rust_binder_main.rs:62:        pub fn rust_binderfs_remove_file(dentry: *mut dentry);\ndrivers/android/binder/rust_binder_main.rs-63-    }\n--\ndrivers/android/binder/rust_binder_main.rs=309=    fn init(_module: \u0026'static kernel::ThisModule) -\u003e Result\u003cSelf\u003e {\n--\ndrivers/android/binder/rust_binder_main.rs-319-        // SAFETY: The module is being loaded, so we can initialize binderfs.\ndrivers/android/binder/rust_binder_main.rs:320:        unsafe { kernel::error::to_result(binderfs::init_rust_binderfs())? };\ndrivers/android/binder/rust_binder_main.rs-321-\n--\ndrivers/android/binder/rust_binder_main.rs=330=unsafe impl\u003cT\u003e Sync for AssertSync\u003cT\u003e {}\ndrivers/android/binder/rust_binder_main.rs-331-\ndrivers/android/binder/rust_binder_main.rs:332:/// File operations that rust_binderfs.c can use.\ndrivers/android/binder/rust_binder_main.rs-333-#[no_mangle]\n--\ndrivers/android/binder/rust_binder_main.rs-382-) -\u003e kernel::ffi::c_int {\ndrivers/android/binder/rust_binder_main.rs:383:    // SAFETY: The `rust_binderfs.c` file ensures that `i_private` is set to a\ndrivers/android/binder/rust_binder_main.rs-384-    // `struct binder_device`.\n--\ndrivers/android/binder/rust_binder_main.rs-388-\ndrivers/android/binder/rust_binder_main.rs:389:    // SAFETY: The `rust_binderfs.c` file ensures that `device-\u003ectx` holds a binder context when\ndrivers/android/binder/rust_binder_main.rs-390-    // using the rust binder fops.\n--\ndrivers/android/binder/rust_binder_main.rs=639=    unsafe fn new(nodp: *mut bindings::inode, pid: i32) -\u003e Result\u003cOption\u003cSelf\u003e\u003e {\ndrivers/android/binder/rust_binder_main.rs-640-        // SAFETY: The caller passes an `inode` for a newly created binder file.\ndrivers/android/binder/rust_binder_main.rs:641:        let dentry = unsafe { binderfs::rust_binderfs_create_proc_file(nodp, pid) };\ndrivers/android/binder/rust_binder_main.rs-642-        match kernel::error::from_err_ptr(dentry) {\n--\ndrivers/android/binder/rust_binder_main.rs=651=    fn drop(\u0026mut self) {\ndrivers/android/binder/rust_binder_main.rs:652:        // SAFETY: This is a dentry from `rust_binderfs_remove_file` that has not been deleted yet.\ndrivers/android/binder/rust_binder_main.rs:653:        unsafe { binderfs::rust_binderfs_remove_file(self.0.as_ptr()) };\ndrivers/android/binder/rust_binder_main.rs-654-    }\n--\ndrivers/android/binder/rust_binderfs.c=453=static struct inode *binderfs_make_inode(struct super_block *sb, int mode)\n--\ndrivers/android/binder/rust_binderfs.c-465-\ndrivers/android/binder/rust_binderfs.c:466:void rust_binderfs_remove_file(struct dentry *dentry)\ndrivers/android/binder/rust_binderfs.c-467-{\n--\ndrivers/android/binder/rust_binderfs.c-470-\ndrivers/android/binder/rust_binderfs.c:471:static struct dentry *rust_binderfs_create_file(struct dentry *parent, const char *name,\ndrivers/android/binder/rust_binderfs.c-472-\t\t\t\t\t\tconst struct file_operations *fops,\n--\ndrivers/android/binder/rust_binderfs.c-495-\ndrivers/android/binder/rust_binderfs.c:496:struct dentry *rust_binderfs_create_proc_file(struct inode *nodp, int pid)\ndrivers/android/binder/rust_binderfs.c-497-{\n--\ndrivers/android/binder/rust_binderfs.c-506-\tsnprintf(strbuf, sizeof(strbuf), \"%u\", pid);\ndrivers/android/binder/rust_binderfs.c:507:\treturn rust_binderfs_create_file(dir, strbuf, \u0026rust_binder_proc_fops, data);\ndrivers/android/binder/rust_binderfs.c-508-}\n--\ndrivers/android/binder/rust_binderfs.c=547=static int init_binder_features(struct super_block *sb)\n--\ndrivers/android/binder/rust_binderfs.c-554-\ndrivers/android/binder/rust_binderfs.c:555:\tdentry = rust_binderfs_create_file(dir, \"oneway_spam_detection\",\ndrivers/android/binder/rust_binderfs.c-556-\t\t\t\t      \u0026binder_features_fops,\n--\ndrivers/android/binder/rust_binderfs.c-560-\ndrivers/android/binder/rust_binderfs.c:561:\tdentry = rust_binderfs_create_file(dir, \"extended_error\",\ndrivers/android/binder/rust_binderfs.c-562-\t\t\t\t      \u0026binder_features_fops,\n--\ndrivers/android/binder/rust_binderfs.c-566-\ndrivers/android/binder/rust_binderfs.c:567:\tdentry = rust_binderfs_create_file(dir, \"freeze_notification\",\ndrivers/android/binder/rust_binderfs.c-568-\t\t\t\t      \u0026binder_features_fops,\n--\ndrivers/android/binder/rust_binderfs.c-572-\ndrivers/android/binder/rust_binderfs.c:573:\tdentry = rust_binderfs_create_file(dir, \"transaction_report\",\ndrivers/android/binder/rust_binderfs.c-574-\t\t\t\t      \u0026binder_features_fops,\n--\ndrivers/android/binder/rust_binderfs.c=582=static int init_binder_logs(struct super_block *sb)\n--\ndrivers/android/binder/rust_binderfs.c-594-\ndrivers/android/binder/rust_binderfs.c:595:\tdentry = rust_binderfs_create_file(binder_logs_root_dir, \"stats\",\ndrivers/android/binder/rust_binderfs.c-596-\t\t\t\t      \u0026rust_binder_stats_fops, NULL);\n--\ndrivers/android/binder/rust_binderfs.c-601-\ndrivers/android/binder/rust_binderfs.c:602:\tdentry = rust_binderfs_create_file(binder_logs_root_dir, \"state\",\ndrivers/android/binder/rust_binderfs.c-603-\t\t\t\t      \u0026rust_binder_state_fops, NULL);\n--\ndrivers/android/binder/rust_binderfs.c-608-\ndrivers/android/binder/rust_binderfs.c:609:\tdentry = rust_binderfs_create_file(binder_logs_root_dir, \"transactions\",\ndrivers/android/binder/rust_binderfs.c-610-\t\t\t\t      \u0026rust_binder_transactions_fops, NULL);\n--\ndrivers/android/binder/rust_binderfs.c-615-\ndrivers/android/binder/rust_binderfs.c:616:\tdentry = rust_binderfs_create_file(binder_logs_root_dir,\ndrivers/android/binder/rust_binderfs.c-617-\t\t\t\t      \"transaction_log\",\n--\ndrivers/android/binder/rust_binderfs.c-624-\ndrivers/android/binder/rust_binderfs.c:625:\tdentry = rust_binderfs_create_file(binder_logs_root_dir,\ndrivers/android/binder/rust_binderfs.c-626-\t\t\t\t      \"failed_transaction_log\",\n--\ndrivers/android/binder/rust_binderfs.c=784=static struct file_system_type binder_fs_type = {\n--\ndrivers/android/binder/rust_binderfs.c-791-\ndrivers/android/binder/rust_binderfs.c:792:int init_rust_binderfs(void)\ndrivers/android/binder/rust_binderfs.c-793-{\n"
}

39/2 2026/11/13 12:31 llm patch-evaluator
0m Model:
gemini-3.8-flash

Args:
null

Results:
null

Tokens:
							input: 51701
							output: 32
							thoughts: 15
						

Thoughts:
Here's my attempt at summarizing the thought process, tailored for an expert audience:

**Investigating `rust_binderfs.c` Configuration**

Alright, let's dive in. I need to figure out the configuration that enables `rust_binderfs.c`. This isn't just a casual curiosity; I'm assuming there's a specific set of kernel options or build flags that bring this module into existence. I want to understand the dependencies and the overall build process that governs this component. Is it a module compiled conditionally based on a Kconfig variable? Does it rely on a specific feature set or hardware configuration? Or perhaps it's pulled in transitively through some other dependency chain. The goal is to fully understand the build options that activate this particular functionality. This is the first question I need to answer.



40/2 2026/11/13 12:32 tool grepper
0m Args:
{
  "Expression": "RUST_ANDROID_BINDER",
  "PathPrefixes": [
    "drivers/android/"
  ]
}

Results:
{
  "Output": "no matches"
}

41/2 2026/11/13 12:32 llm patch-evaluator
0m Model:
gemini-3.8-flash

Args:
null

Results:
null

Tokens:
							input: 51933
							output: 29
							thoughts: 13
						

Thoughts:
Here's a summary of my thought process, as requested:

**Diving into the Android Binder Makefile**

Okay, so I need to understand something related to the Android Binder driver. My first step is to immediately go to the `drivers/android/binder/Makefile`. That's the obvious place to start when I need to understand how this module is built and configured within the kernel. It's the central configuration point for this part of the driver. I need to understand the build process. From this Makefile, I will see dependencies, compilation flags, and potential build configurations that are specific to the Binder module. That will give me a solid foundation. Let's start there.



42/2 2026/11/13 12:32 tool grepper
0m Args:
{
  "Expression": "binder",
  "PathPrefixes": [
    "drivers/android/binder/Makefile"
  ]
}

Results:
{
  "Output": "drivers/android/binder/Makefile=2=ccflags-y += -I$(src)\t# needed for trace events\ndrivers/android/binder/Makefile-3-\ndrivers/android/binder/Makefile:4:obj-$(CONFIG_ANDROID_BINDER_IPC_RUST) += binder.o\ndrivers/android/binder/Makefile:5:binder-y := \\\ndrivers/android/binder/Makefile:6:\trust_binder_main.o\t\\\ndrivers/android/binder/Makefile:7:\trust_binderfs.o\t\t\\\ndrivers/android/binder/Makefile:8:\trust_binder_events.o\n"
}

43/2 2026/11/13 12:32 llm patch-evaluator
0m Model:
gemini-3.8-flash

Args:
null

Results:
null

Tokens:
							input: 52273
							output: 25
							thoughts: 42
						

Thoughts:
Okay, here's my interpretation of these thoughts, formatted as you requested:

**Navigating the Codebase: Rust Binder Integration**

Right, *CONFIG_ANDROID_BINDER_IPC_RUST*... that's the key. My brain's latching onto this because it's the specific flag that's probably gating the Rust-based Binder implementation. I need to understand its scope and dependencies. First things first, I need to check how it’s being used and, critically, other related configuration options.

I'm thinking I’ll see what else is going on. Specifically, I'm going to look at other parts of the kernel. `fs/nullfs.c` stands out. What configuration setting *enables* that? It's always useful to cross-reference unrelated functionality, as it's possible that this will provide useful context for where the Binder code is used, or may provide other potentially interesting related configurations. This cross-referencing may also help reveal unexpected dependencies.



44/2 2026/11/13 12:33 tool grepper
0m Args:
{
  "Expression": "nullfs",
  "PathPrefixes": [
    "fs/"
  ]
}

Results:
{
  "Output": "\nFull output is too long, showing 200 out of 243 lines.\nUse more precise expression or PathPrefixes if possible.\n\nNumber of matching lines per file (5 files in total):\nfs/Makefile:1\nfs/fs_struct.c:2\nfs/mount.h:3\nfs/namespace.c:37\nfs/nullfs.c:42\n\nfs/Makefile=10=obj-y :=\topen.o read_write.o file_table.o super.o \\\n--\nfs/Makefile-18-\t\tkernel_read_file.o mnt_idmapping.o remap_range.o pidfs.o \\\nfs/Makefile:19:\t\tfile_attr.o fserror.o nullfs.o failfs.o\nfs/Makefile-20-\n--\nfs/fs_struct.c=155=EXPORT_SYMBOL_GPL(unshare_fs_struct);\n--\nfs/fs_struct.c-181- * Be aggressive about this: We simply reject operating on stale\nfs/fs_struct.c:182: * fs_struct state by reverting to nullfs. Every kworker that does\nfs/fs_struct.c-183- * lookups after this point will fail. Every usermodehelper call will\n--\nfs/fs_struct.c=231=void __init init_userspace_fs(void)\n--\nfs/fs_struct.c-235-\nfs/fs_struct.c:236:\t/* Move PID 1 from nullfs into the initramfs. */\nfs/fs_struct.c-237-\tm = topmost_overmount(current-\u003ensproxy-\u003emnt_ns-\u003eroot);\n--\nfs/mount.h-7-\nfs/mount.h:8:extern struct file_system_type nullfs_fs_type;\nfs/mount.h:9:extern struct dentry *nullfs_new_file(struct super_block *sb);\nfs/mount.h:10:extern struct vfsmount *knullfs;\nfs/mount.h-11-extern struct list_head notify_list;\n--\nfs/namespace.c=82=static struct kmem_cache *mnt_cache __ro_after_init;\nfs/namespace.c:83:struct vfsmount *knullfs __ro_after_init;\t/* private nullfs instance */\nfs/namespace.c:84:static struct vfsmount *knullfs_file __ro_after_init;\t/* its regular file */\nfs/namespace.c-85-static DECLARE_RWSEM(namespace_sem);\n--\nfs/namespace.c=804=static bool legitimize_mnt(struct vfsmount *bastard, unsigned seq)\n--\nfs/namespace.c-823- * If @mnt is unmounted and a child that was unmounted with it left its\nfs/namespace.c:824: * cover behind at @dentry, return the stand-in for it instead: knullfs\nfs/namespace.c-825- * for a directory, its regular file for anything else.\n--\nfs/namespace.c=832=struct mount *__lookup_mnt(struct vfsmount *mnt, struct dentry *dentry)\n--\nfs/namespace.c-845-\t\t\tif (cover-\u003edentry == dentry)\nfs/namespace.c:846:\t\t\t\treturn real_mount(d_is_dir(dentry) ? knullfs : knullfs_file);\nfs/namespace.c-847-\t}\n--\nfs/namespace.c=3209=static struct mnt_namespace *create_new_namespace(struct path *path,\n--\nfs/namespace.c-3240-\nfs/namespace.c:3241:\tVFS_WARN_ON_ONCE(old_ns_root-\u003emnt.mnt_sb-\u003es_type != \u0026nullfs_fs_type);\nfs/namespace.c-3242-\n--\nfs/namespace.c=4846=int path_pivot_root(struct path *new, struct path *old)\n--\nfs/namespace.c-4930- *\nfs/namespace.c:4931: * The immutable nullfs filesystem is mounted as the true root of the VFS\nfs/namespace.c-4932- * hierarchy. The mutable rootfs (tmpfs/ramfs) is layered on top of this,\n--\nfs/namespace.c=6367=struct mnt_namespace init_mnt_ns = {\n--\nfs/namespace.c-6374-\nfs/namespace.c:6375:static void __init mount_rootfs_on_nullfs(struct vfsmount *mnt,\nfs/namespace.c:6376:\t\t\t\t\t  struct vfsmount *nullfs_mnt)\nfs/namespace.c-6377-{\nfs/namespace.c-6378-\tstruct path root = {\nfs/namespace.c:6379:\t\t.mnt\t= nullfs_mnt,\nfs/namespace.c:6380:\t\t.dentry\t= nullfs_mnt-\u003emnt_root,\nfs/namespace.c-6381-\t};\n--\nfs/namespace.c-6384-\tif (unlikely(IS_ERR(mp.parent)))\nfs/namespace.c:6385:\t\tpanic(\"VFS: Failed to mount rootfs on nullfs\");\nfs/namespace.c-6386-\tscoped_guard(mount_writer)\n--\nfs/namespace.c-6389-\nfs/namespace.c:6390:static struct vfsmount *__init knullfs_file_mount(void)\nfs/namespace.c-6391-{\n--\nfs/namespace.c-6394-\nfs/namespace.c:6395:\tfile = nullfs_new_file(knullfs-\u003emnt_sb);\nfs/namespace.c-6396-\tif (IS_ERR(file))\nfs/namespace.c-6397-\t\treturn ERR_CAST(file);\nfs/namespace.c:6398:\tmnt = clone_mnt(real_mount(knullfs), file, CL_PRIVATE);\nfs/namespace.c-6399-\tdput(file);\n--\nfs/namespace.c=6409=static void __init init_mount_tree(void)\nfs/namespace.c-6410-{\nfs/namespace.c:6411:\tstruct vfsmount *mnt, *nullfs_mnt;\nfs/namespace.c-6412-\tstruct mount *mnt_root;\n--\nfs/namespace.c-6417-\t *\nfs/namespace.c:6418:\t * (1) nullfs with mount id 1\nfs/namespace.c-6419-\t * (2) mutable rootfs with mount id 2\nfs/namespace.c:6420:\t * (3) private nullfs for kthreads (SB_KERNMOUNT), kept in knullfs\nfs/namespace.c-6421-\t * (4) a second mount of (3) rooted on a regular file, kept in\nfs/namespace.c:6422:\t *     knullfs_file\nfs/namespace.c-6423-\t *\nfs/namespace.c-6424-\t * with (2) mounted on top of (1). The init_task's root and pwd\nfs/namespace.c:6425:\t * are pointed at (3) so all kthreads start isolated in nullfs.\nfs/namespace.c-6426-\t * A lookup at the cover an unmounted mount left behind finds (3)\n--\nfs/namespace.c-6428-\t */\nfs/namespace.c:6429:\tnullfs_mnt = vfs_kern_mount(\u0026nullfs_fs_type, 0, \"nullfs\", NULL);\nfs/namespace.c:6430:\tif (IS_ERR(nullfs_mnt))\nfs/namespace.c:6431:\t\tpanic(\"VFS: Failed to create nullfs\");\nfs/namespace.c-6432-\n--\nfs/namespace.c-6436-\nfs/namespace.c:6437:\tVFS_WARN_ON_ONCE(real_mount(nullfs_mnt)-\u003emnt_id != 1);\nfs/namespace.c-6438-\tVFS_WARN_ON_ONCE(real_mount(mnt)-\u003emnt_id != 2);\nfs/namespace.c-6439-\nfs/namespace.c:6440:\t/* The namespace root is the nullfs mnt. */\nfs/namespace.c:6441:\tmnt_root\t\t= real_mount(nullfs_mnt);\nfs/namespace.c-6442-\tinit_mnt_ns.root\t= mnt_root;\nfs/namespace.c-6443-\nfs/namespace.c:6444:\tmount_rootfs_on_nullfs(mnt, nullfs_mnt);\nfs/namespace.c-6445-\nfs/namespace.c:6446:\tpr_info(\"VFS: Finished mounting rootfs on nullfs\\n\");\nfs/namespace.c-6447-\n--\nfs/namespace.c-6458-\nfs/namespace.c:6459:\tknullfs = kern_mount(\u0026nullfs_fs_type);\nfs/namespace.c:6460:\tif (IS_ERR(knullfs))\nfs/namespace.c:6461:\t\tpanic(\"VFS: Failed to create private nullfs instance\");\nfs/namespace.c-6462-\t/* nothing is ever mounted on the root of a kernel thread */\nfs/namespace.c:6463:\tdont_mount(knullfs-\u003emnt_root);\nfs/namespace.c-6464-\t/* and nothing is ever written through it */\nfs/namespace.c:6465:\tknullfs-\u003emnt_flags |= MNT_READONLY;\nfs/namespace.c:6466:\tknullfs_file = knullfs_file_mount();\nfs/namespace.c:6467:\tif (IS_ERR(knullfs_file))\nfs/namespace.c:6468:\t\tpanic(\"VFS: Failed to create the nullfs file stand-in\");\nfs/namespace.c:6469:\troot.mnt\t= knullfs;\nfs/namespace.c:6470:\troot.dentry\t= knullfs-\u003emnt_root;\nfs/namespace.c-6471-\n--\nfs/nullfs.c-11-\nfs/nullfs.c:12:static const struct super_operations nullfs_super_operations = {\nfs/nullfs.c-13-\t.statfs\t= simple_statfs,\n--\nfs/nullfs.c-15-\nfs/nullfs.c:16:static loff_t nullfs_dir_llseek(struct file *file, loff_t offset, int whence)\nfs/nullfs.c-17-{\n--\nfs/nullfs.c-21-\nfs/nullfs.c:22:static int nullfs_dir_readdir(struct file *file, struct dir_context *ctx)\nfs/nullfs.c-23-{\n--\nfs/nullfs.c-27-\nfs/nullfs.c:28:/* the one inode of nullfs is shared by every holder, so no locks on it */\nfs/nullfs.c:29:static int nullfs_nolock(struct file *file, int cmd, struct file_lock *fl)\nfs/nullfs.c-30-{\n--\nfs/nullfs.c-34-/* what libfs gives an empty directory, plus the refusal of file locks */\nfs/nullfs.c:35:static const struct file_operations nullfs_dir_operations = {\nfs/nullfs.c:36:\t.llseek\t\t= nullfs_dir_llseek,\nfs/nullfs.c-37-\t.read\t\t= generic_read_dir,\nfs/nullfs.c:38:\t.iterate_shared\t= nullfs_dir_readdir,\nfs/nullfs.c-39-\t.fsync\t\t= noop_fsync,\nfs/nullfs.c:40:\t.lock\t\t= nullfs_nolock,\nfs/nullfs.c:41:\t.flock\t\t= nullfs_nolock,\nfs/nullfs.c-42-\t.fop_flags\t= FOP_IMMUTABLE,\n--\nfs/nullfs.c-44-\nfs/nullfs.c:45:static ssize_t nullfs_file_read_iter(struct kiocb *iocb, struct iov_iter *to)\nfs/nullfs.c-46-{\n--\nfs/nullfs.c-49-\nfs/nullfs.c:50:static ssize_t nullfs_file_splice_read(struct file *in, loff_t *ppos,\nfs/nullfs.c-51-\t\t\t\t       struct pipe_inode_info *pipe,\n--\nfs/nullfs.c-56-\nfs/nullfs.c:57:static ssize_t nullfs_file_write_iter(struct kiocb *iocb, struct iov_iter *from)\nfs/nullfs.c-58-{\n--\nfs/nullfs.c-64-\nfs/nullfs.c:65:static int nullfs_pipe_to_null(struct pipe_inode_info *pipe,\nfs/nullfs.c-66-\t\t\t       struct pipe_buffer *buf, struct splice_desc *sd)\n--\nfs/nullfs.c-70-\nfs/nullfs.c:71:static ssize_t nullfs_file_splice_write(struct pipe_inode_info *pipe,\nfs/nullfs.c-72-\t\t\t\t\tstruct file *out, loff_t *ppos,\n--\nfs/nullfs.c-74-{\nfs/nullfs.c:75:\treturn splice_from_pipe(pipe, out, ppos, len, flags, nullfs_pipe_to_null);\nfs/nullfs.c-76-}\nfs/nullfs.c-77-\nfs/nullfs.c:78:static int nullfs_file_setattr(const struct mnt_idmap *idmap,\nfs/nullfs.c-79-\t\t\t       struct dentry *dentry,\n--\nfs/nullfs.c-86-\nfs/nullfs.c:87:static const struct inode_operations nullfs_file_inode_operations = {\nfs/nullfs.c:88:\t.setattr\t= nullfs_file_setattr,\nfs/nullfs.c-89-};\nfs/nullfs.c-90-\nfs/nullfs.c:91:static const struct file_operations nullfs_file_operations = {\nfs/nullfs.c-92-\t.llseek\t\t= generic_file_llseek,\nfs/nullfs.c:93:\t.read_iter\t= nullfs_file_read_iter,\nfs/nullfs.c:94:\t.write_iter\t= nullfs_file_write_iter,\nfs/nullfs.c:95:\t.splice_read\t= nullfs_file_splice_read,\nfs/nullfs.c:96:\t.splice_write\t= nullfs_file_splice_write,\nfs/nullfs.c-97-\t.fsync\t\t= noop_fsync,\nfs/nullfs.c:98:\t.lock\t\t= nullfs_nolock,\nfs/nullfs.c:99:\t.flock\t\t= nullfs_nolock,\nfs/nullfs.c-100-};\n--\nfs/nullfs.c-105- */\n\n"
}

45/2 2026/11/13 12:33 llm patch-evaluator
1m Model:
gemini-3.8-flash

Args:
null

Results:
null

Tokens:
							input: 56448
							output: 38
							thoughts: 3194
						

Thoughts:
**Focusing on Filesystem Backing Store Integrity**

Okay, so I'm digging into this code and trying to figure out the best approach for fuzzing these changes.  My initial thought is that `nullfs.o` is unconditionally built, but that's a red herring. It's irrelevant to the core change. Similarly, `failfs.c` is also always built, so not a focus point either. The `XEN_FS` stuff is architecture-specific, so not globally relevant.

I need to identify the *specific* functions and entrypoints where the logic of rejecting pseudo files in backing storage is implemented. Looking at the diff, it's pretty clear that these are the key areas:

1.  `loop_configure` (and its helper `loop_check_backing_file`).  This is because it configures the backing file.
2.  `fuse_backing_open` and `fuse_backing_open_64` (and its helper `fuse_backing_open_file`). These are core to how FUSE handles backing files.
3.  `fsg_lun_open` – This is used with USB gadget mass storage, where backing storage might be employed.
4.  `erofs_file_get_tree` and `erofs_init_device` – These are crucial for EROFS's file-backed tree creation.
5.  `nvmet_file_ns_enable` – This function enables file namespaces within NVMe-over-Fabric target, which could involve file-backed storage.
6.  `fd_configure_device` – This is the configuration function for the Target Core File I/O.
7.  `zloop_ctl_add` (and its helper `zloop_init_zone`) – Zoned loop device setup uses a backing file, so that's a potential entry point for pseudo files.

My intuition says the `init_fs_context` functions (like `bpf_init_fs_context`, `devpts_init_fs_context`, etc.) are *not* the primary targets, because they are called on file system mount *not* when the pseudo file check is done. They are entrypoints to mounting a filesystem like the others, so not as specific. They're more general. And, `init_fs_context` calls for filesystems like BPF, devpts, or binfmt_misc are triggered during mount, and mounting particular filesystems is not ubiquitous. These other functions are, however, the direct entry points for the *changes* that are in the diff, the ones that are likely to trigger the new checks.

Now, since syzkaller can resolve symbols by name, I *can* include both the static helpers (if the compiler doesn't inline them) and the callers to ensure coverage. For example, include `loop_configure` *and* `loop_check_backing_file`. It's better to be comprehensive.

From a quick check, it looks like:

*   `loop_check_backing_file` is static, but `loop_configure` is the caller that configures the backing file.
*   `fuse_backing_open` and `fuse_backing_open_64` are not static.
*   `erofs_file_get_tree` is static, and its caller is `erofs_fc_get_tree`.
*   `fsg_lun_open` is not static.
*   `nvmet_file_ns_enable` is not static.
*   `fd_configure_device` is static, but pointed to by `fileio_ops.configure_device`.
*  `zloop_init_zone` is static, but `zloop_ctl_add` is the non-static caller.
*   `init_pseudo` and `kernfs_get_tree` are not static.
*   `bpf_init_fs_context` is static, but its address is taken by `bpf_fs_type.init_fs_context`.

I need to confirm all the relevant configurations, too, especially the ones that enable loop and zoned loop functionality.  `BLK_DEV_LOOP` and `BLK_DEV_ZONED_LOOP` are the key ones for the block device changes.



46/2 2026/11/13 12:34 tool grepper
0m Args:
{
  "Expression": "config BLK_DEV_ZONED_LOOP",
  "PathPrefixes": [
    "drivers/block/Kconfig"
  ]
}

Results:
{
  "Output": "drivers/block/Kconfig=354=source \"drivers/block/rnbd/Kconfig\"\ndrivers/block/Kconfig-355-\ndrivers/block/Kconfig:356:config BLK_DEV_ZONED_LOOP\ndrivers/block/Kconfig-357-\ttristate \"Zoned loopback device support\"\n"
}

47/2 2026/11/13 12:34 llm patch-evaluator
0m Model:
gemini-3.8-flash

Args:
null

Results:
null

Tokens:
							input: 60707
							output: 34
							thoughts: 19
						

Thoughts:
Okay, let's dive into this. Here's my take on those instructions, as if they're my internal thought process:

**Diving into the Block Device Configuration**

Alright, I'm going to take a look at the block device configuration. Specifically, I'm heading over to the `drivers/block/Kconfig` file and zeroing in around line 356. I figure this is a good place to start, given the context. Knowing the kernel configuration system, `Kconfig` is obviously where the feature flags and dependencies for different block device drivers are defined. Line 356... well, that's where the interesting bits *probably* are. It's likely related to a specific block driver feature or a key section that I'm keen on understanding better. Time to get my hands dirty and find out what's going on!



48/2 2026/11/13 12:34 tool read-file
0m Args:
{
  "File": "drivers/block/Kconfig",
  "FirstLine": 355,
  "LineCount": 25
}

Results:
{
  "Contents": " 355:\t\n 356:\tconfig BLK_DEV_ZONED_LOOP\n 357:\t\ttristate \"Zoned loopback device support\"\n 358:\t\tdepends on BLK_DEV_ZONED\n 359:\t\thelp\n 360:\t\t  Saying Y here will allow you to use create a zoned block device using\n 361:\t\t  regular files for zones (one file per zones). This is useful to test\n 362:\t\t  file systems, device mapper and applications that support zoned block\n 363:\t\t  devices. To create a zoned loop device, no user utility is needed, a\n 364:\t\t  zoned loop device can be created (or re-started) using a command\n 365:\t\t  like:\n 366:\t\n 367:\t\t  echo \"add id=0,zone_size_mb=256,capacity_mb=16384,conv_zones=11\" \u003e \\\n 368:\t\t\t/dev/zloop-control\n 369:\t\n 370:\t\t  See Documentation/admin-guide/blockdev/zoned_loop.rst for usage\n 371:\t\t  details.\n 372:\t\n 373:\t\t  If unsure, say N.\n 374:\t\n 375:\tendif # BLK_DEV\n"
}

49/2 2026/11/13 12:34 llm patch-evaluator
0m Model:
gemini-3.8-flash

Args:
null

Results:
null

Tokens:
							input: 61295
							output: 35
							thoughts: 47
						

Thoughts:
Okay, here's my interpretation of that thought process, from an expert's perspective:

**Dependencies and Configuration Checks**

Alright, so I'm looking at `BLK_DEV_ZONED_LOOP`. I already know that `BLK_DEV_ZONED_LOOP` is inherently dependent on `BLK_DEV_ZONED` – that's a given. I need to make sure the zoning feature is present. No surprises there. Now, my next instinct is to check how this interacts with `CONFIG_NVME_TARGET`. Given that the NVMe protocol has zoned features, I'll need to poke into the configuration options to determine the interaction between `BLK_DEV_ZONED_LOOP` and NVMe target support. The logical place to start is the `drivers/nvme/target/Kconfig` file. I'm going to quickly review that file to see how NVMe target is defined in relation to zoning.



50/2 2026/11/13 12:35 tool grepper
0m Args:
{
  "Expression": "config NVME_TARGET",
  "PathPrefixes": [
    "drivers/nvme/target/Kconfig"
  ]
}

Results:
{
  "Output": "drivers/nvme/target/Kconfig-2-\ndrivers/nvme/target/Kconfig:3:config NVME_TARGET\ndrivers/nvme/target/Kconfig-4-\ttristate \"NVMe Target support\"\n--\ndrivers/nvme/target/Kconfig-19-\ndrivers/nvme/target/Kconfig:20:config NVME_TARGET_DEBUGFS\ndrivers/nvme/target/Kconfig-21-        bool \"NVMe Target debugfs support\"\n--\ndrivers/nvme/target/Kconfig-28-\ndrivers/nvme/target/Kconfig:29:config NVME_TARGET_PASSTHRU\ndrivers/nvme/target/Kconfig-30-\tbool \"NVMe Target Passthrough support\"\n--\ndrivers/nvme/target/Kconfig-40-\ndrivers/nvme/target/Kconfig:41:config NVME_TARGET_LOOP\ndrivers/nvme/target/Kconfig-42-\ttristate \"NVMe loopback device support\"\n--\ndrivers/nvme/target/Kconfig-51-\ndrivers/nvme/target/Kconfig:52:config NVME_TARGET_RDMA\ndrivers/nvme/target/Kconfig-53-\ttristate \"NVMe over Fabrics RDMA target support\"\n--\ndrivers/nvme/target/Kconfig-62-\ndrivers/nvme/target/Kconfig:63:config NVME_TARGET_FC\ndrivers/nvme/target/Kconfig-64-\ttristate \"NVMe over Fabrics FC target driver\"\n--\ndrivers/nvme/target/Kconfig-73-\ndrivers/nvme/target/Kconfig:74:config NVME_TARGET_FCLOOP\ndrivers/nvme/target/Kconfig-75-\ttristate \"NVMe over Fabrics FC Transport Loopback Test driver\"\n--\ndrivers/nvme/target/Kconfig-86-\ndrivers/nvme/target/Kconfig:87:config NVME_TARGET_TCP\ndrivers/nvme/target/Kconfig-88-\ttristate \"NVMe over Fabrics TCP target support\"\n--\ndrivers/nvme/target/Kconfig-96-\ndrivers/nvme/target/Kconfig:97:config NVME_TARGET_TCP_TLS\ndrivers/nvme/target/Kconfig-98-\tbool \"NVMe over Fabrics TCP target TLS encryption support\"\n--\ndrivers/nvme/target/Kconfig-109-\ndrivers/nvme/target/Kconfig:110:config NVME_TARGET_AUTH\ndrivers/nvme/target/Kconfig-111-\tbool \"NVMe over Fabrics In-band Authentication in target side\"\n--\ndrivers/nvme/target/Kconfig-119-\ndrivers/nvme/target/Kconfig:120:config NVME_TARGET_AUTH_DEBUG\ndrivers/nvme/target/Kconfig-121-\tbool \"NVMe over Fabrics In-band Authentication debug messages\"\n--\ndrivers/nvme/target/Kconfig-128-\ndrivers/nvme/target/Kconfig:129:config NVME_TARGET_PCI_EPF\ndrivers/nvme/target/Kconfig-130-\ttristate \"NVMe PCI Endpoint Function target support\"\n"
}

51/2 2026/11/13 12:35 llm patch-evaluator
0m Model:
gemini-3.8-flash

Args:
null

Results:
null

Tokens:
							input: 62370
							output: 35
							thoughts: 22
						

Thoughts:
Here's my take on those lines from `drivers/nvme/target/Kconfig`, thinking like a seasoned kernel developer:

**Kconfig Musings: NVMe Target Module**

Alright, let's dive into the first fifteen lines of this `Kconfig` file. I immediately recognize this as the configuration file for the NVMe target driver – critical stuff, especially as NVMe becomes a cornerstone for high-performance storage. Let me quickly scan this section to see what's being set up initially. I'm looking for the core options and dependencies being defined, as well as the fundamental prerequisites for enabling the NVMe target functionality. I'd expect to see the basic `tristate` selection, and maybe some early definitions that establish the foundation for the more complex options that will surely follow. Essentially, I'm expecting this to determine whether or not the NVMe target driver will even *be* a compilation target. Let's see what gems are hidden in this initial setup. I hope nothing jumps out as an immediate area for concern!



52/2 2026/11/13 12:35 tool read-file
0m Args:
{
  "File": "drivers/nvme/target/Kconfig",
  "FirstLine": 1,
  "LineCount": 18
}

Results:
{
  "Contents": "   1:\t# SPDX-License-Identifier: GPL-2.0-only\n   2:\t\n   3:\tconfig NVME_TARGET\n   4:\t\ttristate \"NVMe Target support\"\n   5:\t\tdepends on BLOCK\n   6:\t\tselect CONFIGFS_FS\n   7:\t\tselect NVME_KEYRING if NVME_TARGET_TCP_TLS\n   8:\t\tselect KEYS if NVME_TARGET_TCP_TLS\n   9:\t\tselect SGL_ALLOC\n  10:\t\thelp\n  11:\t\t  This enabled target side support for the NVMe protocol, that is\n  12:\t\t  it allows the Linux kernel to implement NVMe subsystems and\n  13:\t\t  controllers and export Linux block devices as NVMe namespaces.\n  14:\t\t  You need to select at least one of the transports below to make this\n  15:\t\t  functionality useful.\n  16:\t\n  17:\t\t  To configure the NVMe target you probably want to use the nvmetcli\n  18:\t\t  tool from http://git.infradead.org/users/hch/nvmetcli.git.\n"
}

53/2 2026/11/13 12:35 llm patch-evaluator
0m Model:
gemini-3.8-flash

Args:
null

Results:
null

Tokens:
							input: 62925
							output: 30
							thoughts: 22
						

Thoughts:
Okay, here's my summary, tailored for an expert audience, as if I'm thinking these things myself:

**Tracing the Definition of `CONFIG_TCM_FILEIO`**

Alright, let's drill down into this. My immediate concern is understanding the scope of `CONFIG_TCM_FILEIO`. To properly analyze its impact, the first thing I need to do is locate where it's actually *defined* within the Kconfig system. Knowing the definition location is crucial for understanding its dependencies, defaults, and the contexts in which it's intended to be used. I need to trace this back. So, where is this thing actually defined in Kconfig? Let's go find that.



54/2 2026/11/13 12:36 tool grepper
0m Args:
{
  "Expression": "config TCM_FILEIO",
  "PathPrefixes": [
    "drivers/target/"
  ]
}

Results:
{
  "Output": "drivers/target/Kconfig=18=config TCM_IBLOCK\n--\ndrivers/target/Kconfig-24-\ndrivers/target/Kconfig:25:config TCM_FILEIO\ndrivers/target/Kconfig-26-\ttristate \"TCM/FILEIO Subsystem Plugin for Linux/VFS\"\n"
}

55/2 2026/11/13 12:36 llm patch-evaluator
0m Model:
gemini-3.8-flash

Args:
null

Results:
null

Tokens:
							input: 63214
							output: 32
							thoughts: 18
						

Thoughts:
Here's a summary of my thought process, keeping in mind my expert understanding:

**Navigating the Configuration Landscape**

Okay, so I'm digging into this driver code, probably to understand its configuration options. My immediate thought is to zero in on the `drivers/target/Kconfig` file, specifically around line 25. That's a pretty standard place to find the main configuration directives for a driver, like `bool`, `tristate`, `depends on`, and so on. I'm likely looking for what features are enabled, disabled, or built-in, and under what circumstances. This area will give me insight into how the driver behaves and what dependencies it has on other parts of the system. I'll need to pay close attention to the conditions for selecting options and any interdependencies as I'm thinking about how all this will impact the target system.



56/2 2026/11/13 12:36 tool read-file
0m Args:
{
  "File": "drivers/target/Kconfig",
  "FirstLine": 1,
  "LineCount": 40
}

Results:
{
  "Contents": "   1:\t# SPDX-License-Identifier: GPL-2.0-only\n   2:\t\n   3:\tmenuconfig TARGET_CORE\n   4:\t\ttristate \"Generic Target Core Mod (TCM) and ConfigFS Infrastructure\"\n   5:\t\tdepends on BLOCK\n   6:\t\tselect CONFIGFS_FS\n   7:\t\tselect CRC_T10DIF\n   8:\t\tselect SCSI_COMMON\n   9:\t\tselect SGL_ALLOC\n  10:\t\tdefault n\n  11:\t\thelp\n  12:\t\tSay Y or M here to enable the TCM Storage Engine and ConfigFS enabled\n  13:\t\tcontrol path for target_core_mod.  This includes built-in TCM RAMDISK\n  14:\t\tsubsystem logic for virtual LUN 0 access\n  15:\t\n  16:\tif TARGET_CORE\n  17:\t\n  18:\tconfig TCM_IBLOCK\n  19:\t\ttristate \"TCM/IBLOCK Subsystem Plugin for Linux/BLOCK\"\n  20:\t\tselect BLK_DEV_INTEGRITY\n  21:\t\thelp\n  22:\t\tSay Y here to enable the TCM/IBLOCK subsystem plugin for non-buffered\n  23:\t\taccess to Linux/Block devices using BIO\n  24:\t\n  25:\tconfig TCM_FILEIO\n  26:\t\ttristate \"TCM/FILEIO Subsystem Plugin for Linux/VFS\"\n  27:\t\thelp\n  28:\t\tSay Y here to enable the TCM/FILEIO subsystem plugin for buffered\n  29:\t\taccess to Linux/VFS struct file or struct block_device\n  30:\t\n  31:\tconfig TCM_PSCSI\n  32:\t\ttristate \"TCM/pSCSI Subsystem Plugin for Linux/SCSI\"\n  33:\t\tdepends on SCSI\n  34:\t\thelp\n  35:\t\tSay Y here to enable the TCM/pSCSI subsystem plugin for non-buffered\n  36:\t\tpassthrough access to Linux/SCSI device\n  37:\t\n  38:\tconfig TCM_USER2\n  39:\t\ttristate \"TCM/USER Subsystem Plugin for Linux\"\n  40:\t\tdepends on UIO \u0026\u0026 NET\n"
}

57/2 2026/11/13 12:36 llm patch-evaluator
0m Model:
gemini-3.8-flash

Args:
null

Results:
null

Tokens:
							input: 63990
							output: 32
							thoughts: 54
						

Thoughts:
Okay, here's my take on those thoughts, tailored for an expert audience and presented in the first person:

**Erofs Configuration Considerations**

Alright, let's see, the system is indicating potential involvement of `TARGET_CORE` and `TCM_FILEIO` in this scenario, so I immediately want to drill down on the erofs configuration. My mind instinctively jumps to `fs/erofs/Kconfig`. That's where I need to confirm the status of `CONFIG_EROFS_FS` and, more importantly given the context, `CONFIG_EROFS_FS_BACKED_BY_FILE`. These are the key variables. I need to know if we're dealing with a general erofs filesystem configuration and whether it's using a file-backed approach. The implications for `TARGET_CORE` and `TCM_FILEIO` could be significant depending on the answers. This will guide my next steps in investigating how these components are interacting. I'll need to analyze the resulting build configuration and the underlying code to fully understand the relationship.



58/2 2026/11/13 12:36 tool grepper
0m Args:
{
  "Expression": "config EROFS_FS",
  "PathPrefixes": [
    "fs/erofs/"
  ]
}

Results:
{
  "Output": "fs/erofs/Kconfig-2-\nfs/erofs/Kconfig:3:config EROFS_FS\nfs/erofs/Kconfig-4-\ttristate \"EROFS filesystem support\"\n--\nfs/erofs/Kconfig-49-\nfs/erofs/Kconfig:50:config EROFS_FS_DEBUG\nfs/erofs/Kconfig-51-\tbool \"EROFS debugging feature\"\n--\nfs/erofs/Kconfig-59-\nfs/erofs/Kconfig:60:config EROFS_FS_XATTR\nfs/erofs/Kconfig-61-\tbool \"EROFS extended attributes\"\n--\nfs/erofs/Kconfig-70-\nfs/erofs/Kconfig:71:config EROFS_FS_POSIX_ACL\nfs/erofs/Kconfig-72-\tbool \"EROFS Access Control Lists\"\n--\nfs/erofs/Kconfig-84-\nfs/erofs/Kconfig:85:config EROFS_FS_SECURITY\nfs/erofs/Kconfig-86-\tbool \"EROFS Security Labels\"\n--\nfs/erofs/Kconfig-97-\nfs/erofs/Kconfig:98:config EROFS_FS_BACKED_BY_FILE\nfs/erofs/Kconfig-99-\tbool \"File-backed EROFS filesystem support\"\n--\nfs/erofs/Kconfig-111-\nfs/erofs/Kconfig:112:config EROFS_FS_ZIP\nfs/erofs/Kconfig-113-\tbool \"EROFS Data Compression Support\"\n--\nfs/erofs/Kconfig-121-\nfs/erofs/Kconfig:122:config EROFS_FS_ZIP_LZMA\nfs/erofs/Kconfig-123-\tbool \"EROFS LZMA compressed data support\"\n--\nfs/erofs/Kconfig-133-\nfs/erofs/Kconfig:134:config EROFS_FS_ZIP_LZMA_DEFAULT_MAX_STREAMS\nfs/erofs/Kconfig-135-\tint \"EROFS LZMA default maximum decompression streams\"\n--\nfs/erofs/Kconfig-148-\nfs/erofs/Kconfig:149:config EROFS_FS_ZIP_DEFLATE\nfs/erofs/Kconfig-150-\tbool \"EROFS DEFLATE compressed data support\"\n--\nfs/erofs/Kconfig-159-\nfs/erofs/Kconfig:160:config EROFS_FS_ZIP_ZSTD\nfs/erofs/Kconfig-161-\tbool \"EROFS Zstandard compressed data support\"\n--\nfs/erofs/Kconfig-170-\nfs/erofs/Kconfig:171:config EROFS_FS_ZIP_ACCEL\nfs/erofs/Kconfig-172-\tbool \"EROFS hardware decompression support\"\n--\nfs/erofs/Kconfig-184-\nfs/erofs/Kconfig:185:config EROFS_FS_PCPU_KTHREAD\nfs/erofs/Kconfig-186-\tbool \"EROFS per-cpu decompression kthread workers\"\n--\nfs/erofs/Kconfig-193-\nfs/erofs/Kconfig:194:config EROFS_FS_PCPU_KTHREAD_HIPRI\nfs/erofs/Kconfig-195-\tbool \"EROFS high priority per-CPU kthread workers\"\n--\nfs/erofs/Kconfig-203-\nfs/erofs/Kconfig:204:config EROFS_FS_PAGE_CACHE_SHARE\nfs/erofs/Kconfig-205-\tbool \"EROFS page cache share support (experimental)\"\n"
}

59/2 2026/11/13 12:36 llm patch-evaluator
0m Model:
gemini-3.8-flash

Args:
null

Results:
null

Tokens:
							input: 65228
							output: 34
							thoughts: 25
						

Thoughts:
Here's a summary of my thought process, as requested:

**Checking the Fuse Passthrough Configuration**

Alright, let's get down to brass tacks. I need to figure out if this fuse passthrough option is enabled. My first instinct, given my experience, is to zero in on the Kconfig file for FUSE itself. That's usually where the core configuration options are defined. So, I'll navigate to `fs/fuse/Kconfig`. That's the most logical starting point for understanding how `CONFIG_FUSE_PASSTHROUGH` is handled and if it's even exposed. From there, I can determine its dependencies, default settings, and anything else pertinent to its behavior. Let's see what we can find.



60/2 2026/11/13 12:37 tool grepper
0m Args:
{
  "Expression": "config FUSE_PASSTHROUGH",
  "PathPrefixes": [
    "fs/fuse/"
  ]
}

Results:
{
  "Output": "fs/fuse/Kconfig=57=config FUSE_DAX\n--\nfs/fuse/Kconfig-60-\nfs/fuse/Kconfig:61:config FUSE_PASSTHROUGH\nfs/fuse/Kconfig-62-\tbool \"FUSE passthrough operations support\"\n"
}

61/2 2026/11/13 12:37 llm patch-evaluator
1m Model:
gemini-3.8-flash

Args:
null

Results:
null

Tokens:
							input: 65531
							output: 33
							thoughts: 20
						

Thoughts:
Okay, here's my take on those lines in `fs/fuse/Kconfig`:

**Analyzing Kconfig's FUSE Configuration Options**

Alright, let's dive into lines 61-75 of `fs/fuse/Kconfig`. I need to understand what's being configured here, specifically how the options relate to the overall FUSE subsystem. I'm assuming this section deals with some *specific* aspect or feature, perhaps related to security, performance, or a particular FUSE implementation detail. Given the range, it's probably not a high-level enabler but rather a more granular control. I'll need to pay close attention to the dependencies and default settings, as these often reveal the intended use case and potential implications. Are there any other Kconfig options that depend on these ones? Are there any obvious conflicts or implications I need to be aware of? I'll need to consider how these choices might interact with other kernel modules and configurations. Ultimately, I'm looking to understand the architectural significance of these options and their impact on a FUSE-based filesystem.



62/2 2026/11/13 12:38 tool read-file
0m Args:
{
  "File": "fs/fuse/Kconfig",
  "FirstLine": 60,
  "LineCount": 15
}

Results:
{
  "Contents": "  60:\t\n  61:\tconfig FUSE_PASSTHROUGH\n  62:\t\tbool \"FUSE passthrough operations support\"\n  63:\t\tdefault y\n  64:\t\tdepends on FUSE_FS\n  65:\t\tselect FS_STACK\n  66:\t\thelp\n  67:\t\t  This allows bypassing FUSE server by mapping specific FUSE operations\n  68:\t\t  to be performed directly on a backing file.\n  69:\t\n  70:\t\t  If you want to allow passthrough operations, answer Y.\n  71:\t\n  72:\tconfig FUSE_IO_URING\n  73:\t\tbool \"FUSE communication over io-uring\"\n  74:\t\tdefault y\n"
}

63/2 2026/11/13 12:38 llm patch-evaluator
0m Model:
gemini-3.8-flash

Args:
null

Results:
null

Tokens:
							input: 66002
							output: 36
							thoughts: 80
						

Thoughts:
Okay, here's my summary, tailored as requested:

**Navigating the Linux Kernel USB Filesystem Landscape**

Alright, let's see, I need to figure out the relevant configuration options for some USB functionality, specifically involving a fuse filesystem and a potential USB gadget configuration for mass storage. Immediately, my mind jumps to the likely candidates: I'm thinking I'll need to check the status of `CONFIG_FUSE_FS` and `CONFIG_FUSE_PASSTHROUGH` - those seem like the foundational pieces for any FUSE interaction, which is obviously important here. Since I'm working with USB, my next thought is to investigate the mass storage capabilities within the gadget subsystem. This leads me to quickly verify `CONFIG_USB_CONFIGFS_MASS_STORAGE`, and `CONFIG_USB_GADGET`, both of which seem quite pertinent in this context. And I know it's probably right in the `drivers/usb/gadget/` directory. My next logical step is to do a quick `grep` for `USB_CONFIGFS_MASS_STORAGE` inside that directory, which should quickly help me pinpoint relevant files and configuration snippets. I'm pretty sure I can get this sorted out fairly easily.



64/2 2026/11/13 12:39 tool grepper
0m Args:
{
  "Expression": "USB_CONFIGFS_MASS_STORAGE",
  "PathPrefixes": [
    "drivers/usb/gadget/"
  ]
}

Results:
{
  "Output": "drivers/usb/gadget/Kconfig=335=config USB_CONFIGFS_PHONET\n--\ndrivers/usb/gadget/Kconfig-344-\ndrivers/usb/gadget/Kconfig:345:config USB_CONFIGFS_MASS_STORAGE\ndrivers/usb/gadget/Kconfig-346-\tbool \"Mass storage\"\n"
}

65/2 2026/11/13 12:39 llm patch-evaluator
1m Model:
gemini-3.8-flash

Args:
null

Results:
null

Tokens:
							input: 66475
							output: 37
							thoughts: 25
						

Thoughts:
Okay, here's my interpretation of that thought process, tailored for an expert audience, and written in the first person:

**Navigating the USB Gadget Configuration Landscape**

Alright, I'm thinking I need to zero in on a specific area within the USB gadget configuration. Let's start with those lines, 344 through 355, within the `drivers/usb/gadget/Kconfig` file. I'm going to want to take a look at the config options contained there. Those lines likely contain the core settings I need. I'm probably looking for the finer points, some nuance. This could be a base level, or a starting point for further investigation. From there, I'll need to assess the interdependencies and understand how they relate to the broader gadget configuration strategy. Hopefully, these lines will provide enough context to begin the next steps. I'll need to understand what this configures, and how it interacts with the USB device controller.



66/2 2026/11/13 12:40 tool read-file
0m Args:
{
  "File": "drivers/usb/gadget/Kconfig",
  "FirstLine": 344,
  "LineCount": 15
}

Results:
{
  "Contents": " 344:\t\n 345:\tconfig USB_CONFIGFS_MASS_STORAGE\n 346:\t\tbool \"Mass storage\"\n 347:\t\tdepends on USB_CONFIGFS\n 348:\t\tdepends on BLOCK\n 349:\t\tselect USB_F_MASS_STORAGE\n 350:\t\thelp\n 351:\t\t  The Mass Storage Gadget acts as a USB Mass Storage disk drive.\n 352:\t\t  As its storage repository it can use a regular file or a block\n 353:\t\t  device (in much the same way as the \"loop\" device driver),\n 354:\t\t  specified as a module parameter or sysfs option.\n 355:\t\n 356:\tconfig USB_CONFIGFS_F_LB_SS\n 357:\t\tbool \"Loopback and sourcesink function (for testing)\"\n 358:\t\tdepends on USB_CONFIGFS\n"
}

67/2 2026/11/13 12:40 llm patch-evaluator
0m Model:
gemini-3.8-flash

Args:
null

Results:
null

Tokens:
							input: 66978
							output: 34
							thoughts: 52
						

Thoughts:
Here's my analysis of the dependencies:

**My Reasoning on USB Configuration Options**

Okay, so I'm looking at these USB configuration options and immediately see a dependency tree. `USB_CONFIGFS_MASS_STORAGE` hinges on `USB_CONFIGFS`. Makes sense. Then `USB_CONFIGFS` itself relies on `USB_GADGET`. Pretty standard gadget driver setup.

Now, the interesting bit is `CONFIG_USB_GADGETFS`. I need to figure out how this plays into the mix. Is this an alternative, a complementary module, or a potential conflict? Time to dive a bit deeper into `CONFIG_USB_GADGETFS` and its exact functionality in relation to the others. Need to understand how these modules interact.



68/2 2026/11/13 12:41 tool grepper
0m Args:
{
  "Expression": "config USB_GADGETFS",
  "PathPrefixes": [
    "drivers/usb/gadget/"
  ]
}

Results:
{
  "Output": "drivers/usb/gadget/legacy/Kconfig=190=config USB_G_NCM\n--\ndrivers/usb/gadget/legacy/Kconfig-205-\ndrivers/usb/gadget/legacy/Kconfig:206:config USB_GADGETFS\ndrivers/usb/gadget/legacy/Kconfig-207-\ttristate \"Gadget Filesystem\"\n"
}

69/2 2026/11/13 12:41 llm patch-evaluator
1m Model:
gemini-3.8-flash

Args:
null

Results:
null

Tokens:
							input: 67327
							output: 37
							thoughts: 10
						

Thoughts:
Okay, here's my take on those thoughts, tailored for an expert audience, and delivered as a first-person summary:

**Digging into `USB_FUNCTIONFS`**

Right, let's dive straight in. I need to get my head around this `USB_FUNCTIONFS` thing. It's a key piece, and I want a solid understanding of how it integrates into the whole picture. I'm going to quickly refresh myself on the core concepts, maybe re-examine the relevant documentation or spec sheets. I'll probably be thinking about its potential limitations and corner cases that might surface in real-world implementations, such as how it handles concurrent requests, error handling, and resource allocation. I'm especially keen to see how it can be optimized for performance. I’ll keep a lookout for any novel implementations or potential advancements.



70/2 2026/11/13 12:42 tool grepper
0m Args:
{
  "Expression": "config USB_CONFIGFS_F_FS",
  "PathPrefixes": [
    "drivers/usb/gadget/"
  ]
}

Results:
{
  "Output": "drivers/usb/gadget/Kconfig=356=config USB_CONFIGFS_F_LB_SS\n--\ndrivers/usb/gadget/Kconfig-368-\ndrivers/usb/gadget/Kconfig:369:config USB_CONFIGFS_F_FS\ndrivers/usb/gadget/Kconfig-370-\tbool \"Function filesystem (FunctionFS)\"\n"
}

71/2 2026/11/13 12:42 llm patch-evaluator
0m Model:
gemini-3.8-flash

Args:
null

Results:
null

Tokens:
							input: 67654
							output: 36
							thoughts: 17
						

Thoughts:
Okay, here's my take on those thoughts, tailored for an expert audience, and delivered as a first-person summary:

**Checking `CONFIG_ANDROID_BINDER_IPC_RUST`**

Alright, let's dive into this `CONFIG_ANDROID_BINDER_IPC_RUST` situation. My first thought is to assess its current state and implications. I need to quickly determine whether this is enabled, disabled, or conditionally compiled. Knowing the configuration value is the starting point.

Assuming it's enabled, I'll then immediately start considering the potential impact on Binder IPC within the Android ecosystem. Is this a new implementation? A replacement? Is it a staged rollout? I'll want to understand the rationale behind introducing Rust into this critical piece of infrastructure, specifically focusing on the performance and security trade-offs compared to the existing C/C++ implementations.

If it's disabled, the next step is to understand the context. Is this a feature being considered? Has there been experimentation? Are there known blockers – performance bottlenecks, existing library incompatibilities, or security concerns? I'll also be thinking about the implications for future development efforts and potential maintenance costs.

My immediate focus will be to link this config flag back to relevant source code. I need to quickly identify any corresponding files, modules, or build processes that are affected by this. Are there any known dependencies on existing Binder frameworks? Are there potential conflicts with any other components in the system? I'll be looking for documentation, commit messages, and any relevant mailing list discussions. The goal is to get a solid grasp of where this particular option fits into the bigger picture. Then, a quick code review and possible build will be on the table to get a better handle on the situation.



72/2 2026/11/13 12:42 tool grepper
0m Args:
{
  "Expression": "config ANDROID_BINDER_IPC_RUST",
  "PathPrefixes": [
    "drivers/android/"
  ]
}

Results:
{
  "Output": "drivers/android/Kconfig=2=menu \"Android\"\ndrivers/android/Kconfig-3-\ndrivers/android/Kconfig:4:config ANDROID_BINDER_IPC_RUST\ndrivers/android/Kconfig-5-\tbool \"Android Binder IPC Driver\"\n"
}

73/2 2026/11/13 12:42 llm patch-evaluator
0m Model:
gemini-3.8-flash

Args:
null

Results:
null

Tokens:
							input: 68147
							output: 32
							thoughts: 19
						

Thoughts:
Okay, let's dive into this. Here's my take on those lines:

**Analyzing `drivers/android/Kconfig` (Lines 4-15)**

Alright, so the task at hand is to pinpoint what's happening within lines 4 through 15 of the `drivers/android/Kconfig` file. I'm guessing this section is likely defining some configuration options or dependencies related to Android driver support, or possibly even the base of the Android kernel build itself. Based on the file name, it's probably important for building a Linux kernel for Android devices. I should look for definitions of Kconfig symbols. Keywords I'm watching for include `config`, `bool`, `tristate`, `select`, `depends on`, or any of the typical Kconfig syntax elements that define a configuration option. I'll expect to understand what's being defined, any constraints, and how this relates to other components within the kernel configuration. I need to understand if this is a top-level feature or a dependency for some other area. Let's see what's what!



74/2 2026/11/13 12:43 tool read-file
0m Args:
{
  "File": "drivers/android/Kconfig",
  "FirstLine": 4,
  "LineCount": 15
}

Results:
{
  "Contents": "   4:\tconfig ANDROID_BINDER_IPC_RUST\n   5:\t\tbool \"Android Binder IPC Driver\"\n   6:\t\tdepends on MMU\n   7:\t\tdepends on NET\n   8:\t\tdepends on RUST\n   9:\t\tdefault n\n  10:\t\thelp\n  11:\t\t  Binder is used in Android for both communication between processes,\n  12:\t\t  and remote method invocation.\n  13:\t\n  14:\t\t  This means one Android process can call a method/routine in another\n  15:\t\t  Android process, using Binder to identify, invoke and pass arguments\n  16:\t\t  between said processes.\n  17:\t\n  18:\tconfig ANDROID_BINDER_DEVICES\n"
}

75/2 2026/11/13 12:43 llm patch-evaluator
0m Model:
gemini-3.8-flash

Args:
null

Results:
null

Tokens:
							input: 68617
							output: 353
							thoughts: 1892
						

Thoughts:
**Focusing Fuzzing Efforts: Pseudo Filesystem Security**

Okay, so I've been dissecting this patch, and here's my thinking. We're dealing with a change that aims to prevent specific subsystems from using backing files located on pseudo filesystems. My focus is on identifying the most relevant kernel functions to target for fuzzing, given that we want to zero in on the added security checks.

First, I identified the key configurations we need to build with: `BLK_DEV_LOOP`, `BLK_DEV_ZONED_LOOP`, `EROFS_FS`, `EROFS_FS_BACKED_BY_FILE`, `FUSE_FS`, `FUSE_PASSTHROUGH`, `NVME_TARGET`, `TARGET_CORE`, `TCM_FILEIO`, `USB_GADGET`, `USB_CONFIGFS`, and `USB_CONFIGFS_MASS_STORAGE`. Actually, hold on, since `BLK_DEV_ZONED_LOOP` depends on `BLK_DEV_ZONED`, so we also need to enable `BLK_DEV_ZONED`. And since `TARGET_CORE`, `NVME_TARGET`, and `USB_CONFIGFS` select `CONFIGFS_FS`, let's add `CONFIGFS_FS` as well.

Now, let's nail down the critical functions. I reviewed where the `file_is_pseudo` check was added, and after some digging, I've got a comprehensive list. I'm focusing on the non-ubiquitous entry points and feature logic:

*   `loop_check_backing_file` (called by `loop_configure`) - and `loop_configure`.
*   `zloop_init_zone`
*   `nvmet_file_ns_enable`
*   `fd_configure_device`
*   `fsg_lun_open`
*   `fuse_backing_open_file` (called by `fuse_backing_open` and `fuse_backing_open_64`)
*   `fuse_backing_open`
*   `erofs_file_get_tree` and `erofs_init_device`

These functions are all specific to the subsystems that are affected by the patch: loop, zloop, nvmet, target/fileio, USB mass storage, FUSE passthrough, and EROFS. These are the ones where we're preventing the use of user-provided backing files on pseudo filesystems. I've double-checked that none of them are overly generic or ubiquitous. They're all highly relevant, directly exercising the changes introduced by the patch.

Essentially, by targeting these functions, we're ensuring that our fuzzing efforts are concentrated on the newly added checks, giving us a strong shot at identifying potential vulnerabilities related to this new security measure. I'm confident in this list. Now, let's call `set-results`.



76/2 2026/11/13 12:43 tool set-results
0m Args:
{
  "EnableConfigs": [
    "BLK_DEV_LOOP",
    "BLK_DEV_ZONED",
    "BLK_DEV_ZONED_LOOP",
    "NVME_TARGET",
    "TARGET_CORE",
    "TCM_FILEIO",
    "FUSE_FS",
    "FUSE_PASSTHROUGH",
    "EROFS_FS",
    "EROFS_FS_BACKED_BY_FILE",
    "USB_GADGET",
    "USB_CONFIGFS",
    "USB_CONFIGFS_MASS_STORAGE"
  ],
  "FocusSymbols": [
    "loop_check_backing_file",
    "loop_configure",
    "zloop_init_zone",
    "nvmet_file_ns_enable",
    "fd_configure_device",
    "fsg_lun_open",
    "fuse_backing_open_file",
    "fuse_backing_open",
    "erofs_file_get_tree",
    "erofs_init_device"
  ],
  "Reasoning": "The patch introduces SB_I_PSEUDO to designate regular files on pseudo-filesystems as kernel interfaces that must not be used as storage backends, and integrates file_is_pseudo() validation into loop devices, zoned loop devices, NVMe target fileio, LIO target FILEIO, USB mass storage gadget, FUSE passthrough backing files, and file-backed EROFS. These are reachable, user-accessible storage and filesystem interfaces in amd64 virtualized environments, making them suitable targets for fuzzing to uncover edge cases and regressions in backing file validation.",
  "WorthFuzzing": true
}

Results:
{
  "EnableConfigs": [
    "BLK_DEV_LOOP",
    "BLK_DEV_ZONED",
    "BLK_DEV_ZONED_LOOP",
    "NVME_TARGET",
    "TARGET_CORE",
    "TCM_FILEIO",
    "FUSE_FS",
    "FUSE_PASSTHROUGH",
    "EROFS_FS",
    "EROFS_FS_BACKED_BY_FILE",
    "USB_GADGET",
    "USB_CONFIGFS",
    "USB_CONFIGFS_MASS_STORAGE"
  ],
  "FocusSymbols": [
    "loop_check_backing_file",
    "loop_configure",
    "zloop_init_zone",
    "nvmet_file_ns_enable",
    "fd_configure_device",
    "fsg_lun_open",
    "fuse_backing_open_file",
    "fuse_backing_open",
    "erofs_file_get_tree",
    "erofs_init_device"
  ],
  "Reasoning": "The patch introduces SB_I_PSEUDO to designate regular files on pseudo-filesystems as kernel interfaces that must not be used as storage backends, and integrates file_is_pseudo() validation into loop devices, zoned loop devices, NVMe target fileio, LIO target FILEIO, USB mass storage gadget, FUSE passthrough backing files, and file-backed EROFS. These are reachable, user-accessible storage and filesystem interfaces in amd64 virtualized environments, making them suitable targets for fuzzing to uncover edge cases and regressions in backing file validation.",
  "WorthFuzzing": true
}

77/1 2026/11/13 12:43 action If
4m Args:
{
  "WorthFuzzing": true
}

Results:
null

78/2 2026/11/13 12:43 agent kmsan-evaluator
4m Model:
core

Args:
null

Results:
{
  "KMSANReasoning": "The patch series introduces a new superblock internal flag `SB_I_PSEUDO` and helper functions `fc_init_pseudo()` and `file_is_pseudo()`. It marks pseudo filesystems with this flag during `init_fs_context` and adds checks across various storage subsystems (loop, zloop, nvmet, target_core_file, usb mass storage gadget, erofs, fuse backing) to disallow regular files on pseudo filesystems from being used as backing storage.\n\nContrasting KASAN vs KMSAN applicability:\n- KMSAN is designed to catch reads of uninitialized memory and information leaks to user space. In this patch series, no new uninitialized memory allocations or buffer copies to user space are introduced. The `fs_context` structures where `fc_init_pseudo()` sets flags are allocated zeroed via `kzalloc_obj()`. The check `file_is_pseudo()` only inspects existing, fully initialized fields (`inode-\u003ei_mode` and `sb-\u003es_iflags`).\n- KASAN and standard kernel debuggers (e.g., LOCKDEP, assertions) are relevant for any potential regressions or errors in file operations and storage backing teardowns, though the patch mainly adds early `-EINVAL`/`-EBADF` rejections on invalid backing file setups.\n\nSince there is no exposure or risk of uninitialized memory usage, a dedicated KMSAN fuzzing session is not warranted.",
  "NeedsKMSAN": false
}

Instruction:
You are an expert Linux kernel security engineer specializing in kernel memory
error detectors (KASAN and KMSAN). Your job is to review the provided patch series and
determine if the code changes justify spawning a dedicated KMSAN (KernelMemorySanitizer)
fuzzing session in addition to standard KASAN fuzzing.

CRITICAL DISTINCTION BETWEEN KASAN AND KMSAN:
- Standard KASAN kernel builds (upstream-apparmor-kasan.config) already enable
  a comprehensive suite of debugging tools and sanitizers, including KASAN
  (out-of-bounds accesses, use-after-free, double free, invalid free), LOCKDEP
  (locking bugs and deadlocks), UB-sanitizers, and memory corruption checks.
- KMSAN (KernelMemorySanitizer) detects reads of UNINITIALIZED memory (stack, heap,
  or page allocations) and kernel-to-user memory info-leaks.

Rule: THERE IS NO SENSE IN RUNNING A KMSAN SESSION IF A BUG CAN BE CAUGHT BY KASAN,
LOCKDEP, OR OTHER STANDARD BUG DETECTORS.
A dedicated KMSAN fuzzing session incurs significant resource costs. You must ONLY
set NeedsKMSAN=true if the code changes introduce or expose UNINITIALIZED MEMORY risks
that are detected ONLY by KMSAN.

Look holistically at the patch series and surrounding code. Even if no direct
uninitialized field accesses or new buffer allocations are added in the diff itself,
a patch may alter control flow, bounds checking, or data length calculations in ways
that change how the rest of the code operates on existing buffers (e.g. allowing
uninitialized stack/heap memory to be read, copied to user space, or used in control
flow). Do not hesitate to use your code access tools to inspect the surrounding code,
called functions, and callers.

Set NeedsKMSAN=true ONLY IF the patch introduces or modifies:
1. Kernel structures sent to user space (via copy_to_user, put_user, netlink skb
   attributes, ioctl output arguments, socket options, or BPF buffers) where fields
   or structure padding might not be fully initialized/zeroed.
2. Conditional logic or branching that depends on potentially uninitialized variables
   or struct fields.
3. Allocation or initialization of complex data structures where uninitialized fields
   could be read later in reachable code paths.
4. Bounds checks, lengths, or logic in a way that allows surrounding code to access
   uninitialized bytes of existing buffers.

Set NeedsKMSAN=false IF:
- The code changes primarily risk out-of-bounds access, array overflows, NULL pointer
  dereferences, locking deadlocks, or use-after-free bugs (these are already caught
  by KASAN, LOCKDEP, or standard bug detectors).
- All stack/heap structures touched or introduced by the patch are fully zeroed
  or initialized (e.g. using = {0}, memset, kzalloc) before being read or copied.
- The patch does not introduce any risk of uninitialized memory usage or info-leaks.

Use your code access tools to inspect the surrounding code if necessary, then provide
detailed KMSANReasoning contrasting KASAN vs KMSAN applicability for this patch.
Prefer calling several tools at the same time to save round-trips.


Use set-results tool to provide results of the analysis.
It must be called exactly once before the final reply.
Ignore results of this tool.

Prompt:
Target architecture: amd64

For your convenience, here is the diff of the changes:
commit da40508d66ebfc12e02da88b0a4c015923f8f10a
Author: syz-cluster <triage@syzkaller.com>
Date:   Fri Nov 13 12:16:12 2026 +0000

    syz-cluster: applied patch under review

diff --git a/arch/powerpc/platforms/cell/spufs/inode.c b/arch/powerpc/platforms/cell/spufs/inode.c
index f066d9c7344d37..54b45932aecd22 100644
--- a/arch/powerpc/platforms/cell/spufs/inode.c
+++ b/arch/powerpc/platforms/cell/spufs/inode.c
@@ -11,6 +11,7 @@
 #include <linux/file.h>
 #include <linux/fs.h>
 #include <linux/fs_context.h>
+#include <linux/pseudo_fs.h>
 #include <linux/fs_parser.h>
 #include <linux/fsnotify.h>
 #include <linux/backing-dev.h>
@@ -741,6 +742,7 @@ static int spufs_init_fs_context(struct fs_context *fc)
 
 	fc->fs_private = ctx;
 	fc->s_fs_info = sbi;
+	fc_init_pseudo(fc);
 	fc->ops = &spufs_context_ops;
 	return 0;
 
diff --git a/arch/s390/hypfs/inode.c b/arch/s390/hypfs/inode.c
index 559b011e68800f..8662169de477ab 100644
--- a/arch/s390/hypfs/inode.c
+++ b/arch/s390/hypfs/inode.c
@@ -12,6 +12,7 @@
 #include <linux/errno.h>
 #include <linux/fs.h>
 #include <linux/fs_context.h>
+#include <linux/pseudo_fs.h>
 #include <linux/fs_parser.h>
 #include <linux/namei.h>
 #include <linux/vfs.h>
@@ -301,6 +302,7 @@ static int hypfs_init_fs_context(struct fs_context *fc)
 	sbi->gid = current_gid();
 
 	fc->s_fs_info = sbi;
+	fc_init_pseudo(fc);
 	fc->ops = &hypfs_context_ops;
 	return 0;
 }
diff --git a/drivers/android/binder/rust_binderfs.c b/drivers/android/binder/rust_binderfs.c
index 5f020226720dba..04468c5b5c116c 100644
--- a/drivers/android/binder/rust_binderfs.c
+++ b/drivers/android/binder/rust_binderfs.c
@@ -3,6 +3,7 @@
 #include <linux/compiler_types.h>
 #include <linux/errno.h>
 #include <linux/fs.h>
+#include <linux/pseudo_fs.h>
 #include <linux/fsnotify.h>
 #include <linux/gfp.h>
 #include <linux/idr.h>
@@ -667,7 +668,6 @@ static int binderfs_fill_super(struct super_block *sb, struct fs_context *fc)
 	 * necessary and safe.
 	 */
 	sb->s_iflags &= ~SB_I_NODEV;
-	sb->s_iflags |= SB_I_NOEXEC;
 	sb->s_magic = RUST_BINDERFS_SUPER_MAGIC;
 	sb->s_op = &binderfs_super_ops;
 	sb->s_time_gran = 1;
@@ -759,6 +759,7 @@ static int binderfs_init_fs_context(struct fs_context *fc)
 	ctx->stats_mode = binderfs_stats_mode_unset;
 
 	fc->fs_private = ctx;
+	fc_init_pseudo(fc);
 	fc->ops = &binderfs_fs_context_ops;
 
 	return 0;
diff --git a/drivers/block/loop.c b/drivers/block/loop.c
index a3325ceab484a4..1482580a19795a 100644
--- a/drivers/block/loop.c
+++ b/drivers/block/loop.c
@@ -528,12 +528,18 @@ static void loop_assign_backing_file(struct loop_device *lo, struct file *file)
 
 static int loop_check_backing_file(struct file *file)
 {
+	if (!(file->f_mode & FMODE_READ))
+		return -EBADF;
+
 	if (!file->f_op->read_iter)
 		return -EINVAL;
 
 	if ((file->f_mode & FMODE_WRITE) && !file->f_op->write_iter)
 		return -EINVAL;
 
+	if (file_is_pseudo(file))
+		return -EINVAL;
+
 	return 0;
 }
 
diff --git a/drivers/block/zloop.c b/drivers/block/zloop.c
index 65634a39b0bfcb..dcc06dd47b040e 100644
--- a/drivers/block/zloop.c
+++ b/drivers/block/zloop.c
@@ -1137,6 +1137,11 @@ static int zloop_init_zone(struct zloop_device *zlo, struct zloop_options *opts,
 		goto out_fput;
 	}
 
+	if (file_is_pseudo(zone->file)) {
+		ret = -EINVAL;
+		goto out_fput;
+	}
+
 	if (zlo->block_size) {
 		ret = zloop_get_block_size(zlo, zone);
 		if (ret)
diff --git a/drivers/nvme/target/io-cmd-file.c b/drivers/nvme/target/io-cmd-file.c
index 695963dd932ee7..71c69bac539436 100644
--- a/drivers/nvme/target/io-cmd-file.c
+++ b/drivers/nvme/target/io-cmd-file.c
@@ -47,6 +47,16 @@ int nvmet_file_ns_enable(struct nvmet_ns *ns)
 		return ret;
 	}
 
+	if (!ns->file->f_op->read_iter || !ns->file->f_op->write_iter) {
+		ret = -EINVAL;
+		goto err;
+	}
+
+	if (file_is_pseudo(ns->file)) {
+		ret = -EINVAL;
+		goto err;
+	}
+
 	nvmet_file_ns_revalidate(ns);
 
 	/*
diff --git a/drivers/target/target_core_file.c b/drivers/target/target_core_file.c
index ab9824a4852f1e..7a3cf63dc979b5 100644
--- a/drivers/target/target_core_file.c
+++ b/drivers/target/target_core_file.c
@@ -144,6 +144,21 @@ static int fd_configure_device(struct se_device *dev)
 		goto fail;
 	}
 	fd_dev->fd_file = file;
+
+	if (!file->f_op->read_iter || !file->f_op->write_iter) {
+		pr_err("FILEIO: %s lacks ->read_iter or ->write_iter\n",
+		       fd_dev->fd_dev_name);
+		ret = -EINVAL;
+		goto fail;
+	}
+
+	if (file_is_pseudo(file)) {
+		pr_err("FILEIO: %s is on a pseudo filesystem\n",
+		       fd_dev->fd_dev_name);
+		ret = -EINVAL;
+		goto fail;
+	}
+
 	/*
 	 * If using a block backend with this struct file, we extract
 	 * fd_dev->fd_[block,dev]_size from struct block_device.
diff --git a/drivers/usb/gadget/function/f_fs.c b/drivers/usb/gadget/function/f_fs.c
index c64a268e98a433..a6b3788399a560 100644
--- a/drivers/usb/gadget/function/f_fs.c
+++ b/drivers/usb/gadget/function/f_fs.c
@@ -15,6 +15,7 @@
 /* #define VERBOSE_DEBUG */
 
 #include <linux/blkdev.h>
+#include <linux/pseudo_fs.h>
 #include <linux/dma-buf.h>
 #include <linux/dma-fence.h>
 #include <linux/dma-resv.h>
@@ -2166,6 +2167,7 @@ static int ffs_fs_init_fs_context(struct fs_context *fc)
 	ctx->no_disconnect = false;
 
 	fc->fs_private = ctx;
+	fc_init_pseudo(fc);
 	fc->ops = &ffs_fs_context_ops;
 	return 0;
 }
diff --git a/drivers/usb/gadget/function/storage_common.c b/drivers/usb/gadget/function/storage_common.c
index 75831f2c7abeb0..83683ade20c240 100644
--- a/drivers/usb/gadget/function/storage_common.c
+++ b/drivers/usb/gadget/function/storage_common.c
@@ -211,6 +211,11 @@ int fsg_lun_open(struct fsg_lun *curlun, const char *filename)
 		goto out;
 	}
 
+	if (file_is_pseudo(filp)) {
+		LINFO(curlun, "file on a pseudo filesystem: %s\n", filename);
+		goto out;
+	}
+
 	/*
 	 * If we can't read the file, it's no good.
 	 * If we can't write the file, use it read-only.
diff --git a/drivers/usb/gadget/legacy/inode.c b/drivers/usb/gadget/legacy/inode.c
index 7f6d8460152f90..8490e5d0351e1a 100644
--- a/drivers/usb/gadget/legacy/inode.c
+++ b/drivers/usb/gadget/legacy/inode.c
@@ -13,6 +13,7 @@
 #include <linux/module.h>
 #include <linux/fs.h>
 #include <linux/fs_context.h>
+#include <linux/pseudo_fs.h>
 #include <linux/pagemap.h>
 #include <linux/uts.h>
 #include <linux/wait.h>
@@ -2223,6 +2224,7 @@ static const struct fs_context_operations gadgetfs_context_ops = {
 
 static int gadgetfs_init_fs_context(struct fs_context *fc)
 {
+	fc_init_pseudo(fc);
 	fc->ops = &gadgetfs_context_ops;
 	return 0;
 }
diff --git a/drivers/xen/xenfs/super.c b/drivers/xen/xenfs/super.c
index 37ea7c5c034695..aba7d038ed735f 100644
--- a/drivers/xen/xenfs/super.c
+++ b/drivers/xen/xenfs/super.c
@@ -15,6 +15,7 @@
 #include <linux/module.h>
 #include <linux/fs.h>
 #include <linux/fs_context.h>
+#include <linux/pseudo_fs.h>
 #include <linux/magic.h>
 
 #include <xen/xen.h>
@@ -80,6 +81,7 @@ static const struct fs_context_operations xenfs_context_ops = {
 
 static int xenfs_init_fs_context(struct fs_context *fc)
 {
+	fc_init_pseudo(fc);
 	fc->ops = &xenfs_context_ops;
 	return 0;
 }
diff --git a/fs/binfmt_misc.c b/fs/binfmt_misc.c
index d945b4f6e15813..7dc233becd98db 100644
--- a/fs/binfmt_misc.c
+++ b/fs/binfmt_misc.c
@@ -22,6 +22,7 @@
 #include <linux/file.h>
 #include <linux/fs.h>
 #include <linux/fs_context.h>
+#include <linux/pseudo_fs.h>
 #include <linux/init.h>
 #include <linux/kstrtox.h>
 #include <linux/limits.h>
@@ -1575,8 +1576,7 @@ static int bm_fill_super(struct super_block *sb, struct fs_context *fc)
 	if (user_ns != current_user_ns())
 		return -EINVAL;
 
-	/* Never exec off this instance and never let anything stack on it. */
-	sb->s_iflags |= SB_I_NOEXEC | SB_I_NODEV;
+	/* Never let anything stack on this instance. */
 	sb->s_stack_depth = FILESYSTEM_MAX_STACK_DEPTH;
 
 	/*
@@ -1660,6 +1660,7 @@ static void bm_kill_sb(struct super_block *sb)
 
 static int bm_init_fs_context(struct fs_context *fc)
 {
+	fc_init_pseudo(fc);
 	fc->ops = &bm_context_ops;
 	return 0;
 }
diff --git a/fs/configfs/mount.c b/fs/configfs/mount.c
index d8cac1cbf3bd57..60ba24e7ae2b96 100644
--- a/fs/configfs/mount.c
+++ b/fs/configfs/mount.c
@@ -13,6 +13,7 @@
 #include <linux/module.h>
 #include <linux/mount.h>
 #include <linux/fs_context.h>
+#include <linux/pseudo_fs.h>
 #include <linux/pagemap.h>
 #include <linux/init.h>
 #include <linux/slab.h>
@@ -106,6 +107,7 @@ static const struct fs_context_operations configfs_context_ops = {
 
 static int configfs_init_fs_context(struct fs_context *fc)
 {
+	fc_init_pseudo(fc);
 	fc->ops = &configfs_context_ops;
 	return 0;
 }
diff --git a/fs/debugfs/inode.c b/fs/debugfs/inode.c
index b4915551ad315a..f163f0bc5703a3 100644
--- a/fs/debugfs/inode.c
+++ b/fs/debugfs/inode.c
@@ -15,6 +15,7 @@
 #include <linux/module.h>
 #include <linux/fs.h>
 #include <linux/fs_context.h>
+#include <linux/pseudo_fs.h>
 #include <linux/fs_parser.h>
 #include <linux/pagemap.h>
 #include <linux/init.h>
@@ -317,6 +318,7 @@ static int debugfs_init_fs_context(struct fs_context *fc)
 	fsi->mode = DEBUGFS_DEFAULT_MODE;
 
 	fc->s_fs_info = fsi;
+	fc_init_pseudo(fc);
 	fc->ops = &debugfs_context_ops;
 	return 0;
 }
diff --git a/fs/devpts/inode.c b/fs/devpts/inode.c
index bd1e8eb26edb70..47ef12241d92d7 100644
--- a/fs/devpts/inode.c
+++ b/fs/devpts/inode.c
@@ -13,6 +13,7 @@
 #include <linux/init.h>
 #include <linux/fs.h>
 #include <linux/fs_context.h>
+#include <linux/pseudo_fs.h>
 #include <linux/fs_parser.h>
 #include <linux/sched.h>
 #include <linux/namei.h>
@@ -438,6 +439,7 @@ static int devpts_init_fs_context(struct fs_context *fc)
 		fsi->mount_opts.reserve = true;
 
 	fc->s_fs_info = fsi;
+	fc_init_pseudo(fc);
 	fc->ops = &devpts_context_ops;
 	return 0;
 }
diff --git a/fs/efivarfs/super.c b/fs/efivarfs/super.c
index 12746ced6dc639..e598d42c5f42c4 100644
--- a/fs/efivarfs/super.c
+++ b/fs/efivarfs/super.c
@@ -8,6 +8,7 @@
 #include <linux/efi.h>
 #include <linux/fs.h>
 #include <linux/fs_context.h>
+#include <linux/pseudo_fs.h>
 #include <linux/fs_parser.h>
 #include <linux/module.h>
 #include <linux/pagemap.h>
@@ -554,6 +555,7 @@ static int efivarfs_init_fs_context(struct fs_context *fc)
 	}
 
 	fc->s_fs_info = sfi;
+	fc_init_pseudo(fc);
 	fc->ops = &efivarfs_context_ops;
 
 	return 0;
diff --git a/fs/erofs/super.c b/fs/erofs/super.c
index ce05557bd99836..980d5fc2b57619 100644
--- a/fs/erofs/super.c
+++ b/fs/erofs/super.c
@@ -158,7 +158,8 @@ static int erofs_init_device(struct erofs_buf *buf, struct super_block *sb,
 		if (!erofs_is_fileio_mode(sbi)) {
 			dif->dax_dev = fs_dax_get_by_bdev(file_bdev(file),
 					&dif->dax_part_off, NULL, NULL);
-		} else if (!S_ISREG(file_inode(file)->i_mode)) {
+		} else if (!S_ISREG(file_inode(file)->i_mode) ||
+			   file_is_pseudo(file)) {
 			fput(file);
 			return -EINVAL;
 		}
@@ -835,6 +836,9 @@ static int erofs_file_get_tree(struct fs_context *fc)
 {
 	struct erofs_sb_info *sbi = fc->s_fs_info;
 
+	if (file_is_pseudo(sbi->dif0.file))
+		return invalfc(fc, "source is on a pseudo filesystem");
+
 	if (!test_opt(&sbi->opt, SUPERBLOCK_SHARE))
 		return get_tree_nodev(fc, erofs_fc_fill_super);
 
diff --git a/fs/failfs.c b/fs/failfs.c
index 437cdc981c2ded..f03334f361c0ed 100644
--- a/fs/failfs.c
+++ b/fs/failfs.c
@@ -3,6 +3,7 @@
 #include <linux/fs.h>
 #include <linux/fs/super_types.h>
 #include <linux/fs_context.h>
+#include <linux/pseudo_fs.h>
 #include <linux/fs_struct.h>
 #include <linux/magic.h>
 #include <linux/mount.h>
@@ -132,7 +133,7 @@ static int failfs_init_fs_context(struct fs_context *fc)
 	fc->ops		= &failfs_context_ops;
 	fc->global	= true;
 	fc->sb_flags	|= SB_NOUSER;
-	fc->s_iflags	|= SB_I_NOEXEC | SB_I_NODEV;
+	fc_init_pseudo(fc);
 	return 0;
 }
 
diff --git a/fs/fuse/backing.c b/fs/fuse/backing.c
index 8c21a8a74efb9c..4e4fb810ddaa88 100644
--- a/fs/fuse/backing.c
+++ b/fs/fuse/backing.c
@@ -147,6 +147,9 @@ static int fuse_backing_open_file(struct fuse_conn *fc, struct fuse_backing *fb,
 		if (inode->i_sb->s_stack_depth >= fc->max_stack_depth)
 			return -ELOOP;
 
+		if (file_is_pseudo(file))
+			return -EINVAL;
+
 		fb->type = FUSE_BACKING_PATH;
 		fb->path = file->f_path;
 		path_get(&fb->path);
diff --git a/fs/fuse/control.c b/fs/fuse/control.c
index 21ffde596d6116..4497362e7df069 100644
--- a/fs/fuse/control.c
+++ b/fs/fuse/control.c
@@ -10,6 +10,7 @@
 #include <linux/init.h>
 #include <linux/module.h>
 #include <linux/fs_context.h>
+#include <linux/pseudo_fs.h>
 #include <linux/namei.h>
 
 #define FUSE_CTL_SUPER_MAGIC 0x65735543
@@ -334,6 +335,7 @@ static const struct fs_context_operations fuse_ctl_context_ops = {
 
 static int fuse_ctl_init_fs_context(struct fs_context *fsc)
 {
+	fc_init_pseudo(fsc);
 	fsc->ops = &fuse_ctl_context_ops;
 	return 0;
 }
diff --git a/fs/kernfs/mount.c b/fs/kernfs/mount.c
index a0be784bfb0646..6b60d212b003d6 100644
--- a/fs/kernfs/mount.c
+++ b/fs/kernfs/mount.c
@@ -8,6 +8,7 @@
  */
 
 #include <linux/fs.h>
+#include <linux/pseudo_fs.h>
 #include <linux/mount.h>
 #include <linux/init.h>
 #include <linux/magic.h>
@@ -298,8 +299,6 @@ static int kernfs_fill_super(struct super_block *sb, struct kernfs_fs_context *k
 	struct dentry *root;
 
 	info->sb = sb;
-	/* Userspace would break if executables or devices appear on sysfs */
-	sb->s_iflags |= SB_I_NOEXEC | SB_I_NODEV;
 	sb->s_blocksize = PAGE_SIZE;
 	sb->s_blocksize_bits = PAGE_SHIFT;
 	sb->s_magic = kfc->magic;
@@ -388,6 +387,7 @@ int kernfs_get_tree(struct fs_context *fc)
 	info->ns = kfc->ns_tag;
 	INIT_LIST_HEAD(&info->node);
 
+	fc_init_pseudo(fc);
 	fc->s_fs_info = info;
 	sb = sget_fc(fc, kernfs_test_super, kernfs_set_super);
 	if (IS_ERR(sb))
diff --git a/fs/libfs.c b/fs/libfs.c
index 96a6e9b1535fb7..8c8789489fdf96 100644
--- a/fs/libfs.c
+++ b/fs/libfs.c
@@ -735,7 +735,7 @@ struct pseudo_fs_context *init_pseudo(struct fs_context *fc,
 		fc->fs_private = ctx;
 		fc->ops = &pseudo_fs_context_ops;
 		fc->sb_flags |= SB_NOUSER;
-		fc->s_iflags |= SB_I_NOEXEC | SB_I_NODEV;
+		fc_init_pseudo(fc);
 		fc->global = true;
 	}
 	return ctx;
diff --git a/fs/nfsd/nfsctl.c b/fs/nfsd/nfsctl.c
index f32311f2d7cf96..ce2666deddbd94 100644
--- a/fs/nfsd/nfsctl.c
+++ b/fs/nfsd/nfsctl.c
@@ -9,6 +9,7 @@
 #include <linux/namei.h>
 #include <linux/ctype.h>
 #include <linux/fs_context.h>
+#include <linux/pseudo_fs.h>
 
 #include <linux/sunrpc/cache.h>
 #include <linux/sunrpc/svcsock.h>
@@ -1375,6 +1376,7 @@ static int nfsd_init_fs_context(struct fs_context *fc)
 {
 	put_user_ns(fc->user_ns);
 	fc->user_ns = get_user_ns(fc->net_ns->user_ns);
+	fc_init_pseudo(fc);
 	fc->ops = &nfsd_fs_context_ops;
 	return 0;
 }
diff --git a/fs/nullfs.c b/fs/nullfs.c
index 319c2f5c5a6714..2fe24cb97160ec 100644
--- a/fs/nullfs.c
+++ b/fs/nullfs.c
@@ -2,6 +2,7 @@
 /* Copyright (c) 2026 Christian Brauner <brauner@kernel.org> */
 #include <linux/fs/super_types.h>
 #include <linux/fs_context.h>
+#include <linux/pseudo_fs.h>
 #include <linux/magic.h>
 #include <linux/splice.h>
 #include <linux/uio.h>
@@ -174,7 +175,7 @@ static int nullfs_init_fs_context(struct fs_context *fc)
 {
 	fc->ops		= &nullfs_fs_context_ops;
 	fc->sb_flags	|= SB_NOUSER;
-	fc->s_iflags	|= SB_I_NOEXEC | SB_I_NODEV;
+	fc_init_pseudo(fc);
 	return 0;
 }
 
diff --git a/fs/ocfs2/dlmfs/dlmfs.c b/fs/ocfs2/dlmfs/dlmfs.c
index d3bfcada3e3bf5..1789ec96dc130f 100644
--- a/fs/ocfs2/dlmfs/dlmfs.c
+++ b/fs/ocfs2/dlmfs/dlmfs.c
@@ -21,6 +21,7 @@
 #include <linux/module.h>
 #include <linux/fs.h>
 #include <linux/fs_context.h>
+#include <linux/pseudo_fs.h>
 #include <linux/pagemap.h>
 #include <linux/types.h>
 #include <linux/slab.h>
@@ -563,6 +564,7 @@ static const struct fs_context_operations dlmfs_context_ops = {
 
 static int dlmfs_init_fs_context(struct fs_context *fc)
 {
+	fc_init_pseudo(fc);
 	fc->ops = &dlmfs_context_ops;
 
 	return 0;
diff --git a/fs/openpromfs/inode.c b/fs/openpromfs/inode.c
index fb8d84bdedfb20..6cd02d456bac95 100644
--- a/fs/openpromfs/inode.c
+++ b/fs/openpromfs/inode.c
@@ -10,6 +10,7 @@
 #include <linux/string.h>
 #include <linux/fs.h>
 #include <linux/fs_context.h>
+#include <linux/pseudo_fs.h>
 #include <linux/init.h>
 #include <linux/slab.h>
 #include <linux/seq_file.h>
@@ -419,6 +420,7 @@ static const struct fs_context_operations openpromfs_context_ops = {
 
 static int openpromfs_init_fs_context(struct fs_context *fc)
 {
+	fc_init_pseudo(fc);
 	fc->ops = &openpromfs_context_ops;
 	return 0;
 }
diff --git a/fs/proc/root.c b/fs/proc/root.c
index 7fbbe92bf73a71..ca0e75081934fc 100644
--- a/fs/proc/root.c
+++ b/fs/proc/root.c
@@ -17,6 +17,7 @@
 #include <linux/bitops.h>
 #include <linux/user_namespace.h>
 #include <linux/fs_context.h>
+#include <linux/pseudo_fs.h>
 #include <linux/mount.h>
 #include <linux/pid_namespace.h>
 #include <linux/fs_parser.h>
@@ -265,8 +266,6 @@ static int proc_fill_super(struct super_block *s, struct fs_context *fc)
 	if (ret)
 		return ret;
 
-	/* User space would break if executables or devices appear on proc */
-	s->s_iflags |= SB_I_NOEXEC | SB_I_NODEV;
 	s->s_flags |= SB_NODIRATIME | SB_NOSUID | SB_NOEXEC;
 	s->s_blocksize = 1024;
 	s->s_blocksize_bits = 10;
@@ -350,6 +349,7 @@ static int proc_init_fs_context(struct fs_context *fc)
 	put_user_ns(fc->user_ns);
 	fc->user_ns = get_user_ns(ctx->pid_ns->user_ns);
 	fc->fs_private = ctx;
+	fc_init_pseudo(fc);
 	fc->ops = &proc_fs_context_ops;
 	return 0;
 }
diff --git a/fs/pstore/inode.c b/fs/pstore/inode.c
index cf499ba727026e..4658561cf90b7d 100644
--- a/fs/pstore/inode.c
+++ b/fs/pstore/inode.c
@@ -18,6 +18,7 @@
 #include <linux/ramfs.h>
 #include <linux/fs_parser.h>
 #include <linux/fs_context.h>
+#include <linux/pseudo_fs.h>
 #include <linux/sched.h>
 #include <linux/magic.h>
 #include <linux/pstore.h>
@@ -491,6 +492,7 @@ static int pstore_init_fs_context(struct fs_context *fc)
 	ctx->kmsg_bytes = kmsg_bytes;
 
 	fc->fs_private = ctx;
+	fc_init_pseudo(fc);
 	fc->ops = &pstore_context_ops;
 
 	return 0;
diff --git a/fs/tracefs/inode.c b/fs/tracefs/inode.c
index 5020365ca70487..e04febd868eb41 100644
--- a/fs/tracefs/inode.c
+++ b/fs/tracefs/inode.c
@@ -12,6 +12,7 @@
 #include <linux/module.h>
 #include <linux/fs.h>
 #include <linux/fs_context.h>
+#include <linux/pseudo_fs.h>
 #include <linux/fs_parser.h>
 #include <linux/kobject.h>
 #include <linux/namei.h>
@@ -510,6 +511,7 @@ static int tracefs_init_fs_context(struct fs_context *fc)
 	fsi->mode = TRACEFS_DEFAULT_MODE;
 
 	fc->s_fs_info = fsi;
+	fc_init_pseudo(fc);
 	fc->ops = &tracefs_context_ops;
 	return 0;
 }
diff --git a/include/linux/fs.h b/include/linux/fs.h
index 99caef43ff3c47..407ffb6342ec6c 100644
--- a/include/linux/fs.h
+++ b/include/linux/fs.h
@@ -2553,6 +2553,18 @@ static inline const struct inode *file_user_inode(const struct file *f)
 	return file_inode(f);
 }
 
+/*
+ * Regular files on pseudo filesystems are kernel interfaces and must not be
+ * used as storage. Look through stacking filesystems at the inode that
+ * provides the data.
+ */
+static inline bool file_is_pseudo(const struct file *file)
+{
+	const struct inode *inode = d_real_inode(file->f_path.dentry);
+
+	return S_ISREG(inode->i_mode) && (inode->i_sb->s_iflags & SB_I_PSEUDO);
+}
+
 static inline struct file *file_clone_open(struct file *file)
 {
 	return dentry_open(&file->f_path, file->f_flags, file->f_cred);
diff --git a/include/linux/fs/super_types.h b/include/linux/fs/super_types.h
index 72f4288e16c526..472200bdf081a4 100644
--- a/include/linux/fs/super_types.h
+++ b/include/linux/fs/super_types.h
@@ -359,5 +359,6 @@ struct super_block {
 #define SB_I_NOIDMAP	0x00002000	/* No idmapped mounts on this superblock */
 #define SB_I_ALLOW_HSM	0x00004000	/* Allow HSM events on this superblock */
 #define SB_I_NO_DATA_INTEGRITY	0x00008000 /* fs cannot guarantee data persistence on sync */
+#define SB_I_PSEUDO	0x00010000	/* regular files are kernel interfaces, not storage */
 
 #endif /* _LINUX_FS_SUPER_TYPES_H */
diff --git a/include/linux/pseudo_fs.h b/include/linux/pseudo_fs.h
index a651e60d94107e..0ca408aa60aff4 100644
--- a/include/linux/pseudo_fs.h
+++ b/include/linux/pseudo_fs.h
@@ -2,6 +2,7 @@
 #define __LINUX_PSEUDO_FS__
 
 #include <linux/fs_context.h>
+#include <linux/fs/super_types.h>
 
 struct pseudo_fs_context {
 	const struct super_operations *ops;
@@ -15,4 +16,14 @@ struct pseudo_fs_context {
 struct pseudo_fs_context *init_pseudo(struct fs_context *fc,
 				      unsigned long magic);
 
+/*
+ * Common initialization for all pseudo filesystems, mountable or not. Their
+ * regular files are kernel interfaces. They don't store data and pseudo
+ * filesystems never hold executables or device nodes.
+ */
+static inline void fc_init_pseudo(struct fs_context *fc)
+{
+	fc->s_iflags |= SB_I_PSEUDO | SB_I_NOEXEC | SB_I_NODEV;
+}
+
 #endif
diff --git a/ipc/mqueue.c b/ipc/mqueue.c
index 322c3dd98c4477..8bbe32d0881f23 100644
--- a/ipc/mqueue.c
+++ b/ipc/mqueue.c
@@ -18,6 +18,7 @@
 #include <linux/file.h>
 #include <linux/mount.h>
 #include <linux/fs_context.h>
+#include <linux/pseudo_fs.h>
 #include <linux/namei.h>
 #include <linux/sysctl.h>
 #include <linux/poll.h>
@@ -405,7 +406,6 @@ static int mqueue_fill_super(struct super_block *sb, struct fs_context *fc)
 	struct inode *inode;
 	struct ipc_namespace *ns = sb->s_fs_info;
 
-	sb->s_iflags |= SB_I_NOEXEC | SB_I_NODEV;
 	sb->s_blocksize = PAGE_SIZE;
 	sb->s_blocksize_bits = PAGE_SHIFT;
 	sb->s_magic = MQUEUE_MAGIC;
@@ -457,6 +457,7 @@ static int mqueue_init_fs_context(struct fs_context *fc)
 	put_user_ns(fc->user_ns);
 	fc->user_ns = get_user_ns(ctx->ipc_ns->user_ns);
 	fc->fs_private = ctx;
+	fc_init_pseudo(fc);
 	fc->ops = &mqueue_fs_context_ops;
 	return 0;
 }
diff --git a/kernel/bpf/inode.c b/kernel/bpf/inode.c
index c6f328e4752e1d..57cf3775c07669 100644
--- a/kernel/bpf/inode.c
+++ b/kernel/bpf/inode.c
@@ -15,6 +15,7 @@
 #include <linux/namei.h>
 #include <linux/fs.h>
 #include <linux/fs_context.h>
+#include <linux/pseudo_fs.h>
 #include <linux/fs_parser.h>
 #include <linux/kdev_t.h>
 #include <linux/filter.h>
@@ -1197,8 +1198,6 @@ static int bpf_fill_super(struct super_block *sb, struct fs_context *fc)
 	sb->s_magic = BPF_FS_MAGIC;
 	sb->s_op = &bpf_super_ops;
 	sb->s_xattr = bpf_fs_xattr_handlers;
-	sb->s_iflags |= SB_I_NOEXEC;
-	sb->s_iflags |= SB_I_NODEV;
 	sb->s_time_gran = 1;
 
 	inode = bpf_get_inode(sb, NULL, S_IFDIR | 0777);
@@ -1261,6 +1260,7 @@ static int bpf_init_fs_context(struct fs_context *fc)
 	opts->delegate_attachs = 0;
 
 	fc->s_fs_info = opts;
+	fc_init_pseudo(fc);
 	fc->ops = &bpf_context_ops;
 	return 0;
 }
diff --git a/net/sunrpc/rpc_pipe.c b/net/sunrpc/rpc_pipe.c
index 9d349cfbc48312..37277a6d241562 100644
--- a/net/sunrpc/rpc_pipe.c
+++ b/net/sunrpc/rpc_pipe.c
@@ -15,6 +15,7 @@
 #include <linux/pagemap.h>
 #include <linux/mount.h>
 #include <linux/fs_context.h>
+#include <linux/pseudo_fs.h>
 #include <linux/namei.h>
 #include <linux/fsnotify.h>
 #include <linux/kernel.h>
@@ -1181,6 +1182,7 @@ static int rpc_init_fs_context(struct fs_context *fc)
 {
 	put_user_ns(fc->user_ns);
 	fc->user_ns = get_user_ns(fc->net_ns->user_ns);
+	fc_init_pseudo(fc);
 	fc->ops = &rpc_fs_context_ops;
 	return 0;
 }
diff --git a/security/apparmor/apparmorfs.c b/security/apparmor/apparmorfs.c
index a9936646721733..351ea3a7120e39 100644
--- a/security/apparmor/apparmorfs.c
+++ b/security/apparmor/apparmorfs.c
@@ -21,6 +21,7 @@
 #include <linux/rcupdate.h>
 #include <linux/fs.h>
 #include <linux/fs_context.h>
+#include <linux/pseudo_fs.h>
 #include <linux/poll.h>
 #include <linux/zstd.h>
 #include <linux/string.h>
@@ -263,6 +264,7 @@ static const struct fs_context_operations apparmorfs_context_ops = {
 
 static int apparmorfs_init_fs_context(struct fs_context *fc)
 {
+	fc_init_pseudo(fc);
 	fc->ops = &apparmorfs_context_ops;
 	return 0;
 }
diff --git a/security/inode.c b/security/inode.c
index 08040236767418..93997a9f16fcb3 100644
--- a/security/inode.c
+++ b/security/inode.c
@@ -14,6 +14,7 @@
 #include <linux/kobject.h>
 #include <linux/fs.h>
 #include <linux/fs_context.h>
+#include <linux/pseudo_fs.h>
 #include <linux/mount.h>
 #include <linux/pagemap.h>
 #include <linux/init.h>
@@ -64,6 +65,7 @@ static const struct fs_context_operations securityfs_context_ops = {
 
 static int securityfs_init_fs_context(struct fs_context *fc)
 {
+	fc_init_pseudo(fc);
 	fc->ops = &securityfs_context_ops;
 	return 0;
 }
diff --git a/security/selinux/selinuxfs.c b/security/selinux/selinuxfs.c
index 310e19efff1d0c..d7ae853b6d6854 100644
--- a/security/selinux/selinuxfs.c
+++ b/security/selinux/selinuxfs.c
@@ -18,6 +18,7 @@
 #include <linux/vmalloc.h>
 #include <linux/fs.h>
 #include <linux/fs_context.h>
+#include <linux/pseudo_fs.h>
 #include <linux/hex.h>
 #include <linux/mount.h>
 #include <linux/mutex.h>
@@ -1852,6 +1853,9 @@ static int sel_fill_super(struct super_block *sb, struct fs_context *fc)
 		/* last one */ {"", NULL, 0}
 	};
 
+	/* Android init opens the null device below by path. */
+	sb->s_iflags &= ~SB_I_NODEV;
+
 	ret = selinux_fs_info_create(sb);
 	if (ret)
 		goto err;
@@ -1955,6 +1959,7 @@ static const struct fs_context_operations sel_context_ops = {
 
 static int sel_init_fs_context(struct fs_context *fc)
 {
+	fc_init_pseudo(fc);
 	fc->ops = &sel_context_ops;
 	return 0;
 }
diff --git a/security/smack/smackfs.c b/security/smack/smackfs.c
index a72bc7fabea998..4a56bbeaeca370 100644
--- a/security/smack/smackfs.c
+++ b/security/smack/smackfs.c
@@ -25,6 +25,7 @@
 #include <linux/magic.h>
 #include <linux/mount.h>
 #include <linux/fs_context.h>
+#include <linux/pseudo_fs.h>
 #include "smack.h"
 
 #define BEBITS	(sizeof(__be32) * 8)
@@ -2880,6 +2881,7 @@ static const struct fs_context_operations smk_context_ops = {
  */
 static int smk_init_fs_context(struct fs_context *fc)
 {
+	fc_init_pseudo(fc);
 	fc->ops = &smk_context_ops;
 	return 0;
 }
diff --git a/tools/testing/selftests/filesystems/.gitignore b/tools/testing/selftests/filesystems/.gitignore
index cf79000e4092a1..8df38eabb1252d 100644
--- a/tools/testing/selftests/filesystems/.gitignore
+++ b/tools/testing/selftests/filesystems/.gitignore
@@ -7,3 +7,4 @@ kernfs_test
 idmapped_tmpfile
 ustat_test
 rw_hint_test
+pseudo_backing_test
diff --git a/tools/testing/selftests/filesystems/Makefile b/tools/testing/selftests/filesystems/Makefile
index fbd5c27505ef58..0ebb9005bcd289 100644
--- a/tools/testing/selftests/filesystems/Makefile
+++ b/tools/testing/selftests/filesystems/Makefile
@@ -2,7 +2,7 @@
 
 CFLAGS += $(KHDR_INCLUDES)
 TEST_GEN_PROGS := devpts_pts anon_inode_test kernfs_test fclog ustat_test rw_hint_test
-TEST_GEN_PROGS += idmapped_tmpfile
+TEST_GEN_PROGS += idmapped_tmpfile pseudo_backing_test
 TEST_GEN_PROGS_EXTENDED := dnotify_test
 
 include ../lib.mk
diff --git a/tools/testing/selftests/filesystems/config b/tools/testing/selftests/filesystems/config
index 9f45bc493a30a8..228196160d29f8 100644
--- a/tools/testing/selftests/filesystems/config
+++ b/tools/testing/selftests/filesystems/config
@@ -6,3 +6,12 @@ CONFIG_NET=y
 CONFIG_NET_NS=y
 CONFIG_INET=y
 CONFIG_SYSFS=y
+CONFIG_BLK_DEV_LOOP=y
+CONFIG_OVERLAY_FS=y
+CONFIG_TMPFS=y
+CONFIG_CONFIGFS_FS=y
+CONFIG_USB_GADGET=y
+CONFIG_USB_CONFIGFS=y
+CONFIG_USB_CONFIGFS_MASS_STORAGE=y
+CONFIG_EROFS_FS=y
+CONFIG_EROFS_FS_BACKED_BY_FILE=y
diff --git a/tools/testing/selftests/filesystems/pseudo_backing_test.c b/tools/testing/selftests/filesystems/pseudo_backing_test.c
new file mode 100644
index 00000000000000..bc8e17ab8e6ea3
--- /dev/null
+++ b/tools/testing/selftests/filesystems/pseudo_backing_test.c
@@ -0,0 +1,274 @@
+// SPDX-License-Identifier: GPL-2.0
+#define _GNU_SOURCE
+
+#include <errno.h>
+#include <fcntl.h>
+#include <limits.h>
+#include <sched.h>
+#include <stdbool.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <unistd.h>
+#include <linux/loop.h>
+#include <linux/magic.h>
+#include <sys/ioctl.h>
+#include <sys/mman.h>
+#include <sys/mount.h>
+#include <sys/stat.h>
+#include <sys/vfs.h>
+
+#include "kselftest_harness.h"
+#include "wrappers.h"
+
+/*
+ * Put @fd behind a free loop device. The device is set up with
+ * LO_FLAGS_AUTOCLEAR and goes away again when it is closed here.
+ */
+static int loop_attach(int fd, bool rw, char *dev, size_t len)
+{
+	struct loop_config cfg = {};
+	int ctl, nr, lfd, ret = 0;
+
+	ctl = open("/dev/loop-control", O_RDWR | O_CLOEXEC);
+	if (ctl < 0)
+		return -errno;
+	nr = ioctl(ctl, LOOP_CTL_GET_FREE);
+	if (nr < 0)
+		ret = -errno;
+	close(ctl);
+	if (ret)
+		return ret;
+
+	snprintf(dev, len, "/dev/loop%d", nr);
+	lfd = open(dev, (rw ? O_RDWR : O_RDONLY) | O_CLOEXEC);
+	if (lfd < 0)
+		return -errno;
+
+	cfg.fd = fd;
+	cfg.info.lo_flags = LO_FLAGS_AUTOCLEAR;
+	if (!rw)
+		cfg.info.lo_flags |= LO_FLAGS_READ_ONLY;
+	if (ioctl(lfd, LOOP_CONFIGURE, &cfg)) {
+		ret = -errno;
+		close(lfd);
+	} else {
+		ret = lfd;
+	}
+	return ret;
+}
+
+static int attach_path(const char *path, bool rw)
+{
+	char dev[PATH_MAX];
+	int fd, ret;
+
+	fd = open(path, (rw ? O_RDWR : O_RDONLY) | O_CLOEXEC);
+	if (fd < 0)
+		return -errno;
+	ret = loop_attach(fd, rw, dev, sizeof(dev));
+	close(fd);
+	if (ret >= 0) {
+		close(ret);
+		ret = 0;
+	}
+	return ret;
+}
+
+static bool can_use_loop(void)
+{
+	return geteuid() == 0 && access("/dev/loop-control", R_OK | W_OK) == 0;
+}
+
+TEST(memfd_backing_file)
+{
+	char dev[PATH_MAX];
+	int fd, lfd;
+
+	if (!can_use_loop())
+		SKIP(return, "loop devices unavailable");
+
+	fd = memfd_create("pseudo_backing_test", MFD_CLOEXEC);
+	ASSERT_GE(fd, 0);
+	ASSERT_EQ(ftruncate(fd, 1 << 20), 0);
+
+	lfd = loop_attach(fd, true, dev, sizeof(dev));
+	ASSERT_GE(lfd, 0);
+	EXPECT_EQ(close(lfd), 0);
+	EXPECT_EQ(close(fd), 0);
+}
+
+TEST(loop_device_backing_file)
+{
+	char dev[PATH_MAX], dev2[PATH_MAX];
+	int fd, lfd, bfd, lfd2;
+
+	if (!can_use_loop())
+		SKIP(return, "loop devices unavailable");
+
+	fd = memfd_create("pseudo_backing_test", MFD_CLOEXEC);
+	ASSERT_GE(fd, 0);
+	ASSERT_EQ(ftruncate(fd, 1 << 20), 0);
+	lfd = loop_attach(fd, true, dev, sizeof(dev));
+	ASSERT_GE(lfd, 0);
+
+	/* A block device stays fine as a backing file. */
+	bfd = open(dev, O_RDWR | O_CLOEXEC);
+	ASSERT_GE(bfd, 0);
+	lfd2 = loop_attach(bfd, true, dev2, sizeof(dev2));
+	ASSERT_GE(lfd2, 0);
+
+	EXPECT_EQ(close(lfd2), 0);
+	EXPECT_EQ(close(bfd), 0);
+	EXPECT_EQ(close(lfd), 0);
+	EXPECT_EQ(close(fd), 0);
+}
+
+TEST(write_only_backing_file)
+{
+	char dev[PATH_MAX], path[PATH_MAX];
+	int fd, wfd, lfd;
+
+	if (!can_use_loop())
+		SKIP(return, "loop devices unavailable");
+
+	fd = memfd_create("pseudo_backing_test", MFD_CLOEXEC);
+	ASSERT_GE(fd, 0);
+	ASSERT_EQ(ftruncate(fd, 1 << 20), 0);
+
+	/* Loop reads from its backing file so it must be open for reading. */
+	snprintf(path, sizeof(path), "/proc/self/fd/%d", fd);
+	wfd = open(path, O_WRONLY | O_CLOEXEC);
+	ASSERT_GE(wfd, 0);
+
+	lfd = loop_attach(wfd, true, dev, sizeof(dev));
+	if (lfd >= 0)
+		close(lfd);
+	EXPECT_EQ(lfd, -EBADF);
+	EXPECT_EQ(close(wfd), 0);
+	EXPECT_EQ(close(fd), 0);
+}
+
+TEST(procfs_backing_file)
+{
+	if (!can_use_loop())
+		SKIP(return, "loop devices unavailable");
+
+	ASSERT_EQ(attach_path("/proc/cpuinfo", false), -EINVAL);
+}
+
+TEST(sysfs_backing_file)
+{
+	if (!can_use_loop())
+		SKIP(return, "loop devices unavailable");
+
+	ASSERT_EQ(attach_path("/sys/kernel/warn_count", false), -EINVAL);
+
+	if (access("/sys/kernel/reboot/mode", F_OK))
+		SKIP(return, "no /sys/kernel/reboot/mode");
+	ASSERT_EQ(attach_path("/sys/kernel/reboot/mode", true), -EINVAL);
+}
+
+TEST(overlayfs_on_sysfs_backing_file)
+{
+	if (!can_use_loop())
+		SKIP(return, "loop devices unavailable");
+
+	ASSERT_EQ(unshare(CLONE_NEWNS), 0);
+	ASSERT_EQ(mount(NULL, "/", NULL, MS_REC | MS_PRIVATE, NULL), 0);
+	ASSERT_EQ(mount("tmpfs", "/tmp", "tmpfs", 0, NULL), 0);
+	ASSERT_EQ(mkdir("/tmp/empty", 0755), 0);
+	ASSERT_EQ(mkdir("/tmp/merged", 0755), 0);
+
+	/* A lower-only overlayfs serves reads from sysfs. */
+	if (mount("overlay", "/tmp/merged", "overlay", MS_RDONLY,
+		  "lowerdir=/sys/kernel:/tmp/empty"))
+		SKIP(return, "no overlayfs on top of sysfs: %s", strerror(errno));
+
+	ASSERT_EQ(attach_path("/tmp/merged/warn_count", false), -EINVAL);
+}
+
+#define CONFIGFS_DIR "/sys/kernel/config"
+#define GADGET_DIR CONFIGFS_DIR "/usb_gadget/pseudo_backing_test"
+#define MASS_STORAGE_DIR GADGET_DIR "/functions/mass_storage.0"
+
+TEST(usb_mass_storage_backing_file)
+{
+	const char *path = "/sys/kernel/warn_count";
+	struct statfs sfs;
+	ssize_t ret;
+	int fd, err;
+
+	if (geteuid())
+		SKIP(return, "needs root");
+
+	/* Mounting configfs on top of itself fails with EBUSY. */
+	if (statfs(CONFIGFS_DIR, &sfs) || sfs.f_type != CONFIGFS_MAGIC) {
+		ASSERT_EQ(unshare(CLONE_NEWNS), 0);
+		ASSERT_EQ(mount(NULL, "/", NULL, MS_REC | MS_PRIVATE, NULL), 0);
+		if (mount("configfs", CONFIGFS_DIR, "configfs", 0, NULL))
+			SKIP(return, "no configfs: %s", strerror(errno));
+	}
+
+	if (mkdir(GADGET_DIR, 0755))
+		SKIP(return, "no usb gadget configfs: %s", strerror(errno));
+	if (mkdir(MASS_STORAGE_DIR, 0755)) {
+		err = errno;
+		rmdir(GADGET_DIR);
+		SKIP(return, "no usb mass storage function: %s", strerror(err));
+	}
+
+	/* Writing the path opens the LUN's backing file right away. */
+	fd = open(MASS_STORAGE_DIR "/lun.0/file", O_WRONLY | O_CLOEXEC);
+	EXPECT_GE(fd, 0);
+	if (fd >= 0) {
+		ret = write(fd, path, strlen(path));
+		err = errno;
+		EXPECT_EQ(ret, -1);
+		EXPECT_EQ(err, EINVAL);
+		EXPECT_EQ(close(fd), 0);
+	}
+
+	EXPECT_EQ(rmdir(MASS_STORAGE_DIR), 0);
+	EXPECT_EQ(rmdir(GADGET_DIR), 0);
+}
+
+TEST(erofs_backing_file)
+{
+	bool refused = false;
+	char buf[256];
+	int fsfd, ret, err;
+	ssize_t n;
+
+	if (geteuid())
+		SKIP(return, "needs root");
+
+	fsfd = sys_fsopen("erofs", FSOPEN_CLOEXEC);
+	if (fsfd < 0)
+		SKIP(return, "no erofs: %s", strerror(errno));
+
+	ASSERT_EQ(sys_fsconfig(fsfd, FSCONFIG_SET_STRING, "source",
+			       "/sys/kernel/warn_count", 0), 0);
+	ret = sys_fsconfig(fsfd, FSCONFIG_CMD_CREATE, NULL, NULL, 0);
+	err = errno;
+	if (ret && err == ENOTBLK) {
+		close(fsfd);
+		SKIP(return, "no file-backed erofs mounts");
+	}
+	ASSERT_EQ(ret, -1);
+	ASSERT_EQ(err, EINVAL);
+
+	/*
+	 * Something that isn't an erofs image fails with EINVAL as well so
+	 * check that the source itself was refused.
+	 */
+	while ((n = read(fsfd, buf, sizeof(buf) - 1)) > 0) {
+		buf[n] = '\0';
+		if (strstr(buf, "pseudo filesystem"))
+			refused = true;
+	}
+	EXPECT_TRUE(refused);
+	EXPECT_EQ(close(fsfd), 0);
+}
+
+TEST_HARNESS_MAIN

79/3 2026/11/13 12:43 llm kmsan-evaluator
0m Model:
gemini-3.8-flash

Args:
null

Results:
null

Tokens:
							input: 17590
							output: 34
							thoughts: 822
						

Thoughts:
**Analyzing the Patch for Uninitialized Memory Risks**

Okay, let's break this patch down and see if it opens any doors for KMSAN fuzzing, focusing on potential uninitialized memory issues.

First, I see the core change: a new superblock flag, `SB_I_PSEUDO`, being introduced along with a helper function, `fc_init_pseudo()`. This helper sets flags on the `fs_context`, specifically `SB_I_PSEUDO`, `SB_I_NOEXEC`, and `SB_I_NODEV`. I know the impact here. The new `file_is_pseudo()` function uses the new flag. The patch then applies `fc_init_pseudo()` to a ton of pseudo filesystems, and cleans up redundant flag setting.

Now, the interesting part:  It's introducing checks with `file_is_pseudo()` in various places that deal with backing files. This has my full attention. This is where uninitialized data could hide. The patch adds checks in `loop.c`, `zloop.c`, `nvmet/io-cmd-file.c`, `target_core_file.c`, `storage_common.c` (usb gadget), `erofs/super.c`, and `fuse/backing.c`. Essentially, these checks are being used to identify and handle pseudo files that act as backing stores.

So, is there potential for uninitialized memory? The critical question: Is `fc->s_iflags` initialized when `fs_context` is created? We need to know that, since `fc_init_pseudo()` sets flags that are then used by this whole system, with `file_is_pseudo()`. I'm going to quickly grep for uses of `alloc_fs_context` or the creation of `fs_context` to see if there's any implicit or explicit initialization happening. My experience tells me that these types of structs are *often* not fully initialized. If it isn't, the bits being set by `fc_init_pseudo()` could be read from uninitialized memory, which could lead to very subtle bugs and info leaks. That's a classic KMSAN problem. The removal of the explicit setting of `SB_I_NOEXEC | SB_I_NODEV;` makes this even more important to verify.

Now, let's consider the KMSAN criteria. KMSAN is great at detecting reads from uninitialized memory, both on the stack, heap, and from page allocations.  We have to look for kernel-to-user memory info leaks through `copy_to_user`, `put_user`, netlink, ioctls, socket options, and BPF buffers – we need to verify that uninitialized values aren't ending up in any of these.  Conditional logic based on uninitialized variables is a big concern. And finally, and quite pertinent here, complex data structure allocation with potentially uninitialized fields.  We also need to check lengths and bounds, to make sure uninitialized data can't be indirectly accessed via the length of something, or via a buffer overrun.

Given the potential for subtle issues in these backing file interactions, I'll need to scrutinize how these pseudo filesystems interact with user-space and if any uninitialized data is exposed. The added self-tests are good, but I'll need to review them carefully to see how comprehensive they are. In short, it seems likely that this patch *could* introduce or expose uninitialized memory risks depending on the initialization of `fs_context` and how these "pseudo" files are used as backing stores. I am leaning toward fuzzing this with KMSAN after checking the allocation code.



80/3 2026/11/13 12:44 tool grepper
0m Args:
{
  "Expression": "alloc_fs_context|init_fs_context",
  "PathPrefixes": [
    "fs/"
  ]
}

Results:
{
  "Output": "\nFull output is too long, showing 200 out of 1041 lines.\nUse more precise expression or PathPrefixes if possible.\n\nNumber of matching lines per file (86 files in total):\nfs/9p/vfs_super.c:2\nfs/adfs/super.c:2\nfs/affs/super.c:2\nfs/afs/super.c:3\nfs/aio.c:2\nfs/anon_inodes.c:2\nfs/autofs/autofs_i.h:1\nfs/autofs/init.c:1\nfs/autofs/inode.c:1\nfs/befs/linuxvfs.c:2\nfs/binfmt_misc.c:2\nfs/btrfs/super.c:2\nfs/btrfs/tests/btrfs-tests.c:2\nfs/ceph/super.c:2\nfs/coda/inode.c:2\nfs/configfs/mount.c:2\nfs/cramfs/inode.c:2\nfs/debugfs/inode.c:2\nfs/devpts/inode.c:2\nfs/ecryptfs/main.c:2\nfs/efivarfs/super.c:2\nfs/erofs/super.c:4\nfs/exfat/super.c:2\nfs/ext2/super.c:2\nfs/ext4/extents-test.c:2\nfs/ext4/mballoc-test.c:2\nfs/ext4/super.c:5\nfs/f2fs/super.c:2\nfs/failfs.c:2\nfs/fat/fat.h:1\nfs/fat/inode.c:2\nfs/fat/namei_msdos.c:3\nfs/fat/namei_vfat.c:3\nfs/fs_context.c:7\nfs/fuse/control.c:2\nfs/fuse/fuse_i.h:1\nfs/fuse/inode.c:5\nfs/fuse/virtio_fs.c:3\nfs/gfs2/ops_fstype.c:5\nfs/hfs/super.c:2\nfs/hfsplus/super.c:2\nfs/hostfs/hostfs_kern.c:2\nfs/hpfs/super.c:2\nfs/hugetlbfs/inode.c:2\nfs/isofs/inode.c:2\nfs/jffs2/super.c:2\nfs/jfs/super.c:2\nfs/minix/inode.c:2\nfs/nfs/fs_context.c:3\nfs/nfsd/nfsctl.c:2\n... and 36 more files\n\nfs/9p/vfs_super.c=301=static const struct fs_context_operations v9fs_context_ops = {\n--\nfs/9p/vfs_super.c-306-\nfs/9p/vfs_super.c:307:static int v9fs_init_fs_context(struct fs_context *fc)\nfs/9p/vfs_super.c-308-{\n--\nfs/9p/vfs_super.c=358=struct file_system_type v9fs_fs_type = {\n--\nfs/9p/vfs_super.c-362-\t.fs_flags = FS_RENAME_DOES_D_MOVE,\nfs/9p/vfs_super.c:363:\t.init_fs_context = v9fs_init_fs_context,\nfs/9p/vfs_super.c-364-\t.parameters = v9fs_param_spec,\n--\nfs/adfs/super.c=423=static const struct fs_context_operations adfs_context_ops = {\n--\nfs/adfs/super.c-429-\nfs/adfs/super.c:430:static int adfs_init_fs_context(struct fs_context *fc)\nfs/adfs/super.c-431-{\n--\nfs/adfs/super.c=468=static struct file_system_type adfs_fs_type = {\n--\nfs/adfs/super.c-472-\t.fs_flags\t= FS_REQUIRES_DEV,\nfs/adfs/super.c:473:\t.init_fs_context = adfs_init_fs_context,\nfs/adfs/super.c-474-\t.parameters\t= adfs_param_spec,\n--\nfs/affs/super.c=609=static const struct fs_context_operations affs_context_ops = {\n--\nfs/affs/super.c-615-\nfs/affs/super.c:616:static int affs_init_fs_context(struct fs_context *fc)\nfs/affs/super.c-617-{\n--\nfs/affs/super.c=649=static struct file_system_type affs_fs_type = {\n--\nfs/affs/super.c-653-\t.fs_flags\t= FS_REQUIRES_DEV,\nfs/affs/super.c:654:\t.init_fs_context = affs_init_fs_context,\nfs/affs/super.c-655-\t.parameters\t= affs_param_spec,\n--\nfs/afs/super.c=39=static int afs_show_options(struct seq_file *m, struct dentry *root);\nfs/afs/super.c:40:static int afs_init_fs_context(struct fs_context *fc);\nfs/afs/super.c-41-static const struct fs_parameter_spec afs_fs_parameters[];\n--\nfs/afs/super.c=43=struct file_system_type afs_fs_type = {\n--\nfs/afs/super.c-45-\t.name\t\t\t= \"afs\",\nfs/afs/super.c:46:\t.init_fs_context\t= afs_init_fs_context,\nfs/afs/super.c-47-\t.parameters\t\t= afs_fs_parameters,\n--\nfs/afs/super.c=613=static const struct fs_context_operations afs_context_ops = {\n--\nfs/afs/super.c-621- */\nfs/afs/super.c:622:static int afs_init_fs_context(struct fs_context *fc)\nfs/afs/super.c-623-{\n--\nfs/aio.c=308=static const struct super_operations aio_super_operations = {\n--\nfs/aio.c-313-\nfs/aio.c:314:static int aio_init_fs_context(struct fs_context *fc)\nfs/aio.c-315-{\n--\nfs/aio.c=337=static int __init aio_setup(void)\n--\nfs/aio.c-340-\t\t.name\t\t= \"aio\",\nfs/aio.c:341:\t\t.init_fs_context = aio_init_fs_context,\nfs/aio.c-342-\t\t.kill_sb\t= kill_anon_super,\n--\nfs/anon_inodes.c=80=static const struct dentry_operations anon_inodefs_dentry_operations = {\n--\nfs/anon_inodes.c-83-\nfs/anon_inodes.c:84:static int anon_inodefs_init_fs_context(struct fs_context *fc)\nfs/anon_inodes.c-85-{\n--\nfs/anon_inodes.c=93=static struct file_system_type anon_inode_fs_type = {\nfs/anon_inodes.c-94-\t.name\t\t= \"anon_inodefs\",\nfs/anon_inodes.c:95:\t.init_fs_context = anon_inodefs_init_fs_context,\nfs/anon_inodes.c-96-\t.kill_sb\t= kill_anon_super,\n--\nfs/autofs/autofs_i.h=219=extern const struct fs_parameter_spec autofs_param_specs[];\nfs/autofs/autofs_i.h:220:int autofs_init_fs_context(struct fs_context *fc);\nfs/autofs/autofs_i.h-221-struct autofs_info *autofs_new_ino(struct autofs_sb_info *);\n--\nfs/autofs/init.c=10=struct file_system_type autofs_fs_type = {\n--\nfs/autofs/init.c-12-\t.name\t\t= \"autofs\",\nfs/autofs/init.c:13:\t.init_fs_context = autofs_init_fs_context,\nfs/autofs/init.c-14-\t.parameters\t= autofs_param_specs,\n--\nfs/autofs/inode.c=400=static const struct fs_context_operations autofs_context_ops = {\n--\nfs/autofs/inode.c-408- */\nfs/autofs/inode.c:409:int autofs_init_fs_context(struct fs_context *fc)\nfs/autofs/inode.c-410-{\n--\nfs/befs/linuxvfs.c=949=static const struct fs_context_operations befs_context_ops = {\n--\nfs/befs/linuxvfs.c-955-\nfs/befs/linuxvfs.c:956:static int befs_init_fs_context(struct fs_context *fc)\nfs/befs/linuxvfs.c-957-{\n--\nfs/befs/linuxvfs.c=982=static struct file_system_type befs_fs_type = {\n--\nfs/befs/linuxvfs.c-986-\t.fs_flags\t= FS_REQUIRES_DEV,\nfs/befs/linuxvfs.c:987:\t.init_fs_context = befs_init_fs_context,\nfs/befs/linuxvfs.c-988-\t.parameters\t= befs_param_spec,\n--\nfs/binfmt_misc.c=1653=static void bm_kill_sb(struct super_block *sb)\n--\nfs/binfmt_misc.c-1660-\nfs/binfmt_misc.c:1661:static int bm_init_fs_context(struct fs_context *fc)\nfs/binfmt_misc.c-1662-{\n--\nfs/binfmt_misc.c=1673=static struct file_system_type bm_fs_type = {\n--\nfs/binfmt_misc.c-1675-\t.name\t\t= \"binfmt_misc\",\nfs/binfmt_misc.c:1676:\t.init_fs_context = bm_init_fs_context,\nfs/binfmt_misc.c-1677-\t.fs_flags\t= FS_USERNS_MOUNT,\n--\nfs/btrfs/super.c=2176=static const struct fs_context_operations btrfs_fs_context_ops = {\n--\nfs/btrfs/super.c-2183-\nfs/btrfs/super.c:2184:static int btrfs_init_fs_context(struct fs_context *fc)\nfs/btrfs/super.c-2185-{\n--\nfs/btrfs/super.c=2214=static struct file_system_type btrfs_fs_type = {\n--\nfs/btrfs/super.c-2216-\t.name\t\t\t= \"btrfs\",\nfs/btrfs/super.c:2217:\t.init_fs_context\t= btrfs_init_fs_context,\nfs/btrfs/super.c-2218-\t.parameters\t\t= btrfs_fs_parameters,\n--\nfs/btrfs/tests/btrfs-tests.c=36=static const struct super_operations btrfs_test_super_ops = {\n--\nfs/btrfs/tests/btrfs-tests.c-41-\nfs/btrfs/tests/btrfs-tests.c:42:static int btrfs_test_init_fs_context(struct fs_context *fc)\nfs/btrfs/tests/btrfs-tests.c-43-{\n--\nfs/btrfs/tests/btrfs-tests.c=51=static struct file_system_type test_type = {\nfs/btrfs/tests/btrfs-tests.c-52-\t.name\t\t= \"btrfs_test_fs\",\nfs/btrfs/tests/btrfs-tests.c:53:\t.init_fs_context = btrfs_test_init_fs_context,\nfs/btrfs/tests/btrfs-tests.c-54-\t.kill_sb\t= kill_anon_super,\n--\nfs/ceph/super.c=1469=static const struct fs_context_operations ceph_context_ops = {\n--\nfs/ceph/super.c-1478- */\nfs/ceph/super.c:1479:static int ceph_init_fs_context(struct fs_context *fc)\nfs/ceph/super.c-1480-{\n--\nfs/ceph/super.c=1644=static struct file_system_type ceph_fs_type = {\n--\nfs/ceph/super.c-1646-\t.name\t\t= \"ceph\",\nfs/ceph/super.c:1647:\t.init_fs_context = ceph_init_fs_context,\nfs/ceph/super.c-1648-\t.kill_sb\t= ceph_kill_sb,\n--\nfs/coda/inode.c=372=static const struct fs_context_operations coda_context_ops = {\n--\nfs/coda/inode.c-379-\nfs/coda/inode.c:380:static int coda_init_fs_context(struct fs_context *fc)\nfs/coda/inode.c-381-{\n--\nfs/coda/inode.c=393=struct file_system_type coda_fs_type = {\n--\nfs/coda/inode.c-395-\t.name\t\t= \"coda\",\nfs/coda/inode.c:396:\t.init_fs_context = coda_init_fs_context,\nfs/coda/inode.c-397-\t.parameters\t= coda_param_specs,\n--\nfs/configfs/mount.c=104=static const struct fs_context_operations configfs_context_ops = {\n--\nfs/configfs/mount.c-107-\nfs/configfs/mount.c:108:static int configfs_init_fs_context(struct fs_context *fc)\nfs/configfs/mount.c-109-{\n--\nfs/configfs/mount.c=115=static struct file_system_type configfs_fs_type = {\n--\nfs/configfs/mount.c-117-\t.name\t\t= \"configfs\",\nfs/configfs/mount.c:118:\t.init_fs_context = configfs_init_fs_context,\nfs/configfs/mount.c-119-\t.kill_sb\t= kill_anon_super,\n--\nfs/cramfs/inode.c=967=static const struct fs_context_operations cramfs_context_ops = {\n--\nfs/cramfs/inode.c-974- */\nfs/cramfs/inode.c:975:static int cramfs_init_fs_context(struct fs_context *fc)\nfs/cramfs/inode.c-976-{\n--\nfs/cramfs/inode.c=981=static struct file_system_type cramfs_fs_type = {\n--\nfs/cramfs/inode.c-983-\t.name\t\t= \"cramfs\",\nfs/cramfs/inode.c:984:\t.init_fs_context = cramfs_init_fs_context,\nfs/cramfs/inode.c-985-\t.kill_sb\t= cramfs_kill_sb,\n--\nfs/debugfs/inode.c=303=static const struct fs_context_operations debugfs_context_ops = {\n--\nfs/debugfs/inode.c-309-\nfs/debugfs/inode.c:310:static int debugfs_init_fs_context(struct fs_context *fc)\nfs/debugfs/inode.c-311-{\n--\nfs/debugfs/inode.c=326=static struct file_system_type debug_fs_type = {\n--\nfs/debugfs/inode.c-328-\t.name =\t\t\"debugfs\",\nfs/debugfs/inode.c:329:\t.init_fs_context = debugfs_init_fs_context,\nfs/debugfs/inode.c-330-\t.parameters =\tdebugfs_param_specs,\n--\nfs/devpts/inode.c=412=static const struct fs_context_operations devpts_context_ops = {\n--\n\n"
}

81/3 2026/11/13 12:44 llm kmsan-evaluator
0m Model:
gemini-3.8-flash

Args:
null

Results:
null

Tokens:
							input: 23534
							output: 33
							thoughts: 34
						

Thoughts:
Okay, let's dive into this. Here's how I'd approach understanding the allocation of `fs_context`:

**Dissecting `fs_context` Allocation**

Alright, the task at hand is to understand how `fs_context` is allocated. My initial instinct, as always, is to go directly to the source. The natural starting point is the file `fs/fs_context.c`, specifically around the `alloc_fs_context` function. That's where the rubber meets the road, so to speak. I need to understand how the system creates and initializes these critical structures. Let me dig into that and see what that code has to say. From there I'll likely need to trace calls or other related files that are included, but it all starts with that file.



82/3 2026/11/13 12:44 tool grepper
0m Args:
{
  "Expression": "alloc_fs_context",
  "PathPrefixes": [
    "fs/fs_context.c"
  ]
}

Results:
{
  "Output": "fs/fs_context.c=243=EXPORT_SYMBOL(generic_parse_monolithic);\n--\nfs/fs_context.c-245-/**\nfs/fs_context.c:246: * alloc_fs_context - Create a filesystem context.\nfs/fs_context.c-247- * @fs_type: The filesystem type.\n--\nfs/fs_context.c-257- */\nfs/fs_context.c:258:static struct fs_context *alloc_fs_context(struct file_system_type *fs_type,\nfs/fs_context.c-259-\t\t\t\t      struct dentry *reference,\n--\nfs/fs_context.c=306=struct fs_context *fs_context_for_mount(struct file_system_type *fs_type,\n--\nfs/fs_context.c-308-{\nfs/fs_context.c:309:\treturn alloc_fs_context(fs_type, NULL, sb_flags, 0,\nfs/fs_context.c-310-\t\t\t\t\tFS_CONTEXT_FOR_MOUNT);\n--\nfs/fs_context.c=314=struct fs_context *fs_context_for_reconfigure(struct dentry *dentry,\n--\nfs/fs_context.c-321-\nfs/fs_context.c:322:\treturn alloc_fs_context(dentry-\u003ed_sb-\u003es_type, dentry, sb_flags,\nfs/fs_context.c-323-\t\t\t\tsb_flags_mask, FS_CONTEXT_FOR_RECONFIGURE);\n--\nfs/fs_context.c=334=struct fs_context *fs_context_for_submount(struct file_system_type *type,\n--\nfs/fs_context.c-339-\nfs/fs_context.c:340:\tfc = alloc_fs_context(type, reference, 0, 0, FS_CONTEXT_FOR_SUBMOUNT);\nfs/fs_context.c-341-\tif (IS_ERR(fc))\n"
}

83/3 2026/11/13 12:44 llm kmsan-evaluator
0m Model:
gemini-3.8-flash

Args:
null

Results:
null

Tokens:
							input: 24290
							output: 35
							thoughts: 22
						

Thoughts:
Okay, let's dive into this. Here's how I'd approach summarizing the prompt:

**Inspecting `alloc_fs_context`**

Alright, my first instinct is to zero in on the `alloc_fs_context` function. I need to understand its role within the kernel's filesystem infrastructure. The path `fs/fs_context.c` tells me this is where the core logic likely resides. This is a critical function, as it's the gateway for setting up any filesystem context. I want to see how the context is actually allocated, initialized, and potentially, if there are any specific structures I should be aware of. I'll need to look for calls to allocation routines, structure initializations, error handling, and any interactions with other related kernel subsystems. This will give me a better understanding on how the filesystem context is created.



84/3 2026/11/13 12:45 tool read-file
0m Args:
{
  "File": "fs/fs_context.c",
  "FirstLine": 258,
  "LineCount": 40
}

Results:
{
  "Contents": " 258:\tstatic struct fs_context *alloc_fs_context(struct file_system_type *fs_type,\n 259:\t\t\t\t\t      struct dentry *reference,\n 260:\t\t\t\t\t      unsigned int sb_flags,\n 261:\t\t\t\t\t      unsigned int sb_flags_mask,\n 262:\t\t\t\t\t      enum fs_context_purpose purpose)\n 263:\t{\n 264:\t\tstruct fs_context *fc;\n 265:\t\tint ret = -ENOMEM;\n 266:\t\n 267:\t\tfc = kzalloc_obj(struct fs_context, GFP_KERNEL_ACCOUNT);\n 268:\t\tif (!fc)\n 269:\t\t\treturn ERR_PTR(-ENOMEM);\n 270:\t\n 271:\t\tfc-\u003epurpose\t= purpose;\n 272:\t\tfc-\u003esb_flags\t= sb_flags;\n 273:\t\tfc-\u003esb_flags_mask = sb_flags_mask;\n 274:\t\tfc-\u003efs_type\t= get_filesystem(fs_type);\n 275:\t\tfc-\u003ecred\t= get_current_cred();\n 276:\t\tfc-\u003enet_ns\t= get_net(current-\u003ensproxy-\u003enet_ns);\n 277:\t\tfc-\u003elog.prefix\t= fs_type-\u003ename;\n 278:\t\n 279:\t\tmutex_init(\u0026fc-\u003euapi_mutex);\n 280:\t\n 281:\t\tswitch (purpose) {\n 282:\t\tcase FS_CONTEXT_FOR_MOUNT:\n 283:\t\t\tfc-\u003euser_ns = get_user_ns(fc-\u003ecred-\u003euser_ns);\n 284:\t\t\tbreak;\n 285:\t\tcase FS_CONTEXT_FOR_SUBMOUNT:\n 286:\t\t\tfc-\u003euser_ns = get_user_ns(reference-\u003ed_sb-\u003es_user_ns);\n 287:\t\t\tbreak;\n 288:\t\tcase FS_CONTEXT_FOR_RECONFIGURE:\n 289:\t\t\tatomic_inc(\u0026reference-\u003ed_sb-\u003es_active);\n 290:\t\t\tfc-\u003euser_ns = get_user_ns(reference-\u003ed_sb-\u003es_user_ns);\n 291:\t\t\tfc-\u003eroot = dget(reference);\n 292:\t\t\tbreak;\n 293:\t\t}\n 294:\t\n 295:\t\tret = fc-\u003efs_type-\u003einit_fs_context(fc);\n 296:\t\tif (ret \u003c 0)\n 297:\t\t\tgoto err_fc;\n"
}

85/3 2026/11/13 12:45 llm kmsan-evaluator
0m Model:
gemini-3.8-flash

Args:
null

Results:
null

Tokens:
							input: 25188
							output: 29
							thoughts: 65
						

Thoughts:
Okay, here's my take on those thoughts, framed as my own mental processing:

**Initial Context and a Question of State**

Right, so `alloc_fs_context` is the one allocating the `fs_context` structure, `fc`. I'm immediately thinking, "Aha, `kzalloc_obj`... so that means `fc` is initialized to zero on allocation, right?". I need to remember that basic memory management. It's second nature, but important to keep in mind.

Now the question that pops up: Where and how does the crucial file system flags, those `fc->s_iflags`, eventually find their way into the super block, `sb->s_iflags`? That's the critical connection I need to understand. I'm wondering if this copy is missing, or misplaced. 

Okay, I'm going to do some work. Let me start with a quick grep to search the `fs/` directory to track down references to `s_iflags` . That will probably shed some light on the copy or the lack thereof.



86/3 2026/11/13 12:45 tool grepper
0m Args:
{
  "Expression": "fc-\u003es_iflags",
  "PathPrefixes": [
    "fs/"
  ]
}

Results:
{
  "Output": "fs/nfs/fs_context.c=1692=static int nfs_init_fs_context(struct fs_context *fc)\n--\nfs/nfs/fs_context.c-1760-\nfs/nfs/fs_context.c:1761:\t\tfc-\u003es_iflags\t\t|= SB_I_STABLE_WRITES;\nfs/nfs/fs_context.c-1762-\t}\n--\nfs/super.c=811=struct super_block *sget_fc(struct fs_context *fc,\n--\nfs/super.c-862-\ts-\u003es_type = fc-\u003efs_type;\nfs/super.c:863:\ts-\u003es_iflags |= fc-\u003es_iflags;\nfs/super.c-864-\tstrscpy(s-\u003es_id, s-\u003es_type-\u003ename, sizeof(s-\u003es_id));\n"
}

87/3 2026/11/13 12:45 llm kmsan-evaluator
1m Model:
gemini-3.8-flash

Args:
null

Results:
null

Tokens:
							input: 25755
							output: 32
							thoughts: 54
						

Thoughts:
Okay, here's my take on those thoughts, framed as an expert's internal monologue:

**Investigating Potential Data Corruption**

Right, I'm digging into this `sget_fc` function. The first thing that jumps out is the line `s->s_iflags |= fc->s_iflags;`. We're essentially merging flags from `fc` into the superblock structure `s`. But hang on... `s` was allocated using `alloc_super()`. Now, *that* call typically uses `kzalloc`, which zeroes out memory. I need to confirm that. It's crucial for the integrity of the filesystem. If `kzalloc` isn't being used, we could have stale data in `s` that is then merged with new flags.

So, the next logical step is to quickly verify the implementation of `alloc_super()` and make absolutely sure it's zeroing the superblock's memory properly. Let's trace back to the allocation function and confirm that there isn't some intervening modification of the memory contents. This is a potential vulnerability, and a subtle bug of this type could manifest as corruption or unexpected behavior.



88/3 2026/11/13 12:46 tool grepper
0m Args:
{
  "Expression": "kzalloc.*super_block",
  "PathPrefixes": [
    "fs/super.c"
  ]
}

Results:
{
  "Output": "fs/super.c=319=static struct super_block *alloc_super(struct file_system_type *type, int flags,\n--\nfs/super.c-321-{\nfs/super.c:322:\tstruct super_block *s = kzalloc_obj(struct super_block);\nfs/super.c-323-\tstatic const struct super_operations default_op;\n"
}

89/3 2026/11/13 12:46 llm kmsan-evaluator
1m Model:
gemini-3.8-flash

Args:
null

Results:
null

Tokens:
							input: 26196
							output: 327
							thoughts: 2676
						

Thoughts:
**KMSAN Assessment: Blocking Pseudo Files as Backing Storage**

Alright, let's break this down. My primary concern here is memory safety, specifically whether this patch introduces any uninitialized memory reads or exposes uninitialized data. The core of this patch seems to be about preventing the use of "pseudo" filesystems (like `/proc` or `/sys`) as backing storage for various block/storage device drivers (loop, zloop, nvmet, target, gadget, fuse, erofs, etc.). The function `file_is_pseudo()` is key here; it checks if a given file belongs to a pseudo filesystem using the `SB_I_PSEUDO` flag.

First, `alloc_super` zeroes the `s` struct, and from there we dive into the check. `file_is_pseudo` is defined and utilizes a dentry lookup that returns the underlying inode. That inode, along with its superblock, are already initialized, according to the code review. The patch adds checks in multiple places: `loop_check_backing_file`, `zloop`, `nvmet/target/io-cmd-file.c`, `target_core_file.c`, `usb/gadget/storage_common.c`, `erofs/super.c`, and `fuse/backing.c`. These checks universally return `-EINVAL` or `-EBADF` if a pseudo file is detected, preventing their use as backing files. I can see that this patch is adding *restrictions*. It is not adding new access, it is rejecting previously allowed access.

So, the focus now is on whether those changes introduce any potential memory safety issues. Let's methodically look at possible vectors for memory exposure. I've considered:

1.  **Uninitialized data being sent to userspace:** Nope. No new data structures are being sent to user space. The only user-space interaction is in the selftests which are part of the patch.
2.  **Conditional logic depending on uninitialized variables:** No. All the variables checked (`fc->s_iflags`, `inode->i_mode`, `inode->i_sb->s_iflags`, `file->f_mode`, and `file->f_op->read_iter`) are either properly initialized during allocation, file open, or initialization of the file operations table.
3.  **Uninitialized fields in newly allocated data structures:** Not applicable here. No new, complex data structures are being allocated.
4.  **Bounds checks exposing uninitialized memory:** Nope. The checks are *adding* restrictions, preventing the use of pseudo files or files lacking read/write operations. There's no way this exposes uninitialized bytes.

I need to confirm these things. I need to be 100% sure. So, I need to check all the modified files to verify there's no way to expose uninitialized memory. I'm verifying that all the calls to `fc_init_pseudo()` are properly setting the flags, and that `file_is_pseudo()` is only reading initialized values.

Alright, after reviewing the modified files, my conclusion is solid. There's no uninitialized memory, no information leaks. This patch is adding checks, not creating new ways to mishandle memory. KMSAN doesn't need to be run, and I'd recommend marking `NeedsKMSAN` as `false`. The added validation checks are good; they prevent unexpected behavior and improve system stability, and that's *always* a good thing.

In summary: I'm confident that the changes are safe from KMSAN concerns. The patch is strictly adding sanity checks and restrictions on file usage, not introducing any new uninitialized memory vulnerabilities.



90/3 2026/11/13 12:48 tool set-results
0m Args:
{
  "KMSANReasoning": "The patch series introduces a new superblock internal flag `SB_I_PSEUDO` and helper functions `fc_init_pseudo()` and `file_is_pseudo()`. It marks pseudo filesystems with this flag during `init_fs_context` and adds checks across various storage subsystems (loop, zloop, nvmet, target_core_file, usb mass storage gadget, erofs, fuse backing) to disallow regular files on pseudo filesystems from being used as backing storage.\n\nContrasting KASAN vs KMSAN applicability:\n- KMSAN is designed to catch reads of uninitialized memory and information leaks to user space. In this patch series, no new uninitialized memory allocations or buffer copies to user space are introduced. The `fs_context` structures where `fc_init_pseudo()` sets flags are allocated zeroed via `kzalloc_obj()`. The check `file_is_pseudo()` only inspects existing, fully initialized fields (`inode-\u003ei_mode` and `sb-\u003es_iflags`).\n- KASAN and standard kernel debuggers (e.g., LOCKDEP, assertions) are relevant for any potential regressions or errors in file operations and storage backing teardowns, though the patch mainly adds early `-EINVAL`/`-EBADF` rejections on invalid backing file setups.\n\nSince there is no exposure or risk of uninitialized memory usage, a dedicated KMSAN fuzzing session is not warranted.",
  "NeedsKMSAN": false
}

Results:
{
  "KMSANReasoning": "The patch series introduces a new superblock internal flag `SB_I_PSEUDO` and helper functions `fc_init_pseudo()` and `file_is_pseudo()`. It marks pseudo filesystems with this flag during `init_fs_context` and adds checks across various storage subsystems (loop, zloop, nvmet, target_core_file, usb mass storage gadget, erofs, fuse backing) to disallow regular files on pseudo filesystems from being used as backing storage.\n\nContrasting KASAN vs KMSAN applicability:\n- KMSAN is designed to catch reads of uninitialized memory and information leaks to user space. In this patch series, no new uninitialized memory allocations or buffer copies to user space are introduced. The `fs_context` structures where `fc_init_pseudo()` sets flags are allocated zeroed via `kzalloc_obj()`. The check `file_is_pseudo()` only inspects existing, fully initialized fields (`inode-\u003ei_mode` and `sb-\u003es_iflags`).\n- KASAN and standard kernel debuggers (e.g., LOCKDEP, assertions) are relevant for any potential regressions or errors in file operations and storage backing teardowns, though the patch mainly adds early `-EINVAL`/`-EBADF` rejections on invalid backing file setups.\n\nSince there is no exposure or risk of uninitialized memory usage, a dedicated KMSAN fuzzing session is not warranted.",
  "NeedsKMSAN": false
}

LLM Calls Summary:
Total Calls Total Tokens Avg Tokens Total Duration (Seconds) Avg Duration (Seconds)
Tool Calls Summary:
Total Calls Total Duration (Seconds) Avg Duration (Seconds)