| Seq | Timestamp | Type | Name | Duration |
|---|---|---|---|---|
| 0/0 | 2026/10/06 07:07 | flow | patch-triage |
0mArgs:null Results: {
"EnableConfigs": null,
"FocusSymbols": [],
"KMSANReasoning": "",
"NeedsKMSAN": false,
"Reasoning": "The patch only modifies user-space selftests under tools/testing/selftests/mm/ and does not touch any kernel code or affect the compiled kernel image (vmlinux).",
"WorthFuzzing": false
} |
| 1/1 | 2026/10/06 07:07 | action | read-patch-diff |
0mArgs:null Results: {
"PatchDiff": "commit 0ea009c62340aa892868cfe73114ac0980fc6561\nAuthor: syz-cluster \u003ctriage@syzkaller.com\u003e\nDate: Tue Oct 6 07:07:08 2026 +0000\n\n syz-cluster: applied patch under review\n\ndiff --git a/tools/testing/selftests/mm/mremap_dontunmap.c b/tools/testing/selftests/mm/mremap_dontunmap.c\nindex 96ba537facf7e..5ca33d9d42afa 100644\n--- a/tools/testing/selftests/mm/mremap_dontunmap.c\n+++ b/tools/testing/selftests/mm/mremap_dontunmap.c\n@@ -7,6 +7,7 @@\n */\n #define _GNU_SOURCE\n #include \u003csys/mman.h\u003e\n+#include \u003csys/syscall.h\u003e\n #include \u003clinux/mman.h\u003e\n #include \u003cerrno.h\u003e\n #include \u003cstdio.h\u003e\n@@ -15,6 +16,7 @@\n #include \u003cunistd.h\u003e\n \n #include \"kselftest.h\"\n+#include \"vm_util.h\"\n \n unsigned long page_size;\n char *page_buffer;\n@@ -335,6 +337,62 @@ static void mremap_dontunmap_partial_mapping_overwrite(void)\n \tksft_test_result_pass(\"%s\\n\", __func__);\n }\n \n+/* VmLck from /proc/self/status, which is mm-\u003elocked_vm in kB. */\n+static unsigned long locked_vm_kb(void)\n+{\n+\tunsigned long kb;\n+\tchar buf[256];\n+\tFILE *fp;\n+\n+\tfp = fopen(\"/proc/self/status\", \"r\");\n+\tBUG_ON(!fp, \"unable to open /proc/self/status\");\n+\tBUG_ON(!check_for_pattern(fp, \"VmLck:\", buf, sizeof(buf)) ||\n+\t sscanf(buf, \"VmLck: %lu kB\", \u0026kb) != 1, \"unable to read VmLck\");\n+\tfclose(fp);\n+\n+\treturn kb;\n+}\n+\n+/*\n+ * MREMAP_DONTUNMAP clears the mlock flags of the source VMA and sets them on\n+ * the destination, and mm-\u003elocked_vm has to follow. mlock2() a source of\n+ * num_pages and move its first move_pages to gap pages past its end:\n+ *\n+ * |------ source ------|... gap ...|-- dest --|\n+ *\n+ * then unmap everything and check that VmLck is back where it started. With\n+ * no gap the destination is adjacent to the source and could merge with it,\n+ * otherwise the gap is left PROT_NONE so that it cannot.\n+ */\n+static void mremap_dontunmap_mlock(const char *desc, unsigned long num_pages,\n+\t\t\t\t unsigned long move_pages, unsigned long gap,\n+\t\t\t\t int mlock_flags)\n+{\n+\tunsigned long size = (num_pages + gap + move_pages) * page_size;\n+\tunsigned long locked = locked_vm_kb();\n+\tvoid *source, *dest;\n+\n+\tsource = mmap(NULL, size, PROT_NONE, MAP_PRIVATE | MAP_ANONYMOUS, -1, 0);\n+\tBUG_ON(source == MAP_FAILED, \"mmap\");\n+\tBUG_ON(mprotect(source, num_pages * page_size,\n+\t\t\tPROT_READ | PROT_WRITE) == -1, \"mprotect\");\n+\tdest = source + (num_pages + gap) * page_size;\n+\n+\tif (syscall(__NR_mlock2, source, num_pages * page_size, mlock_flags)) {\n+\t\tksft_test_result_skip(\"%s: %s: mlock2: %s\\n\", __func__, desc,\n+\t\t\t\t strerror(errno));\n+\t\tBUG_ON(munmap(source, size) == -1, \"unable to unmap mappings\");\n+\t\treturn;\n+\t}\n+\n+\tBUG_ON(mremap(source, move_pages * page_size, move_pages * page_size,\n+\t\t MREMAP_DONTUNMAP | MREMAP_MAYMOVE | MREMAP_FIXED,\n+\t\t dest) != dest, \"mremap\");\n+\n+\tBUG_ON(munmap(source, size) == -1, \"unable to unmap mappings\");\n+\tksft_test_result(locked_vm_kb() == locked, \"%s: %s\\n\", __func__, desc);\n+}\n+\n int main(void)\n {\n \tksft_print_header();\n@@ -348,7 +406,7 @@ int main(void)\n \t\tksft_finished();\n \t}\n \n-\tksft_set_plan(5);\n+\tksft_set_plan(8);\n \n \t// Keep a page sized buffer around for when we need it.\n \tpage_buffer =\n@@ -361,6 +419,9 @@ int main(void)\n \tmremap_dontunmap_simple_fixed();\n \tmremap_dontunmap_partial_mapping();\n \tmremap_dontunmap_partial_mapping_overwrite();\n+\tmremap_dontunmap_mlock(\"onfault self-merge\", 1, 1, 0, MLOCK_ONFAULT);\n+\tmremap_dontunmap_mlock(\"partial\", 3, 2, 1, 0);\n+\tmremap_dontunmap_mlock(\"onfault partial\", 3, 2, 1, MLOCK_ONFAULT);\n \n \tBUG_ON(munmap(page_buffer, page_size) == -1,\n \t \"unable to unmap page buffer\");\n"
} |
| 2/1 | 2026/10/06 07:07 | agent | patch-evaluator |
0mModel:core Args: null Results: {
"EnableConfigs": null,
"FocusSymbols": [],
"Reasoning": "The patch only modifies user-space selftests under tools/testing/selftests/mm/ and does not touch any kernel code or affect the compiled kernel image (vmlinux).",
"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 0ea009c62340aa892868cfe73114ac0980fc6561
Author: syz-cluster <triage@syzkaller.com>
Date: Tue Oct 6 07:07:08 2026 +0000
syz-cluster: applied patch under review
diff --git a/tools/testing/selftests/mm/mremap_dontunmap.c b/tools/testing/selftests/mm/mremap_dontunmap.c
index 96ba537facf7e..5ca33d9d42afa 100644
--- a/tools/testing/selftests/mm/mremap_dontunmap.c
+++ b/tools/testing/selftests/mm/mremap_dontunmap.c
@@ -7,6 +7,7 @@
*/
#define _GNU_SOURCE
#include <sys/mman.h>
+#include <sys/syscall.h>
#include <linux/mman.h>
#include <errno.h>
#include <stdio.h>
@@ -15,6 +16,7 @@
#include <unistd.h>
#include "kselftest.h"
+#include "vm_util.h"
unsigned long page_size;
char *page_buffer;
@@ -335,6 +337,62 @@ static void mremap_dontunmap_partial_mapping_overwrite(void)
ksft_test_result_pass("%s\n", __func__);
}
+/* VmLck from /proc/self/status, which is mm->locked_vm in kB. */
+static unsigned long locked_vm_kb(void)
+{
+ unsigned long kb;
+ char buf[256];
+ FILE *fp;
+
+ fp = fopen("/proc/self/status", "r");
+ BUG_ON(!fp, "unable to open /proc/self/status");
+ BUG_ON(!check_for_pattern(fp, "VmLck:", buf, sizeof(buf)) ||
+ sscanf(buf, "VmLck: %lu kB", &kb) != 1, "unable to read VmLck");
+ fclose(fp);
+
+ return kb;
+}
+
+/*
+ * MREMAP_DONTUNMAP clears the mlock flags of the source VMA and sets them on
+ * the destination, and mm->locked_vm has to follow. mlock2() a source of
+ * num_pages and move its first move_pages to gap pages past its end:
+ *
+ * |------ source ------|... gap ...|-- dest --|
+ *
+ * then unmap everything and check that VmLck is back where it started. With
+ * no gap the destination is adjacent to the source and could merge with it,
+ * otherwise the gap is left PROT_NONE so that it cannot.
+ */
+static void mremap_dontunmap_mlock(const char *desc, unsigned long num_pages,
+ unsigned long move_pages, unsigned long gap,
+ int mlock_flags)
+{
+ unsigned long size = (num_pages + gap + move_pages) * page_size;
+ unsigned long locked = locked_vm_kb();
+ void *source, *dest;
+
+ source = mmap(NULL, size, PROT_NONE, MAP_PRIVATE | MAP_ANONYMOUS, -1, 0);
+ BUG_ON(source == MAP_FAILED, "mmap");
+ BUG_ON(mprotect(source, num_pages * page_size,
+ PROT_READ | PROT_WRITE) == -1, "mprotect");
+ dest = source + (num_pages + gap) * page_size;
+
+ if (syscall(__NR_mlock2, source, num_pages * page_size, mlock_flags)) {
+ ksft_test_result_skip("%s: %s: mlock2: %s\n", __func__, desc,
+ strerror(errno));
+ BUG_ON(munmap(source, size) == -1, "unable to unmap mappings");
+ return;
+ }
+
+ BUG_ON(mremap(source, move_pages * page_size, move_pages * page_size,
+ MREMAP_DONTUNMAP | MREMAP_MAYMOVE | MREMAP_FIXED,
+ dest) != dest, "mremap");
+
+ BUG_ON(munmap(source, size) == -1, "unable to unmap mappings");
+ ksft_test_result(locked_vm_kb() == locked, "%s: %s\n", __func__, desc);
+}
+
int main(void)
{
ksft_print_header();
@@ -348,7 +406,7 @@ int main(void)
ksft_finished();
}
- ksft_set_plan(5);
+ ksft_set_plan(8);
// Keep a page sized buffer around for when we need it.
page_buffer =
@@ -361,6 +419,9 @@ int main(void)
mremap_dontunmap_simple_fixed();
mremap_dontunmap_partial_mapping();
mremap_dontunmap_partial_mapping_overwrite();
+ mremap_dontunmap_mlock("onfault self-merge", 1, 1, 0, MLOCK_ONFAULT);
+ mremap_dontunmap_mlock("partial", 3, 2, 1, 0);
+ mremap_dontunmap_mlock("onfault partial", 3, 2, 1, MLOCK_ONFAULT);
BUG_ON(munmap(page_buffer, page_size) == -1,
"unable to unmap page buffer");
|
| 3/2 | 2026/10/06 07:07 | llm | patch-evaluator |
0mModel:gemini-3.8-flash Args: null Results: null Tokens: input: 4191 output: 70 thoughts: 669 Thoughts: **Analyzing the Patch: WorthFuzzing Evaluation**
Okay, let's break this down. We have a patch impacting `tools/testing/selftests/mm/mremap_dontunmap.c`. That's the only file modified, which immediately triggers a specific set of checks in my internal rule engine.
I'm focusing on the "WHEN TO RETURN WorthFuzzing=false" rules, specifically the negative criteria. My understanding is, based on experience, that patches need to modify kernel code to be worth fuzzing. I need to make sure this modification *isn't* kernel code. Let me check the rules.
The relevant rule says that if the changes are limited to "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," then `WorthFuzzing` should be `false`.
Now, I need to confirm: Is this patch only affecting this user-space selftest? The patch details confirm:
```
commit 0ea009c62340aa892868cfe73114ac0980fc6561
Author: syz-cluster <triage@syzkaller.com>
Date: Tue Oct 6 07:07:08 2026 +0000
syz-cluster: applied patch under review
diff --git a/tools/testing/selftests/mm/mremap_dontunmap.c b/tools/testing/selftests/mm/mremap_dontunmap.c
...
```
I can confirm that the patch only affects `tools/testing/selftests/mm/mremap_dontunmap.c`.
It's clear that it falls *precisely* within the "Non-kernel and non-executable changes" category. This is a user-space selftest, residing in the `tools/` directory, and it's not touching any code that would affect the kernel image or modules. I need to set:
* `WorthFuzzing = false`
* `FocusSymbols = []`
* `EnableConfigs = []`
My reasoning is straightforward: the patch is limited to modifying a user-space selftest in `tools/testing/selftests/mm/mremap_dontunmap.c` and does not impact the compiled kernel image (`vmlinux`) or kernel modules. Time to call `set-results`.
|
| 4/2 | 2026/10/06 07:07 | tool | set-results |
0mArgs:{
"EnableConfigs": [],
"FocusSymbols": [],
"Reasoning": "The patch only modifies user-space selftests under tools/testing/selftests/mm/ and does not touch any kernel code or affect the compiled kernel image (vmlinux).",
"WorthFuzzing": false
}Results: {
"EnableConfigs": null,
"FocusSymbols": [],
"Reasoning": "The patch only modifies user-space selftests under tools/testing/selftests/mm/ and does not touch any kernel code or affect the compiled kernel image (vmlinux).",
"WorthFuzzing": false
} |
| 5/1 | 2026/10/06 07:07 | 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) |
|---|