| Seq | Timestamp | Type | Name | Duration |
|---|---|---|---|---|
| 0/0 | 2026/09/20 09:04 | flow | patch-triage |
0mArgs:null Results: {
"EnableConfigs": null,
"FocusSymbols": [],
"KMSANReasoning": "",
"NeedsKMSAN": false,
"Reasoning": "The patch exclusively modifies user-space KVM selftests under tools/testing/selftests/kvm/ and does not affect the compiled kernel image (vmlinux) or kernel modules.",
"WorthFuzzing": false
} |
| 1/1 | 2026/09/20 09:04 | action | read-patch-diff |
0mArgs:null Results: {
"PatchDiff": "commit f5bb7e749ef6cb8e3096f06e929b92c4c1ad8248\nAuthor: syz-cluster \u003ctriage@syzkaller.com\u003e\nDate: Sun Sep 20 09:04:29 2026 +0000\n\n syz-cluster: applied patch under review\n\ndiff --git a/tools/testing/selftests/kvm/Makefile.kvm b/tools/testing/selftests/kvm/Makefile.kvm\nindex 96bab7002d39e..d12c1c738956d 100644\n--- a/tools/testing/selftests/kvm/Makefile.kvm\n+++ b/tools/testing/selftests/kvm/Makefile.kvm\n@@ -6,7 +6,6 @@ all:\n LIBKVM += lib/assert.c\n LIBKVM += lib/elf.c\n LIBKVM += lib/guest_modes.c\n-LIBKVM += lib/io.c\n LIBKVM += lib/kvm_util.c\n LIBKVM += lib/lru_gen_util.c\n LIBKVM += lib/memstress.c\ndiff --git a/tools/testing/selftests/kvm/include/test_util.h b/tools/testing/selftests/kvm/include/test_util.h\nindex a6a3e16578959..e558346c3b697 100644\n--- a/tools/testing/selftests/kvm/include/test_util.h\n+++ b/tools/testing/selftests/kvm/include/test_util.h\n@@ -49,10 +49,6 @@ do {\t\t\t\t\t\t\t\t\\\n \n #define TEST_REQUIRE(f) __TEST_REQUIRE(f, \"Requirement not met: %s\", #f)\n \n-ssize_t test_write(int fd, const void *buf, size_t count);\n-ssize_t test_read(int fd, void *buf, size_t count);\n-int test_seq_read(const char *path, char **bufp, size_t *sizep);\n-\n void __printf(5, 6) test_assert(bool exp, const char *exp_str,\n \t\t\t\tconst char *file, unsigned int line,\n \t\t\t\tconst char *fmt, ...);\ndiff --git a/tools/testing/selftests/kvm/lib/elf.c b/tools/testing/selftests/kvm/lib/elf.c\nindex 1924a9895834c..d5adb68fd7c0c 100644\n--- a/tools/testing/selftests/kvm/lib/elf.c\n+++ b/tools/testing/selftests/kvm/lib/elf.c\n@@ -12,6 +12,44 @@\n \n #include \"kvm_util.h\"\n \n+static ssize_t elf_read(int fd, void *buf, size_t count)\n+{\n+\tssize_t rc;\n+\tssize_t num_read = 0;\n+\tsize_t num_left = count;\n+\tchar *ptr = buf;\n+\n+\tTEST_ASSERT(count, \"Count must be non-zero\");\n+\n+\tdo {\n+\t\trc = read(fd, ptr, num_left);\n+\n+\t\tswitch (rc) {\n+\t\tcase -1:\n+\t\t\tTEST_ASSERT(errno == EAGAIN || errno == EINTR,\n+\t\t\t\t \"Unexpected read failure,\\n\"\n+\t\t\t\t \" rc: %zi errno: %i\", rc, errno);\n+\t\t\tbreak;\n+\n+\t\tcase 0:\n+\t\t\tTEST_FAIL(\"Unexpected EOF,\\n\"\n+\t\t\t\t \" rc: %zi num_read: %zi num_left: %zu\",\n+\t\t\t\t rc, num_read, num_left);\n+\t\t\tbreak;\n+\n+\t\tdefault:\n+\t\t\tTEST_ASSERT(rc \u003e 0, \"Unexpected ret from read,\\n\"\n+\t\t\t\t \" rc: %zi errno: %i\", rc, errno);\n+\t\t\tnum_read += rc;\n+\t\t\tnum_left -= rc;\n+\t\t\tptr += rc;\n+\t\t\tbreak;\n+\t\t}\n+\t} while (num_read \u003c count);\n+\n+\treturn num_read;\n+}\n+\n static void elfhdr_get(const char *filename, Elf64_Ehdr *hdrp)\n {\n \toff_t offset_rv;\n@@ -31,7 +69,7 @@ static void elfhdr_get(const char *filename, Elf64_Ehdr *hdrp)\n \t * the real size of the ELF header.\n \t */\n \tunsigned char ident[EI_NIDENT];\n-\ttest_read(fd, ident, sizeof(ident));\n+\telf_read(fd, ident, sizeof(ident));\n \tTEST_ASSERT((ident[EI_MAG0] == ELFMAG0) \u0026\u0026 (ident[EI_MAG1] == ELFMAG1)\n \t\t\u0026\u0026 (ident[EI_MAG2] == ELFMAG2) \u0026\u0026 (ident[EI_MAG3] == ELFMAG3),\n \t\t\"ELF MAGIC Mismatch,\\n\"\n@@ -79,7 +117,7 @@ static void elfhdr_get(const char *filename, Elf64_Ehdr *hdrp)\n \toffset_rv = lseek(fd, 0, SEEK_SET);\n \tTEST_ASSERT(offset_rv == 0, \"Seek to ELF header failed,\\n\"\n \t\t\" rv: %zi expected: %i\", offset_rv, 0);\n-\ttest_read(fd, hdrp, sizeof(*hdrp));\n+\telf_read(fd, hdrp, sizeof(*hdrp));\n \tTEST_ASSERT(hdrp-\u003ee_phentsize == sizeof(Elf64_Phdr),\n \t\t\"Unexpected physical header size,\\n\"\n \t\t\" hdrp-\u003ee_phentsize: %x\\n\"\n@@ -146,7 +184,7 @@ void kvm_vm_elf_load(struct kvm_vm *vm, const char *filename)\n \n \t\t/* Read in the program header. */\n \t\tElf64_Phdr phdr;\n-\t\ttest_read(fd, \u0026phdr, sizeof(phdr));\n+\t\telf_read(fd, \u0026phdr, sizeof(phdr));\n \n \t\t/* Skip if this header doesn't describe a loadable segment. */\n \t\tif (phdr.p_type != PT_LOAD)\n@@ -186,8 +224,8 @@ void kvm_vm_elf_load(struct kvm_vm *vm, const char *filename)\n \t\t\t\t\" expected: 0x%jx\",\n \t\t\t\tn1, errno, (intmax_t) offset_rv,\n \t\t\t\t(intmax_t) phdr.p_offset);\n-\t\t\ttest_read(fd, addr_gva2hva(vm, phdr.p_vaddr),\n-\t\t\t\tphdr.p_filesz);\n+\t\t\telf_read(fd, addr_gva2hva(vm, phdr.p_vaddr),\n+\t\t\t\t phdr.p_filesz);\n \t\t}\n \t}\n \tclose(fd);\ndiff --git a/tools/testing/selftests/kvm/lib/io.c b/tools/testing/selftests/kvm/lib/io.c\ndeleted file mode 100644\nindex fedb2a741f0b1..0000000000000\n--- a/tools/testing/selftests/kvm/lib/io.c\n+++ /dev/null\n@@ -1,157 +0,0 @@\n-// SPDX-License-Identifier: GPL-2.0-only\n-/*\n- * tools/testing/selftests/kvm/lib/io.c\n- *\n- * Copyright (C) 2018, Google LLC.\n- */\n-\n-#include \"test_util.h\"\n-\n-/* Test Write\n- *\n- * A wrapper for write(2), that automatically handles the following\n- * special conditions:\n- *\n- * + Interrupted system call (EINTR)\n- * + Write of less than requested amount\n- * + Non-block return (EAGAIN)\n- *\n- * For each of the above, an additional write is performed to automatically\n- * continue writing the requested data.\n- * There are also many cases where write(2) can return an unexpected\n- * error (e.g. EIO). Such errors cause a TEST_ASSERT failure.\n- *\n- * Note, for function signature compatibility with write(2), this function\n- * returns the number of bytes written, but that value will always be equal\n- * to the number of requested bytes. All other conditions in this and\n- * future enhancements to this function either automatically issue another\n- * write(2) or cause a TEST_ASSERT failure.\n- *\n- * Args:\n- * fd - Opened file descriptor to file to be written.\n- * count - Number of bytes to write.\n- *\n- * Output:\n- * buf - Starting address of data to be written.\n- *\n- * Return:\n- * On success, number of bytes written.\n- * On failure, a TEST_ASSERT failure is caused.\n- */\n-ssize_t test_write(int fd, const void *buf, size_t count)\n-{\n-\tssize_t rc;\n-\tssize_t num_written = 0;\n-\tsize_t num_left = count;\n-\tconst char *ptr = buf;\n-\n-\t/* Note: Count of zero is allowed (see \"RETURN VALUE\" portion of\n-\t * write(2) manpage for details.\n-\t */\n-\tTEST_ASSERT(count \u003e= 0, \"Unexpected count, count: %li\", count);\n-\n-\tdo {\n-\t\trc = write(fd, ptr, num_left);\n-\n-\t\tswitch (rc) {\n-\t\tcase -1:\n-\t\t\tTEST_ASSERT(errno == EAGAIN || errno == EINTR,\n-\t\t\t\t \"Unexpected write failure,\\n\"\n-\t\t\t\t \" rc: %zi errno: %i\", rc, errno);\n-\t\t\tcontinue;\n-\n-\t\tcase 0:\n-\t\t\tTEST_FAIL(\"Unexpected EOF,\\n\"\n-\t\t\t\t \" rc: %zi num_written: %zi num_left: %zu\",\n-\t\t\t\t rc, num_written, num_left);\n-\t\t\tbreak;\n-\n-\t\tdefault:\n-\t\t\tTEST_ASSERT(rc \u003e= 0, \"Unexpected ret from write,\\n\"\n-\t\t\t\t\" rc: %zi errno: %i\", rc, errno);\n-\t\t\tnum_written += rc;\n-\t\t\tnum_left -= rc;\n-\t\t\tptr += rc;\n-\t\t\tbreak;\n-\t\t}\n-\t} while (num_written \u003c count);\n-\n-\treturn num_written;\n-}\n-\n-/* Test Read\n- *\n- * A wrapper for read(2), that automatically handles the following\n- * special conditions:\n- *\n- * + Interrupted system call (EINTR)\n- * + Read of less than requested amount\n- * + Non-block return (EAGAIN)\n- *\n- * For each of the above, an additional read is performed to automatically\n- * continue reading the requested data.\n- * There are also many cases where read(2) can return an unexpected\n- * error (e.g. EIO). Such errors cause a TEST_ASSERT failure. Note,\n- * it is expected that the file opened by fd at the current file position\n- * contains at least the number of requested bytes to be read. A TEST_ASSERT\n- * failure is produced if an End-Of-File condition occurs, before all the\n- * data is read. It is the callers responsibility to assure that sufficient\n- * data exists.\n- *\n- * Note, for function signature compatibility with read(2), this function\n- * returns the number of bytes read, but that value will always be equal\n- * to the number of requested bytes. All other conditions in this and\n- * future enhancements to this function either automatically issue another\n- * read(2) or cause a TEST_ASSERT failure.\n- *\n- * Args:\n- * fd - Opened file descriptor to file to be read.\n- * count - Number of bytes to read.\n- *\n- * Output:\n- * buf - Starting address of where to write the bytes read.\n- *\n- * Return:\n- * On success, number of bytes read.\n- * On failure, a TEST_ASSERT failure is caused.\n- */\n-ssize_t test_read(int fd, void *buf, size_t count)\n-{\n-\tssize_t rc;\n-\tssize_t num_read = 0;\n-\tsize_t num_left = count;\n-\tchar *ptr = buf;\n-\n-\t/* Note: Count of zero is allowed (see \"If count is zero\" portion of\n-\t * read(2) manpage for details.\n-\t */\n-\tTEST_ASSERT(count \u003e= 0, \"Unexpected count, count: %li\", count);\n-\n-\tdo {\n-\t\trc = read(fd, ptr, num_left);\n-\n-\t\tswitch (rc) {\n-\t\tcase -1:\n-\t\t\tTEST_ASSERT(errno == EAGAIN || errno == EINTR,\n-\t\t\t\t \"Unexpected read failure,\\n\"\n-\t\t\t\t \" rc: %zi errno: %i\", rc, errno);\n-\t\t\tbreak;\n-\n-\t\tcase 0:\n-\t\t\tTEST_FAIL(\"Unexpected EOF,\\n\"\n-\t\t\t\t \" rc: %zi num_read: %zi num_left: %zu\",\n-\t\t\t\t rc, num_read, num_left);\n-\t\t\tbreak;\n-\n-\t\tdefault:\n-\t\t\tTEST_ASSERT(rc \u003e 0, \"Unexpected ret from read,\\n\"\n-\t\t\t\t \" rc: %zi errno: %i\", rc, errno);\n-\t\t\tnum_read += rc;\n-\t\t\tnum_left -= rc;\n-\t\t\tptr += rc;\n-\t\t\tbreak;\n-\t\t}\n-\t} while (num_read \u003c count);\n-\n-\treturn num_read;\n-}\n"
} |
| 2/1 | 2026/09/20 09:04 | agent | patch-evaluator |
0mModel:core Args: null Results: {
"EnableConfigs": null,
"FocusSymbols": [],
"Reasoning": "The patch exclusively modifies user-space KVM selftests under tools/testing/selftests/kvm/ and does not affect the compiled kernel image (vmlinux) or kernel modules.",
"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 f5bb7e749ef6cb8e3096f06e929b92c4c1ad8248
Author: syz-cluster <triage@syzkaller.com>
Date: Sun Sep 20 09:04:29 2026 +0000
syz-cluster: applied patch under review
diff --git a/tools/testing/selftests/kvm/Makefile.kvm b/tools/testing/selftests/kvm/Makefile.kvm
index 96bab7002d39e..d12c1c738956d 100644
--- a/tools/testing/selftests/kvm/Makefile.kvm
+++ b/tools/testing/selftests/kvm/Makefile.kvm
@@ -6,7 +6,6 @@ all:
LIBKVM += lib/assert.c
LIBKVM += lib/elf.c
LIBKVM += lib/guest_modes.c
-LIBKVM += lib/io.c
LIBKVM += lib/kvm_util.c
LIBKVM += lib/lru_gen_util.c
LIBKVM += lib/memstress.c
diff --git a/tools/testing/selftests/kvm/include/test_util.h b/tools/testing/selftests/kvm/include/test_util.h
index a6a3e16578959..e558346c3b697 100644
--- a/tools/testing/selftests/kvm/include/test_util.h
+++ b/tools/testing/selftests/kvm/include/test_util.h
@@ -49,10 +49,6 @@ do { \
#define TEST_REQUIRE(f) __TEST_REQUIRE(f, "Requirement not met: %s", #f)
-ssize_t test_write(int fd, const void *buf, size_t count);
-ssize_t test_read(int fd, void *buf, size_t count);
-int test_seq_read(const char *path, char **bufp, size_t *sizep);
-
void __printf(5, 6) test_assert(bool exp, const char *exp_str,
const char *file, unsigned int line,
const char *fmt, ...);
diff --git a/tools/testing/selftests/kvm/lib/elf.c b/tools/testing/selftests/kvm/lib/elf.c
index 1924a9895834c..d5adb68fd7c0c 100644
--- a/tools/testing/selftests/kvm/lib/elf.c
+++ b/tools/testing/selftests/kvm/lib/elf.c
@@ -12,6 +12,44 @@
#include "kvm_util.h"
+static ssize_t elf_read(int fd, void *buf, size_t count)
+{
+ ssize_t rc;
+ ssize_t num_read = 0;
+ size_t num_left = count;
+ char *ptr = buf;
+
+ TEST_ASSERT(count, "Count must be non-zero");
+
+ do {
+ rc = read(fd, ptr, num_left);
+
+ switch (rc) {
+ case -1:
+ TEST_ASSERT(errno == EAGAIN || errno == EINTR,
+ "Unexpected read failure,\n"
+ " rc: %zi errno: %i", rc, errno);
+ break;
+
+ case 0:
+ TEST_FAIL("Unexpected EOF,\n"
+ " rc: %zi num_read: %zi num_left: %zu",
+ rc, num_read, num_left);
+ break;
+
+ default:
+ TEST_ASSERT(rc > 0, "Unexpected ret from read,\n"
+ " rc: %zi errno: %i", rc, errno);
+ num_read += rc;
+ num_left -= rc;
+ ptr += rc;
+ break;
+ }
+ } while (num_read < count);
+
+ return num_read;
+}
+
static void elfhdr_get(const char *filename, Elf64_Ehdr *hdrp)
{
off_t offset_rv;
@@ -31,7 +69,7 @@ static void elfhdr_get(const char *filename, Elf64_Ehdr *hdrp)
* the real size of the ELF header.
*/
unsigned char ident[EI_NIDENT];
- test_read(fd, ident, sizeof(ident));
+ elf_read(fd, ident, sizeof(ident));
TEST_ASSERT((ident[EI_MAG0] == ELFMAG0) && (ident[EI_MAG1] == ELFMAG1)
&& (ident[EI_MAG2] == ELFMAG2) && (ident[EI_MAG3] == ELFMAG3),
"ELF MAGIC Mismatch,\n"
@@ -79,7 +117,7 @@ static void elfhdr_get(const char *filename, Elf64_Ehdr *hdrp)
offset_rv = lseek(fd, 0, SEEK_SET);
TEST_ASSERT(offset_rv == 0, "Seek to ELF header failed,\n"
" rv: %zi expected: %i", offset_rv, 0);
- test_read(fd, hdrp, sizeof(*hdrp));
+ elf_read(fd, hdrp, sizeof(*hdrp));
TEST_ASSERT(hdrp->e_phentsize == sizeof(Elf64_Phdr),
"Unexpected physical header size,\n"
" hdrp->e_phentsize: %x\n"
@@ -146,7 +184,7 @@ void kvm_vm_elf_load(struct kvm_vm *vm, const char *filename)
/* Read in the program header. */
Elf64_Phdr phdr;
- test_read(fd, &phdr, sizeof(phdr));
+ elf_read(fd, &phdr, sizeof(phdr));
/* Skip if this header doesn't describe a loadable segment. */
if (phdr.p_type != PT_LOAD)
@@ -186,8 +224,8 @@ void kvm_vm_elf_load(struct kvm_vm *vm, const char *filename)
" expected: 0x%jx",
n1, errno, (intmax_t) offset_rv,
(intmax_t) phdr.p_offset);
- test_read(fd, addr_gva2hva(vm, phdr.p_vaddr),
- phdr.p_filesz);
+ elf_read(fd, addr_gva2hva(vm, phdr.p_vaddr),
+ phdr.p_filesz);
}
}
close(fd);
diff --git a/tools/testing/selftests/kvm/lib/io.c b/tools/testing/selftests/kvm/lib/io.c
deleted file mode 100644
index fedb2a741f0b1..0000000000000
--- a/tools/testing/selftests/kvm/lib/io.c
+++ /dev/null
@@ -1,157 +0,0 @@
-// SPDX-License-Identifier: GPL-2.0-only
-/*
- * tools/testing/selftests/kvm/lib/io.c
- *
- * Copyright (C) 2018, Google LLC.
- */
-
-#include "test_util.h"
-
-/* Test Write
- *
- * A wrapper for write(2), that automatically handles the following
- * special conditions:
- *
- * + Interrupted system call (EINTR)
- * + Write of less than requested amount
- * + Non-block return (EAGAIN)
- *
- * For each of the above, an additional write is performed to automatically
- * continue writing the requested data.
- * There are also many cases where write(2) can return an unexpected
- * error (e.g. EIO). Such errors cause a TEST_ASSERT failure.
- *
- * Note, for function signature compatibility with write(2), this function
- * returns the number of bytes written, but that value will always be equal
- * to the number of requested bytes. All other conditions in this and
- * future enhancements to this function either automatically issue another
- * write(2) or cause a TEST_ASSERT failure.
- *
- * Args:
- * fd - Opened file descriptor to file to be written.
- * count - Number of bytes to write.
- *
- * Output:
- * buf - Starting address of data to be written.
- *
- * Return:
- * On success, number of bytes written.
- * On failure, a TEST_ASSERT failure is caused.
- */
-ssize_t test_write(int fd, const void *buf, size_t count)
-{
- ssize_t rc;
- ssize_t num_written = 0;
- size_t num_left = count;
- const char *ptr = buf;
-
- /* Note: Count of zero is allowed (see "RETURN VALUE" portion of
- * write(2) manpage for details.
- */
- TEST_ASSERT(count >= 0, "Unexpected count, count: %li", count);
-
- do {
- rc = write(fd, ptr, num_left);
-
- switch (rc) {
- case -1:
- TEST_ASSERT(errno == EAGAIN || errno == EINTR,
- "Unexpected write failure,\n"
- " rc: %zi errno: %i", rc, errno);
- continue;
-
- case 0:
- TEST_FAIL("Unexpected EOF,\n"
- " rc: %zi num_written: %zi num_left: %zu",
- rc, num_written, num_left);
- break;
-
- default:
- TEST_ASSERT(rc >= 0, "Unexpected ret from write,\n"
- " rc: %zi errno: %i", rc, errno);
- num_written += rc;
- num_left -= rc;
- ptr += rc;
- break;
- }
- } while (num_written < count);
-
- return num_written;
-}
-
-/* Test Read
- *
- * A wrapper for read(2), that automatically handles the following
- * special conditions:
- *
- * + Interrupted system call (EINTR)
- * + Read of less than requested amount
- * + Non-block return (EAGAIN)
- *
- * For each of the above, an additional read is performed to automatically
- * continue reading the requested data.
- * There are also many cases where read(2) can return an unexpected
- * error (e.g. EIO). Such errors cause a TEST_ASSERT failure. Note,
- * it is expected that the file opened by fd at the current file position
- * contains at least the number of requested bytes to be read. A TEST_ASSERT
- * failure is produced if an End-Of-File condition occurs, before all the
- * data is read. It is the callers responsibility to assure that sufficient
- * data exists.
- *
- * Note, for function signature compatibility with read(2), this function
- * returns the number of bytes read, but that value will always be equal
- * to the number of requested bytes. All other conditions in this and
- * future enhancements to this function either automatically issue another
- * read(2) or cause a TEST_ASSERT failure.
- *
- * Args:
- * fd - Opened file descriptor to file to be read.
- * count - Number of bytes to read.
- *
- * Output:
- * buf - Starting address of where to write the bytes read.
- *
- * Return:
- * On success, number of bytes read.
- * On failure, a TEST_ASSERT failure is caused.
- */
-ssize_t test_read(int fd, void *buf, size_t count)
-{
- ssize_t rc;
- ssize_t num_read = 0;
- size_t num_left = count;
- char *ptr = buf;
-
- /* Note: Count of zero is allowed (see "If count is zero" portion of
- * read(2) manpage for details.
- */
- TEST_ASSERT(count >= 0, "Unexpected count, count: %li", count);
-
- do {
- rc = read(fd, ptr, num_left);
-
- switch (rc) {
- case -1:
- TEST_ASSERT(errno == EAGAIN || errno == EINTR,
- "Unexpected read failure,\n"
- " rc: %zi errno: %i", rc, errno);
- break;
-
- case 0:
- TEST_FAIL("Unexpected EOF,\n"
- " rc: %zi num_read: %zi num_left: %zu",
- rc, num_read, num_left);
- break;
-
- default:
- TEST_ASSERT(rc > 0, "Unexpected ret from read,\n"
- " rc: %zi errno: %i", rc, errno);
- num_read += rc;
- num_left -= rc;
- ptr += rc;
- break;
- }
- } while (num_read < count);
-
- return num_read;
-}
|
| 3/2 | 2026/09/20 09:04 | llm | patch-evaluator |
0mModel:gemini-3.8-flash Args: null Results: null Tokens: input: 6030 output: 72 thoughts: 530 Thoughts: **Reviewing the Patch Series for Fuzzing Eligibility** Okay, here's what I'm thinking. This patch series is touching files in `tools/testing/selftests/kvm/`. Let me quickly confirm this: it's hitting `Makefile.kvm`, `include/test_util.h`, `lib/elf.c`, and `lib/io.c` all within that same directory. Given my understanding of fuzzing eligibility, I need to check the criteria. The guideline clearly states when to set `WorthFuzzing` to `false`. Essentially, this happens when the modifications are in non-kernel, non-executable areas. Right, so I recall that self-tests, samples, and scripts *specifically* in user-space directories, like `tools/`, fall into this "no fuzzing" category *if* they don't impact the kernel image (`vmlinux`) or any kernel modules. Looking at the directory, `tools/testing/selftests/kvm/` absolutely screams "user-space self-tests" to me. I'm pretty confident in saying these changes will not affect the kernel image or modules. I can also re-check that list. And just to be super sure, let's re-run the `git diff` and confirm those are the only files modified and I'm right: `Makefile.kvm`, `include/test_util.h`, `lib/elf.c`, and `lib/io.c` all under `tools/testing/selftests/`. Yep, all good. Based on that, it's a definite `WorthFuzzing = false`. I also need to populate the rest of the `set-results` data structure: `FocusSymbols = []`, and `EnableConfigs = []`. The Reasoning is going to be a concise explanation, along the lines of the files being under `tools/testing/selftests/`, and thus, not affecting the kernel image. |
| 4/2 | 2026/09/20 09:04 | tool | set-results |
0mArgs:{
"EnableConfigs": [],
"FocusSymbols": [],
"Reasoning": "The patch exclusively modifies user-space KVM selftests under tools/testing/selftests/kvm/ and does not affect the compiled kernel image (vmlinux) or kernel modules.",
"WorthFuzzing": false
}Results: {
"EnableConfigs": null,
"FocusSymbols": [],
"Reasoning": "The patch exclusively modifies user-space KVM selftests under tools/testing/selftests/kvm/ and does not affect the compiled kernel image (vmlinux) or kernel modules.",
"WorthFuzzing": false
} |
| 5/1 | 2026/09/20 09:04 | 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) |
|---|