| Seq | Timestamp | Type | Name | Duration |
|---|---|---|---|---|
| 0/0 | 2026/09/25 03:26 | flow | patch-triage |
0mArgs:null Results: {
"EnableConfigs": null,
"FocusSymbols": [],
"KMSANReasoning": "",
"NeedsKMSAN": false,
"Reasoning": "The patch series implements support for zPCI Function Measurement Block (FMB) passthrough and management in VFIO and s390 PCI subsystems. All actual executable logic changes are located in arch/s390/ and drivers/vfio/pci/vfio_pci_zdev.c, which depends on CONFIG_VFIO_PCI_ZDEV_KVM (requiring S390 \u0026\u0026 KVM). On the target architecture (amd64), CONFIG_VFIO_PCI_ZDEV_KVM cannot be enabled, and the new VFIO ioctl feature cases in vfio_pci_core.c call static inline stubs returning -ENOTTY. Thus, the modified code is exclusive to the s390 architecture and structurally unreachable on amd64.",
"WorthFuzzing": false
} |
| 1/1 | 2026/09/25 03:26 | action | read-patch-diff |
0mArgs:null Results: {
"PatchDiff": "commit 2c22dc14eea239154eb93a61ee129eb6b4d7e7ef\nAuthor: syz-cluster \u003ctriage@syzkaller.com\u003e\nDate: Fri Sep 25 03:26:46 2026 +0000\n\n syz-cluster: applied patch under review\n\ndiff --git a/arch/s390/include/asm/pci.h b/arch/s390/include/asm/pci.h\nindex 88a125b92bdd5..b8162f7a8968b 100644\n--- a/arch/s390/include/asm/pci.h\n+++ b/arch/s390/include/asm/pci.h\n@@ -175,6 +175,7 @@ struct zpci_dev {\n \tu8\t\tutil_str_avail\t: 1;\n \tu8\t\ttid_avail\t: 1;\n \tu8\t\trtr_avail\t: 1; /* Relaxed translation allowed */\n+\tu8\t\tfmb_enabled\t: 1;\n \tunsigned int\tdevfn;\t\t/* DEVFN part of the RID*/\n \n \tu8 pfip[CLP_PFIP_NR_SEGMENTS];\t/* pci function internal path */\n@@ -351,6 +352,7 @@ void zpci_remove_parent_msi_domain(struct zpci_bus *zbus);\n /* FMB */\n int zpci_fmb_enable_device(struct zpci_dev *);\n int zpci_fmb_disable_device(struct zpci_dev *);\n+int zpci_fmb_reenable_device(struct zpci_dev *zdev);\n \n /* Debug */\n int zpci_debug_init(void);\ndiff --git a/arch/s390/pci/pci.c b/arch/s390/pci/pci.c\nindex d64c544b32b0c..815257ddb6c86 100644\n--- a/arch/s390/pci/pci.c\n+++ b/arch/s390/pci/pci.c\n@@ -173,13 +173,20 @@ int zpci_fmb_enable_device(struct zpci_dev *zdev)\n \tunsigned long flags;\n \tu8 cc, status;\n \n-\tif (zdev-\u003efmb || sizeof(*zdev-\u003efmb) \u003c zdev-\u003efmb_length)\n+\tlockdep_assert_held(\u0026zdev-\u003efmb_lock);\n+\n+\tif (zdev-\u003efmb_enabled || sizeof(*zdev-\u003efmb) \u003c zdev-\u003efmb_length)\n \t\treturn -EINVAL;\n \n-\tzdev-\u003efmb = kmem_cache_zalloc(zdev_fmb_cache, GFP_KERNEL);\n-\tif (!zdev-\u003efmb)\n-\t\treturn -ENOMEM;\n-\tWARN_ON((u64) zdev-\u003efmb \u0026 0xf);\n+\tif (!zdev-\u003efmb) {\n+\t\tzdev-\u003efmb = kmem_cache_zalloc(zdev_fmb_cache, GFP_KERNEL);\n+\t\tif (!zdev-\u003efmb)\n+\t\t\treturn -ENOMEM;\n+\t\tWARN_ON((u64) zdev-\u003efmb \u0026 0xf);\n+\t} else {\n+\t\t/* FMB buffers are intentionally persistent for later reuse */\n+\t\tmemset(zdev-\u003efmb, 0, sizeof(*zdev-\u003efmb));\n+\t}\n \n \t/* reset software counters */\n \tspin_lock_irqsave(\u0026zdev-\u003edom_lock, flags);\n@@ -197,11 +204,11 @@ int zpci_fmb_enable_device(struct zpci_dev *zdev)\n \tfib.fmb_addr = virt_to_phys(zdev-\u003efmb);\n \tfib.gd = zdev-\u003egisa;\n \tcc = zpci_mod_fc(req, \u0026fib, \u0026status);\n-\tif (cc) {\n-\t\tkmem_cache_free(zdev_fmb_cache, zdev-\u003efmb);\n-\t\tzdev-\u003efmb = NULL;\n-\t}\n-\treturn cc ? -EIO : 0;\n+\tif (cc)\n+\t\treturn -EIO;\n+\n+\tzdev-\u003efmb_enabled = 1;\n+\treturn 0;\n }\n \n /* Modify PCI: Disable PCI function measurement */\n@@ -211,7 +218,9 @@ int zpci_fmb_disable_device(struct zpci_dev *zdev)\n \tstruct zpci_fib fib = {0};\n \tu8 cc, status;\n \n-\tif (!zdev-\u003efmb)\n+\tlockdep_assert_held(\u0026zdev-\u003efmb_lock);\n+\n+\tif (!zdev-\u003efmb_enabled)\n \t\treturn -EINVAL;\n \n \tfib.gd = zdev-\u003egisa;\n@@ -220,13 +229,39 @@ int zpci_fmb_disable_device(struct zpci_dev *zdev)\n \tcc = zpci_mod_fc(req, \u0026fib, \u0026status);\n \tif (cc == 3) /* Function already gone. */\n \t\tcc = 0;\n+\tif (cc)\n+\t\treturn -EIO;\n \n-\tif (!cc) {\n-\t\tkmem_cache_free(zdev_fmb_cache, zdev-\u003efmb);\n-\t\tzdev-\u003efmb = NULL;\n-\t}\n-\treturn cc ? -EIO : 0;\n+\tzdev-\u003efmb_enabled = 0;\n+\treturn 0;\n }\n+EXPORT_SYMBOL_GPL(zpci_fmb_disable_device);\n+\n+int zpci_fmb_reenable_device(struct zpci_dev *zdev)\n+{\n+\tu64 req = ZPCI_CREATE_REQ(zdev-\u003efh, 0, ZPCI_MOD_FC_SET_MEASURE);\n+\tstruct zpci_fib fib = {0};\n+\tu8 cc, status;\n+\n+\tlockdep_assert_held(\u0026zdev-\u003efmb_lock);\n+\n+\tif (!zdev-\u003efmb_enabled)\n+\t\treturn zpci_fmb_enable_device(zdev);\n+\n+\tfib.gd = zdev-\u003egisa;\n+\tcc = zpci_mod_fc(req, \u0026fib, \u0026status); /* Disable function measurement */\n+\n+\t/* Unlike in zpci_fmb_disable_device(), cc == 3 is not a valid state here\n+\t * because we are re-enabling function measurement for the same function\n+\t * handle.\n+\t */\n+\tif (cc)\n+\t\treturn -EIO;\n+\n+\tzdev-\u003efmb_enabled = 0;\n+\treturn zpci_fmb_enable_device(zdev);\n+}\n+EXPORT_SYMBOL_GPL(zpci_fmb_reenable_device);\n \n static int zpci_cfg_load(struct zpci_dev *zdev, int offset, u32 *val, u8 len)\n {\n@@ -639,7 +674,9 @@ int pcibios_enable_device(struct pci_dev *pdev, int mask)\n \tstruct zpci_dev *zdev = to_zpci(pdev);\n \n \tzpci_debug_init_device(zdev, dev_name(\u0026pdev-\u003edev));\n+\tmutex_lock(\u0026zdev-\u003efmb_lock);\n \tzpci_fmb_enable_device(zdev);\n+\tmutex_unlock(\u0026zdev-\u003efmb_lock);\n \n \treturn pci_enable_resources(pdev, mask);\n }\n@@ -648,7 +685,9 @@ void pcibios_disable_device(struct pci_dev *pdev)\n {\n \tstruct zpci_dev *zdev = to_zpci(pdev);\n \n+\tmutex_lock(\u0026zdev-\u003efmb_lock);\n \tzpci_fmb_disable_device(zdev);\n+\tmutex_unlock(\u0026zdev-\u003efmb_lock);\n \tzpci_debug_exit_device(zdev);\n }\n \n@@ -729,8 +768,14 @@ int zpci_reenable_device(struct zpci_dev *zdev)\n \t}\n \n \trc = zpci_iommu_register_ioat(zdev, \u0026status);\n-\tif (rc)\n+\tif (rc) {\n \t\tzpci_disable_device(zdev);\n+\t\treturn rc;\n+\t}\n+\n+\tguard(mutex)(\u0026zdev-\u003efmb_lock);\n+\tif (zdev-\u003efmb_enabled)\n+\t\tzpci_fmb_reenable_device(zdev);\n \n \treturn rc;\n }\n@@ -995,6 +1040,12 @@ void zpci_release_device(struct kref *kref)\n \tif (zdev-\u003ehas_resources)\n \t\tzpci_cleanup_bus_resources(zdev);\n \n+\tif (zdev-\u003efmb) {\n+\t\tzdev-\u003efmb_enabled = 0;\n+\t\tkmem_cache_free(zdev_fmb_cache, zdev-\u003efmb);\n+\t\tzdev-\u003efmb = NULL;\n+\t}\n+\n \tzpci_bus_device_unregister(zdev);\n \tzpci_destroy_iommu(zdev);\n \tzpci_dbg(3, \"rem fid:%x\\n\", zdev-\u003efid);\ndiff --git a/arch/s390/pci/pci_debug.c b/arch/s390/pci/pci_debug.c\nindex c7ed7bf254b5e..afc52bd5271a2 100644\n--- a/arch/s390/pci/pci_debug.c\n+++ b/arch/s390/pci/pci_debug.c\n@@ -97,7 +97,7 @@ static int pci_perf_show(struct seq_file *m, void *v)\n \t\treturn 0;\n \n \tmutex_lock(\u0026zdev-\u003efmb_lock);\n-\tif (!zdev-\u003efmb) {\n+\tif (!zdev-\u003efmb_enabled) {\n \t\tmutex_unlock(\u0026zdev-\u003efmb_lock);\n \t\tseq_puts(m, \"FMB statistics disabled\\n\");\n \t\treturn 0;\n@@ -153,6 +153,12 @@ static ssize_t pci_perf_seq_write(struct file *file, const char __user *ubuf,\n \tif (rc)\n \t\treturn rc;\n \n+\tmutex_lock(\u0026zdev-\u003ekzdev_lock);\n+\tif (zdev-\u003ekzdev) {\n+\t\trc = -EPERM;\n+\t\tgoto out_unlock_kzdev;\n+\t}\n+\n \tmutex_lock(\u0026zdev-\u003efmb_lock);\n \tswitch (val) {\n \tcase 0:\n@@ -163,6 +169,9 @@ static ssize_t pci_perf_seq_write(struct file *file, const char __user *ubuf,\n \t\tbreak;\n \t}\n \tmutex_unlock(\u0026zdev-\u003efmb_lock);\n+\n+out_unlock_kzdev:\n+\tmutex_unlock(\u0026zdev-\u003ekzdev_lock);\n \treturn rc ? rc : count;\n }\n \ndiff --git a/drivers/vfio/pci/vfio_pci_core.c b/drivers/vfio/pci/vfio_pci_core.c\nindex 6757054e9d875..3c827a77725b0 100644\n--- a/drivers/vfio/pci/vfio_pci_core.c\n+++ b/drivers/vfio/pci/vfio_pci_core.c\n@@ -1627,6 +1627,10 @@ int vfio_pci_core_ioctl_feature(struct vfio_device *device, u32 flags,\n \t\treturn vfio_pci_core_feature_dma_buf(vdev, flags, arg, argsz);\n \tcase VFIO_DEVICE_FEATURE_ZPCI_ERROR:\n \t\treturn vfio_pci_zdev_feature_err(device, flags, arg, argsz);\n+\tcase VFIO_DEVICE_FEATURE_ZPCI_FMB_ENABLE:\n+\t\treturn vfio_pci_zdev_feature_fmb_enable(vdev, flags, arg, argsz);\n+\tcase VFIO_DEVICE_FEATURE_ZPCI_FMB_READ:\n+\t\treturn vfio_pci_zdev_feature_fmb_read(vdev, flags, arg, argsz);\n \tdefault:\n \t\treturn -ENOTTY;\n \t}\ndiff --git a/drivers/vfio/pci/vfio_pci_priv.h b/drivers/vfio/pci/vfio_pci_priv.h\nindex 4e7162234a2eb..e04d7e9d0c300 100644\n--- a/drivers/vfio/pci/vfio_pci_priv.h\n+++ b/drivers/vfio/pci/vfio_pci_priv.h\n@@ -95,6 +95,10 @@ int vfio_pci_zdev_open_device(struct vfio_pci_core_device *vdev);\n void vfio_pci_zdev_close_device(struct vfio_pci_core_device *vdev);\n int vfio_pci_zdev_feature_err(struct vfio_device *device, u32 flags,\n \t\t\t void __user *arg, size_t argsz);\n+int vfio_pci_zdev_feature_fmb_enable(struct vfio_pci_core_device *vdev, u32 flags,\n+\t\t\t\t void __user *arg, size_t argsz);\n+int vfio_pci_zdev_feature_fmb_read(struct vfio_pci_core_device *vdev, u32 flags,\n+\t\t\t\t void __user *arg, size_t argsz);\n #else\n static inline int vfio_pci_info_zdev_add_caps(struct vfio_pci_core_device *vdev,\n \t\t\t\t\t struct vfio_info_cap *caps)\n@@ -116,6 +120,20 @@ static inline int vfio_pci_zdev_feature_err(struct vfio_device *device,\n {\n \treturn -ENOTTY;\n }\n+\n+static inline int vfio_pci_zdev_feature_fmb_enable(struct vfio_pci_core_device *vdev,\n+\t\t\t\t\t\t u32 flags, void __user *arg,\n+\t\t\t\t\t\t size_t argsz)\n+{\n+\treturn -ENOTTY;\n+}\n+\n+static inline int vfio_pci_zdev_feature_fmb_read(struct vfio_pci_core_device *vdev,\n+\t\t\t\t\t\t u32 flags, void __user *arg,\n+\t\t\t\t\t\t size_t argsz)\n+{\n+\treturn -ENOTTY;\n+}\n #endif\n \n static inline bool vfio_pci_is_vga(struct pci_dev *pdev)\ndiff --git a/drivers/vfio/pci/vfio_pci_zdev.c b/drivers/vfio/pci/vfio_pci_zdev.c\nindex f47f36314a1cc..b028de8e08a4c 100644\n--- a/drivers/vfio/pci/vfio_pci_zdev.c\n+++ b/drivers/vfio/pci/vfio_pci_zdev.c\n@@ -219,3 +219,63 @@ void vfio_pci_zdev_close_device(struct vfio_pci_core_device *vdev)\n \tif (zpci_kvm_hook.kvm_unregister)\n \t\tzpci_kvm_hook.kvm_unregister(zdev);\n }\n+\n+int vfio_pci_zdev_feature_fmb_enable(struct vfio_pci_core_device *vdev, u32 flags,\n+\t\t\t\t void __user *arg, size_t argsz)\n+{\n+\tstruct zpci_dev *zdev;\n+\tstruct vfio_device_feature_zpci_fmb_enable fmb_enable;\n+\tint ret;\n+\n+\tret = vfio_check_feature(flags, argsz, VFIO_DEVICE_FEATURE_SET, sizeof(fmb_enable));\n+\tif (ret != 1)\n+\t\treturn ret;\n+\n+\tzdev = to_zpci(vdev-\u003epdev);\n+\tif (!zdev)\n+\t\treturn -ENODEV;\n+\n+\tif (copy_from_user(\u0026fmb_enable, arg, sizeof(fmb_enable)))\n+\t\treturn -EFAULT;\n+\n+\tguard(mutex)(\u0026zdev-\u003efmb_lock);\n+\n+\tif (fmb_enable.enabled)\n+\t\treturn zpci_fmb_reenable_device(zdev);\n+\treturn zpci_fmb_disable_device(zdev);\n+}\n+\n+int vfio_pci_zdev_feature_fmb_read(struct vfio_pci_core_device *vdev, u32 flags,\n+\t\t\t\t void __user *arg, size_t argsz)\n+{\n+\tstruct zpci_dev *zdev;\n+\tstruct vfio_device_feature_zpci_fmb_read fmb_read;\n+\tstruct zpci_fmb fmb_bounce;\n+\tint ret;\n+\n+\tret = vfio_check_feature(flags, argsz, VFIO_DEVICE_FEATURE_GET, sizeof(fmb_read));\n+\tif (ret != 1)\n+\t\treturn ret;\n+\n+\tzdev = to_zpci(vdev-\u003epdev);\n+\tif (!zdev)\n+\t\treturn -ENODEV;\n+\n+\tif (copy_from_user(\u0026fmb_read, arg, sizeof(fmb_read)))\n+\t\treturn -EFAULT;\n+\tif (!fmb_read.data)\n+\t\treturn -EINVAL;\n+\n+\tmutex_lock(\u0026zdev-\u003efmb_lock);\n+\tif (!zdev-\u003efmb_enabled) {\n+\t\tmutex_unlock(\u0026zdev-\u003efmb_lock);\n+\t\treturn -ENOMSG;\n+\t}\n+\n+\tmemcpy(\u0026fmb_bounce, zdev-\u003efmb, zdev-\u003efmb_length);\n+\tmutex_unlock(\u0026zdev-\u003efmb_lock);\n+\n+\tif (copy_to_user(u64_to_user_ptr(fmb_read.data), \u0026fmb_bounce, zdev-\u003efmb_length))\n+\t\treturn -EFAULT;\n+\treturn 0;\n+}\ndiff --git a/include/uapi/linux/vfio.h b/include/uapi/linux/vfio.h\nindex e41437fa17ad0..a8d501e42ef96 100644\n--- a/include/uapi/linux/vfio.h\n+++ b/include/uapi/linux/vfio.h\n@@ -1555,6 +1555,35 @@ struct vfio_device_feature_zpci_err {\n \n #define VFIO_DEVICE_FEATURE_ZPCI_ERROR 13\n \n+/**\n+ * Upon VFIO_DEVICE_FEATURE_SET, enable or disable FMB for the VFIO zPCI device.\n+ *\n+ * enabled is treated as a bool, so any non-zero value evaluates to true. Nested\n+ * enabling resets the FMB counters to zero, and nested disabling fails.\n+ *\n+ * Returns: 0 on success, -1 and errno set appropriately on error.\n+ */\n+#define VFIO_DEVICE_FEATURE_ZPCI_FMB_ENABLE 14\n+\n+struct vfio_device_feature_zpci_fmb_enable {\n+\t__u8 enabled;\n+};\n+\n+/**\n+ * Upon VFIO_DEVICE_FEATURE_GET, provide FMB passthrough for VFIO zPCI devices.\n+ *\n+ * The user-provided buffer must be at least fmb_length large, where fmb_length\n+ * is reported in VFIO_DEVICE_INFO_CAP_ZPCI_BASE.\n+ *\n+ * Returns: 0 on success, -1 and errno set appropriately on error. errno==ENOMSG\n+ * when the FMB is not enabled.\n+ */\n+#define VFIO_DEVICE_FEATURE_ZPCI_FMB_READ 15\n+\n+struct vfio_device_feature_zpci_fmb_read {\n+\t__aligned_u64 data;\n+};\n+\n /* -------- API for Type1 VFIO IOMMU -------- */\n \n /**\n"
} |
| 2/1 | 2026/09/25 03:26 | agent | patch-evaluator |
0mModel:core Args: null Results: {
"EnableConfigs": null,
"FocusSymbols": [],
"Reasoning": "The patch series implements support for zPCI Function Measurement Block (FMB) passthrough and management in VFIO and s390 PCI subsystems. All actual executable logic changes are located in arch/s390/ and drivers/vfio/pci/vfio_pci_zdev.c, which depends on CONFIG_VFIO_PCI_ZDEV_KVM (requiring S390 \u0026\u0026 KVM). On the target architecture (amd64), CONFIG_VFIO_PCI_ZDEV_KVM cannot be enabled, and the new VFIO ioctl feature cases in vfio_pci_core.c call static inline stubs returning -ENOTTY. Thus, the modified code is exclusive to the s390 architecture and structurally unreachable on amd64.",
"WorthFuzzing": false
}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 2c22dc14eea239154eb93a61ee129eb6b4d7e7ef
Author: syz-cluster <triage@syzkaller.com>
Date: Fri Sep 25 03:26:46 2026 +0000
syz-cluster: applied patch under review
diff --git a/arch/s390/include/asm/pci.h b/arch/s390/include/asm/pci.h
index 88a125b92bdd5..b8162f7a8968b 100644
--- a/arch/s390/include/asm/pci.h
+++ b/arch/s390/include/asm/pci.h
@@ -175,6 +175,7 @@ struct zpci_dev {
u8 util_str_avail : 1;
u8 tid_avail : 1;
u8 rtr_avail : 1; /* Relaxed translation allowed */
+ u8 fmb_enabled : 1;
unsigned int devfn; /* DEVFN part of the RID*/
u8 pfip[CLP_PFIP_NR_SEGMENTS]; /* pci function internal path */
@@ -351,6 +352,7 @@ void zpci_remove_parent_msi_domain(struct zpci_bus *zbus);
/* FMB */
int zpci_fmb_enable_device(struct zpci_dev *);
int zpci_fmb_disable_device(struct zpci_dev *);
+int zpci_fmb_reenable_device(struct zpci_dev *zdev);
/* Debug */
int zpci_debug_init(void);
diff --git a/arch/s390/pci/pci.c b/arch/s390/pci/pci.c
index d64c544b32b0c..815257ddb6c86 100644
--- a/arch/s390/pci/pci.c
+++ b/arch/s390/pci/pci.c
@@ -173,13 +173,20 @@ int zpci_fmb_enable_device(struct zpci_dev *zdev)
unsigned long flags;
u8 cc, status;
- if (zdev->fmb || sizeof(*zdev->fmb) < zdev->fmb_length)
+ lockdep_assert_held(&zdev->fmb_lock);
+
+ if (zdev->fmb_enabled || sizeof(*zdev->fmb) < zdev->fmb_length)
return -EINVAL;
- zdev->fmb = kmem_cache_zalloc(zdev_fmb_cache, GFP_KERNEL);
- if (!zdev->fmb)
- return -ENOMEM;
- WARN_ON((u64) zdev->fmb & 0xf);
+ if (!zdev->fmb) {
+ zdev->fmb = kmem_cache_zalloc(zdev_fmb_cache, GFP_KERNEL);
+ if (!zdev->fmb)
+ return -ENOMEM;
+ WARN_ON((u64) zdev->fmb & 0xf);
+ } else {
+ /* FMB buffers are intentionally persistent for later reuse */
+ memset(zdev->fmb, 0, sizeof(*zdev->fmb));
+ }
/* reset software counters */
spin_lock_irqsave(&zdev->dom_lock, flags);
@@ -197,11 +204,11 @@ int zpci_fmb_enable_device(struct zpci_dev *zdev)
fib.fmb_addr = virt_to_phys(zdev->fmb);
fib.gd = zdev->gisa;
cc = zpci_mod_fc(req, &fib, &status);
- if (cc) {
- kmem_cache_free(zdev_fmb_cache, zdev->fmb);
- zdev->fmb = NULL;
- }
- return cc ? -EIO : 0;
+ if (cc)
+ return -EIO;
+
+ zdev->fmb_enabled = 1;
+ return 0;
}
/* Modify PCI: Disable PCI function measurement */
@@ -211,7 +218,9 @@ int zpci_fmb_disable_device(struct zpci_dev *zdev)
struct zpci_fib fib = {0};
u8 cc, status;
- if (!zdev->fmb)
+ lockdep_assert_held(&zdev->fmb_lock);
+
+ if (!zdev->fmb_enabled)
return -EINVAL;
fib.gd = zdev->gisa;
@@ -220,13 +229,39 @@ int zpci_fmb_disable_device(struct zpci_dev *zdev)
cc = zpci_mod_fc(req, &fib, &status);
if (cc == 3) /* Function already gone. */
cc = 0;
+ if (cc)
+ return -EIO;
- if (!cc) {
- kmem_cache_free(zdev_fmb_cache, zdev->fmb);
- zdev->fmb = NULL;
- }
- return cc ? -EIO : 0;
+ zdev->fmb_enabled = 0;
+ return 0;
}
+EXPORT_SYMBOL_GPL(zpci_fmb_disable_device);
+
+int zpci_fmb_reenable_device(struct zpci_dev *zdev)
+{
+ u64 req = ZPCI_CREATE_REQ(zdev->fh, 0, ZPCI_MOD_FC_SET_MEASURE);
+ struct zpci_fib fib = {0};
+ u8 cc, status;
+
+ lockdep_assert_held(&zdev->fmb_lock);
+
+ if (!zdev->fmb_enabled)
+ return zpci_fmb_enable_device(zdev);
+
+ fib.gd = zdev->gisa;
+ cc = zpci_mod_fc(req, &fib, &status); /* Disable function measurement */
+
+ /* Unlike in zpci_fmb_disable_device(), cc == 3 is not a valid state here
+ * because we are re-enabling function measurement for the same function
+ * handle.
+ */
+ if (cc)
+ return -EIO;
+
+ zdev->fmb_enabled = 0;
+ return zpci_fmb_enable_device(zdev);
+}
+EXPORT_SYMBOL_GPL(zpci_fmb_reenable_device);
static int zpci_cfg_load(struct zpci_dev *zdev, int offset, u32 *val, u8 len)
{
@@ -639,7 +674,9 @@ int pcibios_enable_device(struct pci_dev *pdev, int mask)
struct zpci_dev *zdev = to_zpci(pdev);
zpci_debug_init_device(zdev, dev_name(&pdev->dev));
+ mutex_lock(&zdev->fmb_lock);
zpci_fmb_enable_device(zdev);
+ mutex_unlock(&zdev->fmb_lock);
return pci_enable_resources(pdev, mask);
}
@@ -648,7 +685,9 @@ void pcibios_disable_device(struct pci_dev *pdev)
{
struct zpci_dev *zdev = to_zpci(pdev);
+ mutex_lock(&zdev->fmb_lock);
zpci_fmb_disable_device(zdev);
+ mutex_unlock(&zdev->fmb_lock);
zpci_debug_exit_device(zdev);
}
@@ -729,8 +768,14 @@ int zpci_reenable_device(struct zpci_dev *zdev)
}
rc = zpci_iommu_register_ioat(zdev, &status);
- if (rc)
+ if (rc) {
zpci_disable_device(zdev);
+ return rc;
+ }
+
+ guard(mutex)(&zdev->fmb_lock);
+ if (zdev->fmb_enabled)
+ zpci_fmb_reenable_device(zdev);
return rc;
}
@@ -995,6 +1040,12 @@ void zpci_release_device(struct kref *kref)
if (zdev->has_resources)
zpci_cleanup_bus_resources(zdev);
+ if (zdev->fmb) {
+ zdev->fmb_enabled = 0;
+ kmem_cache_free(zdev_fmb_cache, zdev->fmb);
+ zdev->fmb = NULL;
+ }
+
zpci_bus_device_unregister(zdev);
zpci_destroy_iommu(zdev);
zpci_dbg(3, "rem fid:%x\n", zdev->fid);
diff --git a/arch/s390/pci/pci_debug.c b/arch/s390/pci/pci_debug.c
index c7ed7bf254b5e..afc52bd5271a2 100644
--- a/arch/s390/pci/pci_debug.c
+++ b/arch/s390/pci/pci_debug.c
@@ -97,7 +97,7 @@ static int pci_perf_show(struct seq_file *m, void *v)
return 0;
mutex_lock(&zdev->fmb_lock);
- if (!zdev->fmb) {
+ if (!zdev->fmb_enabled) {
mutex_unlock(&zdev->fmb_lock);
seq_puts(m, "FMB statistics disabled\n");
return 0;
@@ -153,6 +153,12 @@ static ssize_t pci_perf_seq_write(struct file *file, const char __user *ubuf,
if (rc)
return rc;
+ mutex_lock(&zdev->kzdev_lock);
+ if (zdev->kzdev) {
+ rc = -EPERM;
+ goto out_unlock_kzdev;
+ }
+
mutex_lock(&zdev->fmb_lock);
switch (val) {
case 0:
@@ -163,6 +169,9 @@ static ssize_t pci_perf_seq_write(struct file *file, const char __user *ubuf,
break;
}
mutex_unlock(&zdev->fmb_lock);
+
+out_unlock_kzdev:
+ mutex_unlock(&zdev->kzdev_lock);
return rc ? rc : count;
}
diff --git a/drivers/vfio/pci/vfio_pci_core.c b/drivers/vfio/pci/vfio_pci_core.c
index 6757054e9d875..3c827a77725b0 100644
--- a/drivers/vfio/pci/vfio_pci_core.c
+++ b/drivers/vfio/pci/vfio_pci_core.c
@@ -1627,6 +1627,10 @@ int vfio_pci_core_ioctl_feature(struct vfio_device *device, u32 flags,
return vfio_pci_core_feature_dma_buf(vdev, flags, arg, argsz);
case VFIO_DEVICE_FEATURE_ZPCI_ERROR:
return vfio_pci_zdev_feature_err(device, flags, arg, argsz);
+ case VFIO_DEVICE_FEATURE_ZPCI_FMB_ENABLE:
+ return vfio_pci_zdev_feature_fmb_enable(vdev, flags, arg, argsz);
+ case VFIO_DEVICE_FEATURE_ZPCI_FMB_READ:
+ return vfio_pci_zdev_feature_fmb_read(vdev, flags, arg, argsz);
default:
return -ENOTTY;
}
diff --git a/drivers/vfio/pci/vfio_pci_priv.h b/drivers/vfio/pci/vfio_pci_priv.h
index 4e7162234a2eb..e04d7e9d0c300 100644
--- a/drivers/vfio/pci/vfio_pci_priv.h
+++ b/drivers/vfio/pci/vfio_pci_priv.h
@@ -95,6 +95,10 @@ int vfio_pci_zdev_open_device(struct vfio_pci_core_device *vdev);
void vfio_pci_zdev_close_device(struct vfio_pci_core_device *vdev);
int vfio_pci_zdev_feature_err(struct vfio_device *device, u32 flags,
void __user *arg, size_t argsz);
+int vfio_pci_zdev_feature_fmb_enable(struct vfio_pci_core_device *vdev, u32 flags,
+ void __user *arg, size_t argsz);
+int vfio_pci_zdev_feature_fmb_read(struct vfio_pci_core_device *vdev, u32 flags,
+ void __user *arg, size_t argsz);
#else
static inline int vfio_pci_info_zdev_add_caps(struct vfio_pci_core_device *vdev,
struct vfio_info_cap *caps)
@@ -116,6 +120,20 @@ static inline int vfio_pci_zdev_feature_err(struct vfio_device *device,
{
return -ENOTTY;
}
+
+static inline int vfio_pci_zdev_feature_fmb_enable(struct vfio_pci_core_device *vdev,
+ u32 flags, void __user *arg,
+ size_t argsz)
+{
+ return -ENOTTY;
+}
+
+static inline int vfio_pci_zdev_feature_fmb_read(struct vfio_pci_core_device *vdev,
+ u32 flags, void __user *arg,
+ size_t argsz)
+{
+ return -ENOTTY;
+}
#endif
static inline bool vfio_pci_is_vga(struct pci_dev *pdev)
diff --git a/drivers/vfio/pci/vfio_pci_zdev.c b/drivers/vfio/pci/vfio_pci_zdev.c
index f47f36314a1cc..b028de8e08a4c 100644
--- a/drivers/vfio/pci/vfio_pci_zdev.c
+++ b/drivers/vfio/pci/vfio_pci_zdev.c
@@ -219,3 +219,63 @@ void vfio_pci_zdev_close_device(struct vfio_pci_core_device *vdev)
if (zpci_kvm_hook.kvm_unregister)
zpci_kvm_hook.kvm_unregister(zdev);
}
+
+int vfio_pci_zdev_feature_fmb_enable(struct vfio_pci_core_device *vdev, u32 flags,
+ void __user *arg, size_t argsz)
+{
+ struct zpci_dev *zdev;
+ struct vfio_device_feature_zpci_fmb_enable fmb_enable;
+ int ret;
+
+ ret = vfio_check_feature(flags, argsz, VFIO_DEVICE_FEATURE_SET, sizeof(fmb_enable));
+ if (ret != 1)
+ return ret;
+
+ zdev = to_zpci(vdev->pdev);
+ if (!zdev)
+ return -ENODEV;
+
+ if (copy_from_user(&fmb_enable, arg, sizeof(fmb_enable)))
+ return -EFAULT;
+
+ guard(mutex)(&zdev->fmb_lock);
+
+ if (fmb_enable.enabled)
+ return zpci_fmb_reenable_device(zdev);
+ return zpci_fmb_disable_device(zdev);
+}
+
+int vfio_pci_zdev_feature_fmb_read(struct vfio_pci_core_device *vdev, u32 flags,
+ void __user *arg, size_t argsz)
+{
+ struct zpci_dev *zdev;
+ struct vfio_device_feature_zpci_fmb_read fmb_read;
+ struct zpci_fmb fmb_bounce;
+ int ret;
+
+ ret = vfio_check_feature(flags, argsz, VFIO_DEVICE_FEATURE_GET, sizeof(fmb_read));
+ if (ret != 1)
+ return ret;
+
+ zdev = to_zpci(vdev->pdev);
+ if (!zdev)
+ return -ENODEV;
+
+ if (copy_from_user(&fmb_read, arg, sizeof(fmb_read)))
+ return -EFAULT;
+ if (!fmb_read.data)
+ return -EINVAL;
+
+ mutex_lock(&zdev->fmb_lock);
+ if (!zdev->fmb_enabled) {
+ mutex_unlock(&zdev->fmb_lock);
+ return -ENOMSG;
+ }
+
+ memcpy(&fmb_bounce, zdev->fmb, zdev->fmb_length);
+ mutex_unlock(&zdev->fmb_lock);
+
+ if (copy_to_user(u64_to_user_ptr(fmb_read.data), &fmb_bounce, zdev->fmb_length))
+ return -EFAULT;
+ return 0;
+}
diff --git a/include/uapi/linux/vfio.h b/include/uapi/linux/vfio.h
index e41437fa17ad0..a8d501e42ef96 100644
--- a/include/uapi/linux/vfio.h
+++ b/include/uapi/linux/vfio.h
@@ -1555,6 +1555,35 @@ struct vfio_device_feature_zpci_err {
#define VFIO_DEVICE_FEATURE_ZPCI_ERROR 13
+/**
+ * Upon VFIO_DEVICE_FEATURE_SET, enable or disable FMB for the VFIO zPCI device.
+ *
+ * enabled is treated as a bool, so any non-zero value evaluates to true. Nested
+ * enabling resets the FMB counters to zero, and nested disabling fails.
+ *
+ * Returns: 0 on success, -1 and errno set appropriately on error.
+ */
+#define VFIO_DEVICE_FEATURE_ZPCI_FMB_ENABLE 14
+
+struct vfio_device_feature_zpci_fmb_enable {
+ __u8 enabled;
+};
+
+/**
+ * Upon VFIO_DEVICE_FEATURE_GET, provide FMB passthrough for VFIO zPCI devices.
+ *
+ * The user-provided buffer must be at least fmb_length large, where fmb_length
+ * is reported in VFIO_DEVICE_INFO_CAP_ZPCI_BASE.
+ *
+ * Returns: 0 on success, -1 and errno set appropriately on error. errno==ENOMSG
+ * when the FMB is not enabled.
+ */
+#define VFIO_DEVICE_FEATURE_ZPCI_FMB_READ 15
+
+struct vfio_device_feature_zpci_fmb_read {
+ __aligned_u64 data;
+};
+
/* -------- API for Type1 VFIO IOMMU -------- */
/**
|
| 3/2 | 2026/09/25 03:26 | llm | patch-evaluator |
0mModel:gemini-3.8-flash Args: null Results: null Tokens: input: 7823 output: 35 thoughts: 347 Thoughts: **Fuzzing Suitability Evaluation** Okay, so the goal is to determine if this patch series is a good candidate for syzkaller fuzzing, targeting amd64. My initial thought process is to quickly assess the code's reachability on the target architecture. The instructions are clear enough, so let's start with a systematic approach. I've got the patch list, and the first thing that jumps out is the inclusion of `arch/s390` files alongside `vfio` files, specifically within `drivers/`. This immediately triggers a red flag: does this code actually compile and run on amd64? The instructions specifically address this situation (section 2) regarding "Code paths exclusive to architectures other than the target architecture." Therefore, my focus shifts to determining if the `vfio_pci_zdev.c`, `vfio_pci_priv.h`, and `vfio_pci_core.c` files, among others in the `drivers/vfio/pci/` directory, are *conditionally* compiled, and whether this condition is exclusive to s390. To ascertain this, I need to either utilize my existing knowledge of the kernel build system and architecture-specific conditional compilation, or quickly run a `grep` command, or simply read the `Makefile` within the `drivers/vfio/pci/` directory. That should reveal whether there are `#ifdef` directives or build-time logic that restricts the compilation of these specific files to the s390 architecture. This information will be crucial in deciding if we need to pursue fuzzing of this series. |
| 4/2 | 2026/09/25 03:26 | tool | grepper |
0mArgs:{
"Expression": "vfio_pci_zdev",
"PathPrefix": "drivers/vfio/pci"
}Results: {
"Output": "drivers/vfio/pci/Makefile=3=vfio-pci-core-y := vfio_pci_core.o vfio_pci_intrs.o vfio_pci_rdwr.o vfio_pci_config.o\ndrivers/vfio/pci/Makefile:4:vfio-pci-core-$(CONFIG_VFIO_PCI_ZDEV_KVM) += vfio_pci_zdev.o\ndrivers/vfio/pci/Makefile-5-vfio-pci-core-$(CONFIG_VFIO_PCI_DMABUF) += vfio_pci_dmabuf.o\n--\ndrivers/vfio/pci/vfio_pci_core.c=591=int vfio_pci_core_enable(struct vfio_pci_core_device *vdev)\n--\ndrivers/vfio/pci/vfio_pci_core.c-636-\ndrivers/vfio/pci/vfio_pci_core.c:637:\tret = vfio_pci_zdev_open_device(vdev);\ndrivers/vfio/pci/vfio_pci_core.c-638-\tif (ret)\n--\ndrivers/vfio/pci/vfio_pci_core.c-669-out_free_zdev:\ndrivers/vfio/pci/vfio_pci_core.c:670:\tvfio_pci_zdev_close_device(vdev);\ndrivers/vfio/pci/vfio_pci_core.c-671-out_free_state:\n--\ndrivers/vfio/pci/vfio_pci_core.c=683=void vfio_pci_core_disable(struct vfio_pci_core_device *vdev)\n--\ndrivers/vfio/pci/vfio_pci_core.c-761-\ndrivers/vfio/pci/vfio_pci_core.c:762:\tvfio_pci_zdev_close_device(vdev);\ndrivers/vfio/pci/vfio_pci_core.c-763-\n--\ndrivers/vfio/pci/vfio_pci_core.c=1610=int vfio_pci_core_ioctl_feature(struct vfio_device *device, u32 flags,\n--\ndrivers/vfio/pci/vfio_pci_core.c-1628-\tcase VFIO_DEVICE_FEATURE_ZPCI_ERROR:\ndrivers/vfio/pci/vfio_pci_core.c:1629:\t\treturn vfio_pci_zdev_feature_err(device, flags, arg, argsz);\ndrivers/vfio/pci/vfio_pci_core.c-1630-\tcase VFIO_DEVICE_FEATURE_ZPCI_FMB_ENABLE:\ndrivers/vfio/pci/vfio_pci_core.c:1631:\t\treturn vfio_pci_zdev_feature_fmb_enable(vdev, flags, arg, argsz);\ndrivers/vfio/pci/vfio_pci_core.c-1632-\tcase VFIO_DEVICE_FEATURE_ZPCI_FMB_READ:\ndrivers/vfio/pci/vfio_pci_core.c:1633:\t\treturn vfio_pci_zdev_feature_fmb_read(vdev, flags, arg, argsz);\ndrivers/vfio/pci/vfio_pci_core.c-1634-\tdefault:\n--\ndrivers/vfio/pci/vfio_pci_priv.h=92=int vfio_pci_info_zdev_add_caps(struct vfio_pci_core_device *vdev,\ndrivers/vfio/pci/vfio_pci_priv.h-93-\t\t\t\tstruct vfio_info_cap *caps);\ndrivers/vfio/pci/vfio_pci_priv.h:94:int vfio_pci_zdev_open_device(struct vfio_pci_core_device *vdev);\ndrivers/vfio/pci/vfio_pci_priv.h:95:void vfio_pci_zdev_close_device(struct vfio_pci_core_device *vdev);\ndrivers/vfio/pci/vfio_pci_priv.h:96:int vfio_pci_zdev_feature_err(struct vfio_device *device, u32 flags,\ndrivers/vfio/pci/vfio_pci_priv.h-97-\t\t\t void __user *arg, size_t argsz);\ndrivers/vfio/pci/vfio_pci_priv.h:98:int vfio_pci_zdev_feature_fmb_enable(struct vfio_pci_core_device *vdev, u32 flags,\ndrivers/vfio/pci/vfio_pci_priv.h-99-\t\t\t\t void __user *arg, size_t argsz);\ndrivers/vfio/pci/vfio_pci_priv.h:100:int vfio_pci_zdev_feature_fmb_read(struct vfio_pci_core_device *vdev, u32 flags,\ndrivers/vfio/pci/vfio_pci_priv.h-101-\t\t\t\t void __user *arg, size_t argsz);\n--\ndrivers/vfio/pci/vfio_pci_priv.h=103=static inline int vfio_pci_info_zdev_add_caps(struct vfio_pci_core_device *vdev,\n--\ndrivers/vfio/pci/vfio_pci_priv.h-108-\ndrivers/vfio/pci/vfio_pci_priv.h:109:static inline int vfio_pci_zdev_open_device(struct vfio_pci_core_device *vdev)\ndrivers/vfio/pci/vfio_pci_priv.h-110-{\n--\ndrivers/vfio/pci/vfio_pci_priv.h-113-\ndrivers/vfio/pci/vfio_pci_priv.h:114:static inline void vfio_pci_zdev_close_device(struct vfio_pci_core_device *vdev)\ndrivers/vfio/pci/vfio_pci_priv.h-115-{}\ndrivers/vfio/pci/vfio_pci_priv.h-116-\ndrivers/vfio/pci/vfio_pci_priv.h:117:static inline int vfio_pci_zdev_feature_err(struct vfio_device *device,\ndrivers/vfio/pci/vfio_pci_priv.h-118-\t\t\t\t\t u32 flags, void __user *arg,\n--\ndrivers/vfio/pci/vfio_pci_priv.h-123-\ndrivers/vfio/pci/vfio_pci_priv.h:124:static inline int vfio_pci_zdev_feature_fmb_enable(struct vfio_pci_core_device *vdev,\ndrivers/vfio/pci/vfio_pci_priv.h-125-\t\t\t\t\t\t u32 flags, void __user *arg,\n--\ndrivers/vfio/pci/vfio_pci_priv.h-130-\ndrivers/vfio/pci/vfio_pci_priv.h:131:static inline int vfio_pci_zdev_feature_fmb_read(struct vfio_pci_core_device *vdev,\ndrivers/vfio/pci/vfio_pci_priv.h-132-\t\t\t\t\t\t u32 flags, void __user *arg,\n--\ndrivers/vfio/pci/vfio_pci_zdev.c=117=int vfio_pci_info_zdev_add_caps(struct vfio_pci_core_device *vdev,\n--\ndrivers/vfio/pci/vfio_pci_zdev.c-144-\ndrivers/vfio/pci/vfio_pci_zdev.c:145:int vfio_pci_zdev_feature_err(struct vfio_device *device, u32 flags,\ndrivers/vfio/pci/vfio_pci_zdev.c-146-\t\t\t void __user *arg, size_t argsz)\n--\ndrivers/vfio/pci/vfio_pci_zdev.c-183-\ndrivers/vfio/pci/vfio_pci_zdev.c:184:int vfio_pci_zdev_open_device(struct vfio_pci_core_device *vdev)\ndrivers/vfio/pci/vfio_pci_zdev.c-185-{\n--\ndrivers/vfio/pci/vfio_pci_zdev.c-206-\ndrivers/vfio/pci/vfio_pci_zdev.c:207:void vfio_pci_zdev_close_device(struct vfio_pci_core_device *vdev)\ndrivers/vfio/pci/vfio_pci_zdev.c-208-{\n--\ndrivers/vfio/pci/vfio_pci_zdev.c-222-\ndrivers/vfio/pci/vfio_pci_zdev.c:223:int vfio_pci_zdev_feature_fmb_enable(struct vfio_pci_core_device *vdev, u32 flags,\ndrivers/vfio/pci/vfio_pci_zdev.c-224-\t\t\t\t void __user *arg, size_t argsz)\n--\ndrivers/vfio/pci/vfio_pci_zdev.c-247-\ndrivers/vfio/pci/vfio_pci_zdev.c:248:int vfio_pci_zdev_feature_fmb_read(struct vfio_pci_core_device *vdev, u32 flags,\ndrivers/vfio/pci/vfio_pci_zdev.c-249-\t\t\t\t void __user *arg, size_t argsz)\n"
} |
| 5/2 | 2026/09/25 03:26 | llm | patch-evaluator |
0mModel:gemini-3.8-flash Args: null Results: null Tokens: input: 11134 output: 24 thoughts: 41 Thoughts: Okay, here's my take on those thoughts, tailored for an expert audience: **Analyzing `CONFIG_VFIO_PCI_ZDEV_KVM` in the Kconfig Context** Right, let's dive into this `CONFIG_VFIO_PCI_ZDEV_KVM` option. My initial thought is to immediately trace its definition within the Kconfig structure. I need to understand where this is being introduced, and what dependencies or constraints might be shaping its availability. Context is key, so I'm thinking I'll start by grepping the Kconfig files directly. I want to see which other features or hardware this setting is related to. Is it tied to specific architectures, device drivers, or hypervisor configurations? The goal is to build a complete mental map of its place in the broader VFIO/KVM ecosystem. This will give me a head start on understanding its implications. |
| 6/2 | 2026/09/25 03:27 | tool | grepper |
0mArgs:{
"Expression": "VFIO_PCI_ZDEV_KVM"
}Results: {
"Output": "arch/s390/kvm/s390/Makefile=11=kvm-y += $(gmap-y)\narch/s390/kvm/s390/Makefile-12-\narch/s390/kvm/s390/Makefile:13:kvm-$(CONFIG_VFIO_PCI_ZDEV_KVM) += pci.o\narch/s390/kvm/s390/Makefile-14-obj-$(CONFIG_KVM) += kvm.o\n--\narch/s390/kvm/s390/interrupt.c=3661=static void gib_alert_irq_handler(struct airq_struct *airq,\n--\narch/s390/kvm/s390/interrupt.c-3668-\tif ((info-\u003eforward || info-\u003eerror) \u0026\u0026\narch/s390/kvm/s390/interrupt.c:3669:\t IS_ENABLED(CONFIG_VFIO_PCI_ZDEV_KVM)) {\narch/s390/kvm/s390/interrupt.c-3670-\t\taen_process_gait(info-\u003eisc);\n--\narch/s390/kvm/s390/pci.h=48=static inline struct kvm *kvm_s390_pci_si_to_kvm(struct zpci_aift *aift,\n--\narch/s390/kvm/s390/pci.h-50-{\narch/s390/kvm/s390/pci.h:51:\tif (!IS_ENABLED(CONFIG_VFIO_PCI_ZDEV_KVM) || !aift-\u003ekzdev ||\narch/s390/kvm/s390/pci.h-52-\t !aift-\u003ekzdev[si])\n--\narch/s390/kvm/s390/pci.h=68=static inline bool kvm_s390_pci_interp_allowed(void)\n--\narch/s390/kvm/s390/pci.h-82-\tdefault:\narch/s390/kvm/s390/pci.h:83:\t\treturn (IS_ENABLED(CONFIG_VFIO_PCI_ZDEV_KVM) \u0026\u0026\narch/s390/kvm/s390/pci.h-84-\t\t\tsclp.has_zpci_lsi \u0026\u0026 sclp.has_aeni \u0026\u0026 sclp.has_aisi \u0026\u0026\n--\narch/s390/kvm/s390/s390.c=496=static int __init __kvm_s390_init(void)\n--\narch/s390/kvm/s390/s390.c-520-\narch/s390/kvm/s390/s390.c:521:\tif (IS_ENABLED(CONFIG_VFIO_PCI_ZDEV_KVM)) {\narch/s390/kvm/s390/s390.c-522-\t\trc = kvm_s390_pci_init();\n--\narch/s390/kvm/s390/s390.c-538-err_gib:\narch/s390/kvm/s390/s390.c:539:\tif (IS_ENABLED(CONFIG_VFIO_PCI_ZDEV_KVM))\narch/s390/kvm/s390/s390.c-540-\t\tkvm_s390_pci_exit();\n--\narch/s390/kvm/s390/s390.c=550=static void __kvm_s390_exit(void)\n--\narch/s390/kvm/s390/s390.c-555-\tkvm_s390_gib_destroy();\narch/s390/kvm/s390/s390.c:556:\tif (IS_ENABLED(CONFIG_VFIO_PCI_ZDEV_KVM))\narch/s390/kvm/s390/s390.c-557-\t\tkvm_s390_pci_exit();\n--\narch/s390/kvm/s390/s390.c=2900=int kvm_arch_vm_ioctl(struct file *filp, unsigned int ioctl, unsigned long arg)\n--\narch/s390/kvm/s390/s390.c-3063-\t\tr = -EINVAL;\narch/s390/kvm/s390/s390.c:3064:\t\tif (!IS_ENABLED(CONFIG_VFIO_PCI_ZDEV_KVM))\narch/s390/kvm/s390/s390.c-3065-\t\t\tbreak;\n--\narch/s390/kvm/s390/s390.c=3232=void kvm_arch_free_vm(struct kvm *kvm)\narch/s390/kvm/s390/s390.c-3233-{\narch/s390/kvm/s390/s390.c:3234:\tif (IS_ENABLED(CONFIG_VFIO_PCI_ZDEV_KVM))\narch/s390/kvm/s390/s390.c-3235-\t\tkvm_s390_pci_clear_list(kvm);\n--\narch/s390/kvm/s390/s390.c=3240=int kvm_arch_init_vm(struct kvm *kvm, unsigned long type)\n--\narch/s390/kvm/s390/s390.c-3316-\narch/s390/kvm/s390/s390.c:3317:\tif (IS_ENABLED(CONFIG_VFIO_PCI_ZDEV_KVM)) {\narch/s390/kvm/s390/s390.c-3318-\t\tmutex_lock(\u0026kvm-\u003elock);\n--\ndrivers/vfio/pci/Kconfig=45=endif\ndrivers/vfio/pci/Kconfig-46-\ndrivers/vfio/pci/Kconfig:47:config VFIO_PCI_ZDEV_KVM\ndrivers/vfio/pci/Kconfig-48-\tbool \"VFIO PCI extensions for s390x KVM passthrough\"\n--\ndrivers/vfio/pci/Makefile=3=vfio-pci-core-y := vfio_pci_core.o vfio_pci_intrs.o vfio_pci_rdwr.o vfio_pci_config.o\ndrivers/vfio/pci/Makefile:4:vfio-pci-core-$(CONFIG_VFIO_PCI_ZDEV_KVM) += vfio_pci_zdev.o\ndrivers/vfio/pci/Makefile-5-vfio-pci-core-$(CONFIG_VFIO_PCI_DMABUF) += vfio_pci_dmabuf.o\n--\ndrivers/vfio/pci/vfio_pci_priv.h=85=static inline int vfio_pci_igd_init(struct vfio_pci_core_device *vdev)\n--\ndrivers/vfio/pci/vfio_pci_priv.h-90-\ndrivers/vfio/pci/vfio_pci_priv.h:91:#ifdef CONFIG_VFIO_PCI_ZDEV_KVM\ndrivers/vfio/pci/vfio_pci_priv.h-92-int vfio_pci_info_zdev_add_caps(struct vfio_pci_core_device *vdev,\n--\ninclude/linux/sched/user.h=14=struct user_struct {\n--\ninclude/linux/sched/user.h-27-\tdefined(CONFIG_NET) || defined(CONFIG_IO_URING) || \\\ninclude/linux/sched/user.h:28:\tdefined(CONFIG_VFIO_PCI_ZDEV_KVM) || IS_ENABLED(CONFIG_IOMMUFD)\ninclude/linux/sched/user.h-29-\tatomic_long_t locked_vm;\n"
} |
| 7/2 | 2026/09/25 03:27 | llm | patch-evaluator |
0mModel:gemini-3.8-flash Args: null Results: null Tokens: input: 13543 output: 37 thoughts: 22 Thoughts: Okay, here's my summary, tailored for an expert audience, presented as if it were my thought process: **VFIO Kconfig Investigation** Alright, time to dig into this. I'm thinking, based on the context, the issue likely resides within the VFIO PCI driver configuration. Let's start with `drivers/vfio/pci/Kconfig` – the Kconfig file for that driver. Specifically, I'm going to jump in around line 47. My assumption is that the relevant conditional or option related to the suspected problem will be there, if it's not present then I will know to look deeper. Line 47 is a reasonable starting point for debugging this specific issue. I'm expecting something relating to the function of this driver. |
| 8/2 | 2026/09/25 03:27 | tool | read-file |
0mArgs:{
"File": "drivers/vfio/pci/Kconfig",
"FirstLine": 40,
"LineCount": 25
}Results: {
"Contents": " 40:\t\t assignment to virtual machines. This includes exposing an IGD\n 41:\t\t specific firmware table and read-only copies of the host bridge\n 42:\t\t and LPC bridge config space.\n 43:\t\n 44:\t\t To enable Intel IGD assignment through vfio-pci, say Y.\n 45:\tendif\n 46:\t\n 47:\tconfig VFIO_PCI_ZDEV_KVM\n 48:\t\tbool \"VFIO PCI extensions for s390x KVM passthrough\"\n 49:\t\tdepends on S390 \u0026\u0026 KVM\n 50:\t\tdefault y\n 51:\t\thelp\n 52:\t\t Support s390x-specific extensions to enable support for enhancements\n 53:\t\t to KVM passthrough capabilities, such as interpretive execution of\n 54:\t\t zPCI instructions.\n 55:\t\n 56:\t\t To enable s390x KVM vfio-pci extensions, say Y.\n 57:\t\n 58:\tconfig VFIO_PCI_DMABUF\n 59:\t\tdef_bool y if VFIO_PCI_CORE \u0026\u0026 PCI_P2PDMA \u0026\u0026 DMA_SHARED_BUFFER\n 60:\t\n 61:\tsource \"drivers/vfio/pci/mlx5/Kconfig\"\n 62:\t\n 63:\tsource \"drivers/vfio/pci/ism/Kconfig\"\n 64:\t\n"
} |
| 9/2 | 2026/09/25 03:27 | llm | patch-evaluator |
0mModel:gemini-3.8-flash Args: null Results: null Tokens: input: 14135 output: 199 thoughts: 1927 Thoughts: **Analysis of the VFIO PCI ZDEV KVM Patch for amd64** Okay, so I've got this patch adding VFIO PCI extensions for s390x KVM passthrough, and my job is to determine if it's worth fuzzing on an amd64 target. Let's dig in. The initial `config` option makes it clear that this feature is specifically for s390 and KVM. This immediately sets off alarm bells, but let's be thorough. First, I see the patch touches a bunch of `arch/s390` files and `drivers/vfio/pci` files, specifically `vfio_pci_core.c`, `vfio_pci_priv.h`, and `vfio_pci_zdev.c`. Hmm, right away, the `arch/s390` part screams "not for amd64." Okay, looking closer at `vfio_pci_core.c`, I see new `ioctl` handlers: `VFIO_DEVICE_FEATURE_ZPCI_FMB_ENABLE` and `VFIO_DEVICE_FEATURE_ZPCI_FMB_READ`. Then, I check `vfio_pci_priv.h`, and I see the crucial detail. When `CONFIG_VFIO_PCI_ZDEV_KVM` is *not* defined, which is the case for amd64 since it depends on S390, these ioctl handlers simply return `-ENOTTY`. This means they are effectively no-ops on amd64. `vfio_pci_zdev.c` is only compiled if that config is set, so it's irrelevant on amd64. And, the `include/uapi/linux/vfio.h` seems to just define macros, so it's not a source of any code execution. Now I remember, on amd64, calling those new `ioctl` handlers, will hit those inline stubs that return `-ENOTTY`, exactly the *same* behavior as before the patch. The whole point is for an `s390` architecture and passthrough. On amd64, we don't have this. Looking at the "negative criteria", unreachable execution paths is a deciding factor. Okay, let's verify that the `CONFIG_VFIO_PCI_ZDEV_KVM` is impossible to enable on amd64. The config clearly states it *depends on* `S390 && KVM`, so it's impossible to enable it on amd64, therefore, `vfio_pci_zdev.o` is not compiled. The calls to the zPCI functions in `vfio_pci_core.c` are simply replaced by these static inlines that return an error. All the actual, meaty logic, enabling/disabling/reading the zPCI FMB, is *exclusively* for s390. So, since all modified code is *only* executed if we have `s390`, and that configuration is *impossible* on amd64. It is *unreachable* on amd64. The negative criteria apply. No executable code can run on amd64. The behavior of the driver is effectively unchanged. We need to set `WorthFuzzing` to `false`. |
| 10/2 | 2026/09/25 03:27 | tool | set-results |
0mArgs:{
"EnableConfigs": [],
"FocusSymbols": [],
"Reasoning": "The patch series implements support for zPCI Function Measurement Block (FMB) passthrough and management in VFIO and s390 PCI subsystems. All actual executable logic changes are located in arch/s390/ and drivers/vfio/pci/vfio_pci_zdev.c, which depends on CONFIG_VFIO_PCI_ZDEV_KVM (requiring S390 \u0026\u0026 KVM). On the target architecture (amd64), CONFIG_VFIO_PCI_ZDEV_KVM cannot be enabled, and the new VFIO ioctl feature cases in vfio_pci_core.c call static inline stubs returning -ENOTTY. Thus, the modified code is exclusive to the s390 architecture and structurally unreachable on amd64.",
"WorthFuzzing": false
}Results: {
"EnableConfigs": null,
"FocusSymbols": [],
"Reasoning": "The patch series implements support for zPCI Function Measurement Block (FMB) passthrough and management in VFIO and s390 PCI subsystems. All actual executable logic changes are located in arch/s390/ and drivers/vfio/pci/vfio_pci_zdev.c, which depends on CONFIG_VFIO_PCI_ZDEV_KVM (requiring S390 \u0026\u0026 KVM). On the target architecture (amd64), CONFIG_VFIO_PCI_ZDEV_KVM cannot be enabled, and the new VFIO ioctl feature cases in vfio_pci_core.c call static inline stubs returning -ENOTTY. Thus, the modified code is exclusive to the s390 architecture and structurally unreachable on amd64.",
"WorthFuzzing": false
} |
| 11/1 | 2026/09/25 03:27 | action | If |
0mArgs:{
"WorthFuzzing": false
}Results: null |
| Total Calls | Total Tokens | Avg Tokens | Total Duration (Seconds) | Avg Duration (Seconds) |
|---|
| Total Calls | Total Duration (Seconds) | Avg Duration (Seconds) |
|---|