| Seq | Timestamp | Type | Name | Duration |
|---|---|---|---|---|
| 0/0 | 2026/09/22 21:53 | flow | patch-triage |
1mArgs:null Results: {
"EnableConfigs": [
"USB"
],
"FocusSymbols": [
"usb_disable_endpoint",
"usb_disable_interface",
"usb_enable_endpoint",
"usb_set_interface",
"usb_set_configuration"
],
"KMSANReasoning": "The patch modifies `usb_disable_endpoint()` in `drivers/usb/core/message.c` to ensure that both `dev-\u003eep_out[epnum]` and `dev-\u003eep_in[epnum]` pointers are cleared (set to `NULL`) when disabling a non-ep0 bidirectional control endpoint with `reset_hardware` set. Previously, only the pointer corresponding to the direction specified in `epaddr` was cleared, leaving a dangling pointer in the opposite direction that could lead to use-after-free (UAF) or stale pointer dereference bugs.\n\nSuch memory safety issues (dangling pointers and use-after-free) are detected by standard KASAN. The patch does not introduce any stack or heap allocations, does not expose uninitialized structure padding or data to userspace, does not modify any bounds/length logic operating on uninitialized buffers, and does not branch on uninitialized variables. Therefore, a dedicated KMSAN fuzzing session is not warranted.",
"NeedsKMSAN": false,
"Reasoning": "The patch modifies usb_disable_endpoint() in drivers/usb/core/message.c to ensure both ep_in and ep_out endpoint pointers are cleared when disabling non-ep0 bidirectional control endpoints. This logic is fully reachable in standard QEMU/virtualized environments through USB device emulation (e.g. Raw Gadget, Dummy HCD) and usbfs ioctls when configuring or resetting interfaces/endpoints.",
"WorthFuzzing": true
} |
| 1/1 | 2026/09/22 21:53 | action | read-patch-diff |
0mArgs:null Results: {
"PatchDiff": "commit 621cd55728c60e2c11e7f94b273484f0e5bd8d08\nAuthor: syz-cluster \u003ctriage@syzkaller.com\u003e\nDate: Tue Sep 22 21:53:29 2026 +0000\n\n syz-cluster: applied patch under review\n\ndiff --git a/drivers/usb/core/message.c b/drivers/usb/core/message.c\nindex 75e2bfd744a98..0cd6dd2b6334b 100644\n--- a/drivers/usb/core/message.c\n+++ b/drivers/usb/core/message.c\n@@ -1337,7 +1337,8 @@ static void remove_intf_ep_devs(struct usb_interface *intf)\n *\n * Disables the endpoint for URB submission and nukes all pending URBs.\n * If @reset_hardware is set then also deallocates hcd/hardware state\n- * for the endpoint.\n+ * for the endpoint (clearing both ep_in and ep_out pointers for\n+ * bidirectional non-ep0 control endpoints).\n */\n void usb_disable_endpoint(struct usb_device *dev, unsigned int epaddr,\n \t\tbool reset_hardware)\n@@ -1358,6 +1359,11 @@ void usb_disable_endpoint(struct usb_device *dev, unsigned int epaddr,\n \t\t\tdev-\u003eep_in[epnum] = NULL;\n \t}\n \tif (ep) {\n+\t\tif (reset_hardware \u0026\u0026 epnum != 0 \u0026\u0026\n+\t\t usb_endpoint_xfer_control(\u0026ep-\u003edesc)) {\n+\t\t\tdev-\u003eep_out[epnum] = NULL;\n+\t\t\tdev-\u003eep_in[epnum] = NULL;\n+\t\t}\n \t\tep-\u003eenabled = 0;\n \t\tusb_hcd_flush_endpoint(dev, ep);\n \t\tif (reset_hardware)\n"
} |
| 2/1 | 2026/09/22 21:53 | agent | patch-evaluator |
1mModel:core Args: null Results: {
"EnableConfigs": [
"USB"
],
"FocusSymbols": [
"usb_disable_endpoint",
"usb_disable_interface",
"usb_enable_endpoint",
"usb_set_interface",
"usb_set_configuration"
],
"Reasoning": "The patch modifies usb_disable_endpoint() in drivers/usb/core/message.c to ensure both ep_in and ep_out endpoint pointers are cleared when disabling non-ep0 bidirectional control endpoints. This logic is fully reachable in standard QEMU/virtualized environments through USB device emulation (e.g. Raw Gadget, Dummy HCD) and usbfs ioctls when configuring or resetting interfaces/endpoints.",
"WorthFuzzing": true
}Instruction: You are an expert Linux kernel maintainer and security engineer.
Your job is to review a provided patch series and evaluate whether it warrants fuzzing with syzkaller.
IMPORTANT: The changes have ALREADY been applied and committed as the HEAD commit in
your workspace. Do NOT rely on internal assumptions. You must actively use your code access
tools to inspect the actual source code, callers, and surrounding context.
================================================================================
1. CORE TRIAGE PHILOSOPHY
================================================================================
The goal of patch fuzzing is to discover crashes, regressions, exposed latent bugs,
and newly triggered assertions introduced by the patch series.
- REACHABILITY IS THE PRIMARY GATE:
Fuzzing can only discover bugs in code that can actually execute in standard virtualized
environments (GCE or QEMU, utilizing software-emulated devices like USB gadgets, netdev, tun/tap).
If the modified code is structurally unreachable (see Section 2), it MUST NOT be fuzzed,
regardless of whether it adds assertions or complex logic.
- DO NOT BLINDLY TRUST "NO FUNCTIONAL CHANGE" (NFCI) OR "REFACTORING" CLAIMS:
Patch authors routinely label changes as "cleanups", "refactorings", or state
"No functional change intended". Do NOT take these claims at face value.
Code refactorings that rearrange logic, introduce helper functions, or alter state management
in core subsystems frequently introduce subtle semantic shifts or uncover latent kernel bugs.
If reachable executable code is modified or refactored, it MUST be fuzzed.
- NEW OR MODIFIED ASSERTIONS IN REACHABLE CODE MUST BE FUZZED:
When a patch introduces or modifies runtime checks or assertions (e.g., WARN_ON*, VM_WARN_ON*,
BUG_ON*, lockdep_assert*) in reachable code paths, it enforces new or stricter invariants.
Even if the author believes the invariant always holds, fuzzing is essential to verify whether
an unusual sequence of operations can violate it.
================================================================================
2. WHEN TO RETURN WorthFuzzing=false (NEGATIVE CRITERIA)
================================================================================
Return WorthFuzzing=false ONLY IF all modified code falls strictly into one or more of these categories:
- Non-kernel and non-executable changes:
* Modifications to Documentation/, comments, or spelling fixes.
* User-space directories, self-tests, samples, or scripts (e.g., tools/, samples/, scripts/, usr/)
that do not affect the compiled kernel image (vmlinux) or kernel modules.
* Purely decorative logging (e.g., message strings in pr_err, printk, dev_info) or tracepoints
that do not alter control flow or data structures.
* Build system or Kconfig changes that do not alter compiled C logic.
- Structurally unreachable hardware:
* Vendor-specific PCIe switches, SmartNICs, or GPU drivers (e.g., mlxsw, pds_core, qed,
ionic, amdgpu) requiring physical ASIC/PCIe cards not emulated in standard QEMU.
- Unreachable execution paths:
* Driver teardown callbacks (.remove, .shutdown, pci_unregister_driver) executed only during
physical PCI hot-unplug or manual sysfs driver unbinding.
* Code paths exclusive to architectures other than the target architecture.
================================================================================
3. WHEN TO RETURN WorthFuzzing=true (POSITIVE CRITERIA)
================================================================================
Return WorthFuzzing=true whenever the patch touches reachable executable code, including:
- Core Subsystems:
* Any logic modifications in memory management (mm/), synchronization/locking (kernel/locking/),
BPF, scheduler, core networking, VFS, or syscall handling.
- Refactorings and Code Cleanups:
* Any restructuring of reachable data structures, helper abstractions, or algorithm flows.
- Runtime Assertions and Defensive Checks:
* Any introduction or alteration of assertions (WARN_ON*, VM_WARN_ON*, BUG_ON*, etc.) in reachable paths.
- Reachable Drivers and Protocols:
* Drivers accessible via virtual buses (virtio, USB gadget, loopback, netlink, binder, sockets, etc.).
================================================================================
4. EXTRACTING FocusSymbols (PREVENTING DILUTION)
================================================================================
When WorthFuzzing=true, you must extract specific kernel functions into FocusSymbols to guide the fuzzer:
- AVOID UBIQUITOUS LIFECYCLE HOT-PATHS:
Do NOT list generic, ubiquitous functions called by almost every program in the corpus
(including, but not limited to: general memory allocators and deallocators, page fault
and trap handlers, or core synchronization primitives; this is not an exhaustive list).
Listing ubiquitous functions causes the fuzzer to classify thousands of unrelated tests as "focused",
which severely dilutes fuzzing effort away from the actual changes.
- TARGET SPECIFIC FEATURE LOGIC AND ENTRYPOINTS:
List functions that specifically implement the logic being added or altered, or direct API entrypoints
for the subsystem feature under review.
- HANDLING STATIC INLINE FUNCTIONS IN HEADERS (.h):
Compiler-inlined static functions (such as static inlines in mm/*.h or include/linux/*.h) lack
distinct symbol addresses in vmlinux and cannot be targeted directly by symbol coverage filters.
If the changes are primarily in static inline helpers, identify non-static, feature-specific caller
functions in .c files that exercise them (avoiding ubiquitous lifecycle wrappers).
================================================================================
5. IDENTIFYING EnableConfigs
================================================================================
Identify any specific CONFIG_ options required to properly compile and reach the modified code:
- Inspect Kconfig files and #ifdef guards; do not make assumptions.
- Check "depends on" lines in Kconfig to include any non-standard parent subsystem configs needed.
- Strip any 'CONFIG_' prefix (e.g., return "NET_IPV4" instead of "CONFIG_NET_IPV4").
Prefer calling several tools at the same time to save round-trips.
Use set-results tool to provide results of the analysis.
It must be called exactly once before the final reply.
Ignore results of this tool.
Prompt: Target architecture: amd64
For your convenience, here is the diff of the changes:
commit 621cd55728c60e2c11e7f94b273484f0e5bd8d08
Author: syz-cluster <triage@syzkaller.com>
Date: Tue Sep 22 21:53:29 2026 +0000
syz-cluster: applied patch under review
diff --git a/drivers/usb/core/message.c b/drivers/usb/core/message.c
index 75e2bfd744a98..0cd6dd2b6334b 100644
--- a/drivers/usb/core/message.c
+++ b/drivers/usb/core/message.c
@@ -1337,7 +1337,8 @@ static void remove_intf_ep_devs(struct usb_interface *intf)
*
* Disables the endpoint for URB submission and nukes all pending URBs.
* If @reset_hardware is set then also deallocates hcd/hardware state
- * for the endpoint.
+ * for the endpoint (clearing both ep_in and ep_out pointers for
+ * bidirectional non-ep0 control endpoints).
*/
void usb_disable_endpoint(struct usb_device *dev, unsigned int epaddr,
bool reset_hardware)
@@ -1358,6 +1359,11 @@ void usb_disable_endpoint(struct usb_device *dev, unsigned int epaddr,
dev->ep_in[epnum] = NULL;
}
if (ep) {
+ if (reset_hardware && epnum != 0 &&
+ usb_endpoint_xfer_control(&ep->desc)) {
+ dev->ep_out[epnum] = NULL;
+ dev->ep_in[epnum] = NULL;
+ }
ep->enabled = 0;
usb_hcd_flush_endpoint(dev, ep);
if (reset_hardware)
|
| 3/2 | 2026/09/22 21:53 | llm | patch-evaluator |
0mModel:gemini-3.8-flash Args: null Results: null Tokens: input: 3063 output: 38 thoughts: 459 Thoughts: **Analyzing the USB Endpoint Disabling Function** Okay, let's dive into this patch. The target architecture is amd64, so we're dealing with a common setup. I'm focusing on the `drivers/usb/core/message.c` file and specifically the `usb_disable_endpoint` function, which appears to be the subject of this change. Looking at the diff, it seems we are modifying how `usb_disable_endpoint` handles endpoint deactivation, especially when `reset_hardware` is true. The existing code already disables the endpoint by setting `ep->enabled` to 0, flushing any pending URBs via `usb_hcd_flush_endpoint`, and, if `reset_hardware` is set, deallocating the HCD-specific state. The original logic already handled clearing the `dev->ep_in[epnum]` pointer. The patch introduces a significant addition: a conditional check *before* the hardware reset happens that specifically targets bidirectional control endpoints that are not endpoint 0. So, for a *non*-endpoint 0 bidirectional control endpoint, the `ep_out` pointer is also cleared on `reset_hardware`. This indicates that the previous logic, while correct for the other endpoints (such as IN/OUT interrupt or bulk) wasn't complete for control endpoints that are bidirectional, because there are `ep_in` and `ep_out` states that are handled differently. In essence, this patch ensures that the hardware state for *both* IN and OUT directions is cleared properly when `reset_hardware` is requested for a bidirectional control endpoint *besides* the default control endpoint. It is ensuring that when hardware reset is requested that the pointer for `ep_out` is also nulled. |
| 4/2 | 2026/09/22 21:53 | tool | read-file |
0mArgs:{
"File": "drivers/usb/core/message.c",
"FirstLine": 1335,
"LineCount": 55
}Results: {
"Contents": "1335:\t * @reset_hardware: flag to erase any endpoint state stored in the\n1336:\t *\tcontroller hardware\n1337:\t *\n1338:\t * Disables the endpoint for URB submission and nukes all pending URBs.\n1339:\t * If @reset_hardware is set then also deallocates hcd/hardware state\n1340:\t * for the endpoint (clearing both ep_in and ep_out pointers for\n1341:\t * bidirectional non-ep0 control endpoints).\n1342:\t */\n1343:\tvoid usb_disable_endpoint(struct usb_device *dev, unsigned int epaddr,\n1344:\t\t\tbool reset_hardware)\n1345:\t{\n1346:\t\tunsigned int epnum = epaddr \u0026 USB_ENDPOINT_NUMBER_MASK;\n1347:\t\tstruct usb_host_endpoint *ep;\n1348:\t\n1349:\t\tif (!dev)\n1350:\t\t\treturn;\n1351:\t\n1352:\t\tif (usb_endpoint_out(epaddr)) {\n1353:\t\t\tep = dev-\u003eep_out[epnum];\n1354:\t\t\tif (reset_hardware \u0026\u0026 epnum != 0)\n1355:\t\t\t\tdev-\u003eep_out[epnum] = NULL;\n1356:\t\t} else {\n1357:\t\t\tep = dev-\u003eep_in[epnum];\n1358:\t\t\tif (reset_hardware \u0026\u0026 epnum != 0)\n1359:\t\t\t\tdev-\u003eep_in[epnum] = NULL;\n1360:\t\t}\n1361:\t\tif (ep) {\n1362:\t\t\tif (reset_hardware \u0026\u0026 epnum != 0 \u0026\u0026\n1363:\t\t\t usb_endpoint_xfer_control(\u0026ep-\u003edesc)) {\n1364:\t\t\t\tdev-\u003eep_out[epnum] = NULL;\n1365:\t\t\t\tdev-\u003eep_in[epnum] = NULL;\n1366:\t\t\t}\n1367:\t\t\tep-\u003eenabled = 0;\n1368:\t\t\tusb_hcd_flush_endpoint(dev, ep);\n1369:\t\t\tif (reset_hardware)\n1370:\t\t\t\tusb_hcd_disable_endpoint(dev, ep);\n1371:\t\t}\n1372:\t}\n1373:\t\n1374:\t/**\n1375:\t * usb_reset_endpoint - Reset an endpoint's state.\n1376:\t * @dev: the device whose endpoint is to be reset\n1377:\t * @epaddr: the endpoint's address. Endpoint number for output,\n1378:\t *\tendpoint number + USB_DIR_IN for input\n1379:\t *\n1380:\t * Resets any host-side endpoint state such as the toggle bit,\n1381:\t * sequence number or current window.\n1382:\t */\n1383:\tvoid usb_reset_endpoint(struct usb_device *dev, unsigned int epaddr)\n1384:\t{\n1385:\t\tunsigned int epnum = epaddr \u0026 USB_ENDPOINT_NUMBER_MASK;\n1386:\t\tstruct usb_host_endpoint *ep;\n1387:\t\n1388:\t\tif (usb_endpoint_out(epaddr))\n1389:\t\t\tep = dev-\u003eep_out[epnum];\n"
} |
| 5/2 | 2026/09/22 21:53 | llm | patch-evaluator |
0mModel:gemini-3.8-flash Args: null Results: null Tokens: input: 4795 output: 19 thoughts: 133 Thoughts: Here's my thought process, as if I were analyzing this code: **Analyzing `usb_disable_endpoint` in the USB Core** Okay, so `usb_disable_endpoint` is the function of interest, and it's been touched in `drivers/usb/core/message.c`. My first question is always: *how* is this function used? What are its call paths? And critically, can those paths be reached through any of our known fuzzing methods? Thinking about USB's attack surface, it's pretty extensive. We have a variety of avenues for interacting with the USB core: Syzkaller, of course, with its `Raw Gadget` mode, USB emulation tools like the Dummy HCD, vhci, usbip – all those could potentially be relevant. Then there are the more standard Syzkaller fuzzing methods: `syz_usb_connect` calls, direct interaction with USB devices (physical or emulated), usbfs ioctls, standard USB device drivers and their interfaces. The possibilities are numerous, meaning it’s a big target surface. Therefore, the immediate next step is crystal clear: I need to pinpoint every single call site for `usb_disable_endpoint`. From there, I'll assess if they're reachable through one of these fuzzing methods. |
| 6/2 | 2026/09/22 21:53 | tool | grepper |
0mArgs:{
"Expression": "usb_disable_endpoint"
}Results: {
"Output": "Documentation/admin-guide/bug-hunting.rst=4=Kernel bug reports often come with a stack dump like the one below::\n--\nDocumentation/admin-guide/bug-hunting.rst-24-\t [\u003cf80bb3bf\u003e] ? dvb_usb_exit+0x2f/0xd0 [dvb_usb]\nDocumentation/admin-guide/bug-hunting.rst:25:\t [\u003cc13d03bc\u003e] ? usb_disable_endpoint+0x7c/0xb0\nDocumentation/admin-guide/bug-hunting.rst-26-\t [\u003cf80bb48a\u003e] ? dvb_usb_device_exit+0x2a/0x50 [dvb_usb]\n--\nDocumentation/translations/zh_CN/admin-guide/bug-hunting.rst-32-\t [\u003cf80bb3bf\u003e] ? dvb_usb_exit+0x2f/0xd0 [dvb_usb]\nDocumentation/translations/zh_CN/admin-guide/bug-hunting.rst:33:\t [\u003cc13d03bc\u003e] ? usb_disable_endpoint+0x7c/0xb0\nDocumentation/translations/zh_CN/admin-guide/bug-hunting.rst-34-\t [\u003cf80bb48a\u003e] ? dvb_usb_device_exit+0x2a/0x50 [dvb_usb]\n--\nDocumentation/translations/zh_TW/admin-guide/bug-hunting.rst-35-\t [\u003cf80bb3bf\u003e] ? dvb_usb_exit+0x2f/0xd0 [dvb_usb]\nDocumentation/translations/zh_TW/admin-guide/bug-hunting.rst:36:\t [\u003cc13d03bc\u003e] ? usb_disable_endpoint+0x7c/0xb0\nDocumentation/translations/zh_TW/admin-guide/bug-hunting.rst-37-\t [\u003cf80bb48a\u003e] ? dvb_usb_device_exit+0x2a/0x50 [dvb_usb]\n--\ndrivers/usb/core/hub.c=4752=void usb_ep0_reinit(struct usb_device *udev)\ndrivers/usb/core/hub.c-4753-{\ndrivers/usb/core/hub.c:4754:\tusb_disable_endpoint(udev, 0 + USB_DIR_IN, true);\ndrivers/usb/core/hub.c:4755:\tusb_disable_endpoint(udev, 0 + USB_DIR_OUT, true);\ndrivers/usb/core/hub.c-4756-\tusb_enable_endpoint(udev, \u0026udev-\u003eep0, true);\n--\ndrivers/usb/core/message.c=1317=static void remove_intf_ep_devs(struct usb_interface *intf)\n--\ndrivers/usb/core/message.c-1330-/**\ndrivers/usb/core/message.c:1331: * usb_disable_endpoint -- Disable an endpoint by address\ndrivers/usb/core/message.c-1332- * @dev: the device whose endpoint is being disabled\n--\ndrivers/usb/core/message.c-1342- */\ndrivers/usb/core/message.c:1343:void usb_disable_endpoint(struct usb_device *dev, unsigned int epaddr,\ndrivers/usb/core/message.c-1344-\t\tbool reset_hardware)\n--\ndrivers/usb/core/message.c=1407=void usb_disable_interface(struct usb_device *dev, struct usb_interface *intf,\n--\ndrivers/usb/core/message.c-1413-\tfor (i = 0; i \u003c alt-\u003edesc.bNumEndpoints; ++i) {\ndrivers/usb/core/message.c:1414:\t\tusb_disable_endpoint(dev,\ndrivers/usb/core/message.c-1415-\t\t\t\talt-\u003eendpoint[i].desc.bEndpointAddress,\n--\ndrivers/usb/core/message.c=1425=static void usb_disable_device_endpoints(struct usb_device *dev, int skip_ep0)\n--\ndrivers/usb/core/message.c-1432-\t\tfor (i = skip_ep0; i \u003c 16; ++i) {\ndrivers/usb/core/message.c:1433:\t\t\tusb_disable_endpoint(dev, i, false);\ndrivers/usb/core/message.c:1434:\t\t\tusb_disable_endpoint(dev, i + USB_DIR_IN, false);\ndrivers/usb/core/message.c-1435-\t\t}\n--\ndrivers/usb/core/message.c-1442-\tfor (i = skip_ep0; i \u003c 16; ++i) {\ndrivers/usb/core/message.c:1443:\t\tusb_disable_endpoint(dev, i, true);\ndrivers/usb/core/message.c:1444:\t\tusb_disable_endpoint(dev, i + USB_DIR_IN, true);\ndrivers/usb/core/message.c-1445-\t}\n--\ndrivers/usb/core/usb.h=26=extern void usb_enable_interface(struct usb_device *dev,\ndrivers/usb/core/usb.h-27-\t\tstruct usb_interface *intf, bool reset_toggles);\ndrivers/usb/core/usb.h:28:extern void usb_disable_endpoint(struct usb_device *dev, unsigned int epaddr,\ndrivers/usb/core/usb.h-29-\t\tbool reset_hardware);\n--\ndrivers/usb/usbip/vhci_hcd.c=1039=static void vhci_shutdown_connection(struct usbip_device *ud)\n--\ndrivers/usb/usbip/vhci_hcd.c-1074-\t *\tdisable all the endpoints for a USB device.\ndrivers/usb/usbip/vhci_hcd.c:1075:\t * usb_disable_endpoint():\ndrivers/usb/usbip/vhci_hcd.c-1076-\t *\tdisable endpoints. pending urbs are unlinked(dequeued).\n"
} |
| 7/2 | 2026/09/22 21:53 | llm | patch-evaluator |
0mModel:gemini-3.8-flash Args: null Results: null Tokens: input: 6739 output: 21 thoughts: 68 Thoughts: Here's my analysis of the provided information: **Dissecting Endpoint Disablement** Okay, so I'm looking at `usb_disable_endpoint`. It's pretty fundamental, right? And I see it's called by a few key functions: `usb_disable_interface`, `usb_disable_device_endpoints`, and `usb_ep0_reinit`. My immediate question is: *when* are these calling functions actually invoked? That's the crux of understanding the bigger picture. To get a handle on the control flow, I'll need to dig deeper into the contexts where `usb_disable_device_endpoints` and `usb_disable_interface` are being used. From here I can extrapolate to find the others. |
| 8/2 | 2026/09/22 21:53 | tool | grepper |
0mArgs:{
"Expression": "usb_disable_device_endpoints"
}Results: {
"Output": "drivers/usb/core/message.c=1407=void usb_disable_interface(struct usb_device *dev, struct usb_interface *intf,\n--\ndrivers/usb/core/message.c-1420-/*\ndrivers/usb/core/message.c:1421: * usb_disable_device_endpoints -- Disable all endpoints for a device\ndrivers/usb/core/message.c-1422- * @dev: the device whose endpoints are being disabled\n--\ndrivers/usb/core/message.c-1424- */\ndrivers/usb/core/message.c:1425:static void usb_disable_device_endpoints(struct usb_device *dev, int skip_ep0)\ndrivers/usb/core/message.c-1426-{\n--\ndrivers/usb/core/message.c=1458=void usb_disable_device(struct usb_device *dev, int skip_ep0)\n--\ndrivers/usb/core/message.c-1506-\ndrivers/usb/core/message.c:1507:\tusb_disable_device_endpoints(dev, skip_ep0);\ndrivers/usb/core/message.c-1508-}\n--\ndrivers/usb/core/message.c=1758=int usb_reset_configuration(struct usb_device *dev)\n--\ndrivers/usb/core/message.c-1771-\ndrivers/usb/core/message.c:1772:\tusb_disable_device_endpoints(dev, 1); /* skip ep0*/\ndrivers/usb/core/message.c-1773-\n"
} |
| 9/2 | 2026/09/22 21:53 | llm | patch-evaluator |
0mModel:gemini-3.8-flash Args: null Results: null Tokens: input: 7394 output: 19 thoughts: 44 Thoughts: Okay, let's break this down. **Investigating the `usb_disable_interface` Function** Right, so I'm thinking about `usb_disable_interface`. It's clearly a key function, and my current hunch is it's primarily involved in managing interfaces on a USB device, specifically during things like altsetting changes, interface unbinding, or outright disconnection events. I need to confirm this understanding, and dig deeper to ensure I'm not missing any edge cases. Therefore, the immediate next step is to trace all the calls to `usb_disable_interface`. I need to understand *when* and *why* this function is being invoked to get a complete picture of its role in the driver's architecture and the USB stack as a whole. |
| 10/2 | 2026/09/22 21:53 | tool | grepper |
0mArgs:{
"Expression": "usb_disable_interface"
}Results: {
"Output": "drivers/usb/core/driver.c=431=static int usb_unbind_interface(struct device *dev)\n--\ndrivers/usb/core/driver.c-458-\tif (!driver-\u003esoft_unbind || udev-\u003estate == USB_STATE_NOTATTACHED)\ndrivers/usb/core/driver.c:459:\t\tusb_disable_interface(udev, intf, false);\ndrivers/usb/core/driver.c-460-\n--\ndrivers/usb/core/hub.c=6183=static int usb_reset_and_verify_device(struct usb_device *udev)\n--\ndrivers/usb/core/hub.c-6255-\t\tif (intf-\u003ecur_altsetting-\u003edesc.bAlternateSetting == 0)\ndrivers/usb/core/hub.c:6256:\t\t\tusb_disable_interface(udev, intf, true);\ndrivers/usb/core/hub.c-6257-\t}\n--\ndrivers/usb/core/message.c=1395=EXPORT_SYMBOL_GPL(usb_reset_endpoint);\n--\ndrivers/usb/core/message.c-1398-/**\ndrivers/usb/core/message.c:1399: * usb_disable_interface -- Disable all endpoints for an interface\ndrivers/usb/core/message.c-1400- * @dev: the device whose interface is being disabled\n--\ndrivers/usb/core/message.c-1406- */\ndrivers/usb/core/message.c:1407:void usb_disable_interface(struct usb_device *dev, struct usb_interface *intf,\ndrivers/usb/core/message.c-1408-\t\tbool reset_hardware)\n--\ndrivers/usb/core/message.c=1593=int usb_set_interface(struct usb_device *dev, int interface, int alternate)\n--\ndrivers/usb/core/message.c-1624-\t */\ndrivers/usb/core/message.c:1625:\tusb_disable_interface(dev, iface, false);\ndrivers/usb/core/message.c-1626-\n--\ndrivers/usb/core/message.c-1688-\t}\ndrivers/usb/core/message.c:1689:\tusb_disable_interface(dev, iface, true);\ndrivers/usb/core/message.c-1690-\n--\ndrivers/usb/core/message.c=2062=int usb_set_configuration(struct usb_device *dev, int configuration)\n--\ndrivers/usb/core/message.c-2224-\t\tfor (i = 0; i \u003c nintf; ++i) {\ndrivers/usb/core/message.c:2225:\t\t\tusb_disable_interface(dev, cp-\u003einterface[i], true);\ndrivers/usb/core/message.c-2226-\t\t\tput_device(\u0026cp-\u003einterface[i]-\u003edev);\n--\ndrivers/usb/core/usb.h=28=extern void usb_disable_endpoint(struct usb_device *dev, unsigned int epaddr,\ndrivers/usb/core/usb.h-29-\t\tbool reset_hardware);\ndrivers/usb/core/usb.h:30:extern void usb_disable_interface(struct usb_device *dev,\ndrivers/usb/core/usb.h-31-\t\tstruct usb_interface *intf, bool reset_hardware);\n"
} |
| 11/2 | 2026/09/22 21:53 | llm | patch-evaluator |
0mModel:gemini-3.8-flash Args: null Results: null Tokens: input: 8466 output: 41 thoughts: 81 Thoughts: Here's my take on the situation: **Investigating USB Interface and Configuration Control** Okay, so I need to understand how we're managing USB interfaces and configurations at a low level. My initial thought is to examine calls to `usb_set_interface`, `usb_set_configuration`, and `usb_reset_configuration`. These are key functions for manipulating the device's operational state. Now, remembering my past work, I also know that `usbfs` exposes these operations via ioctls like `USBDEVFS_SETINTERFACE`, `USBDEVFS_SETCONFIGURATION`, and `USBDEVFS_RESET`. This suggests a potential avenue for user-space control. To solidify my understanding of the kernel-side implementation, I'm going to quickly check `drivers/usb/core/devio.c`. This file is often the central hub for device I/O related operations, and it's highly probable I'll find the ioctl handlers and possibly see how these kernel-level functions are being called. This should clarify the overall picture. |
| 12/2 | 2026/09/22 21:53 | tool | grepper |
0mArgs:{
"Expression": "usb_set_interface|usb_set_configuration",
"PathPrefix": "drivers/usb/core/devio.c"
}Results: {
"Output": "drivers/usb/core/devio.c=1529=static int proc_setintf(struct usb_dev_state *ps, void __user *arg)\n--\ndrivers/usb/core/devio.c-1541-\ndrivers/usb/core/devio.c:1542:\treturn usb_set_interface(ps-\u003edev, setintf.interface,\ndrivers/usb/core/devio.c-1543-\t\t\tsetintf.altsetting);\n--\ndrivers/usb/core/devio.c=1546=static int proc_setconfig(struct usb_dev_state *ps, void __user *arg)\n--\ndrivers/usb/core/devio.c-1581-\t/* SET_CONFIGURATION is often abused as a \"cheap\" driver reset,\ndrivers/usb/core/devio.c:1582:\t * so avoid usb_set_configuration()'s kick to sysfs\ndrivers/usb/core/devio.c-1583-\t */\n--\ndrivers/usb/core/devio.c-1587-\t\telse\ndrivers/usb/core/devio.c:1588:\t\t\tstatus = usb_set_configuration(ps-\u003edev, u);\ndrivers/usb/core/devio.c-1589-\t}\n"
} |
| 13/2 | 2026/09/22 21:53 | llm | patch-evaluator |
0mModel:gemini-3.8-flash Args: null Results: null Tokens: input: 9142 output: 19 thoughts: 31 Thoughts: Okay, here's my take on those thoughts, tailored for an expert audience: **Endpoint Configuration Deep Dive** Hmm, let's see. I'm considering the intricacies of endpoint setup in our USB implementation, and a specific function call has just surfaced in my mind: `usb_enable_endpoint`. The question is, how does this function, or similar functions handle the specific configurations for control endpoints? These are often the first thing configured, and I want to refresh my understanding of how this is handled at a low level. It makes me want to dig into how this is managed for the control endpoints in particular. Let's start by doing a quick search for instances of `usb_enable_endpoint`, and see if the documentation or code reveals any insights into the control endpoint configuration specifics and how it's handled. |
| 14/2 | 2026/09/22 21:54 | tool | grepper |
0mArgs:{
"Expression": "usb_enable_endpoint"
}Results: {
"Output": "drivers/usb/core/hub.c=4752=void usb_ep0_reinit(struct usb_device *udev)\n--\ndrivers/usb/core/hub.c-4755-\tusb_disable_endpoint(udev, 0 + USB_DIR_OUT, true);\ndrivers/usb/core/hub.c:4756:\tusb_enable_endpoint(udev, \u0026udev-\u003eep0, true);\ndrivers/usb/core/hub.c-4757-}\n--\ndrivers/usb/core/message.c=1458=void usb_disable_device(struct usb_device *dev, int skip_ep0)\n--\ndrivers/usb/core/message.c-1510-/**\ndrivers/usb/core/message.c:1511: * usb_enable_endpoint - Enable an endpoint for USB communications\ndrivers/usb/core/message.c-1512- * @dev: the device whose interface is being enabled\n--\ndrivers/usb/core/message.c-1518- */\ndrivers/usb/core/message.c:1519:void usb_enable_endpoint(struct usb_device *dev, struct usb_host_endpoint *ep,\ndrivers/usb/core/message.c-1520-\t\tbool reset_ep)\n--\ndrivers/usb/core/message.c=1543=void usb_enable_interface(struct usb_device *dev,\n--\ndrivers/usb/core/message.c-1549-\tfor (i = 0; i \u003c alt-\u003edesc.bNumEndpoints; ++i)\ndrivers/usb/core/message.c:1550:\t\tusb_enable_endpoint(dev, \u0026alt-\u003eendpoint[i], reset_eps);\ndrivers/usb/core/message.c-1551-}\n--\ndrivers/usb/core/usb.c=644=struct usb_device *usb_alloc_dev(struct usb_device *parent,\n--\ndrivers/usb/core/usb.c-681-\t/* ep0 maxpacket comes later, from device descriptor */\ndrivers/usb/core/usb.c:682:\tusb_enable_endpoint(dev, \u0026dev-\u003eep0, false);\ndrivers/usb/core/usb.c-683-\tdev-\u003ecan_submit = 1;\n--\ndrivers/usb/core/usb.h=22=extern void usb_remove_ep_devs(struct usb_host_endpoint *endpoint);\ndrivers/usb/core/usb.h-23-\ndrivers/usb/core/usb.h:24:extern void usb_enable_endpoint(struct usb_device *dev,\ndrivers/usb/core/usb.h-25-\t\tstruct usb_host_endpoint *ep, bool reset_toggle);\n"
} |
| 15/2 | 2026/09/22 21:54 | llm | patch-evaluator |
0mModel:gemini-3.8-flash Args: null Results: null Tokens: input: 10041 output: 38 thoughts: 23 Thoughts: Okay, let's dive into this. Here's my thought process on the matter: **Analyzing `usb_enable_endpoint` in `drivers/usb/core/message.c`** Alright, time to crack open `usb_enable_endpoint` within `drivers/usb/core/message.c`. I need to understand exactly how the USB core handles the enabling of endpoints. Given the function's name and the file's location, I'm expecting to find the nitty-gritty details of the control flow required to set up endpoint communication and potentially some important initialization of hardware-specific registers. I'm keen to see if this function is where the core does its setup or it acts as the top-level call that calls out to a driver-specific function. I'll be looking for references to any data structures related to endpoints, how they're passed and modified, and how the hardware is instructed to respond to the enablement. Things I'll specifically look for are: resource allocation, register programming, and interrupt enabling. I'll also pay attention to how this function interacts with other parts of the USB core, such as the device driver and the controller driver. My gut tells me there might be a call to a driver-specific function somewhere in this code, so I'll be on the lookout for function pointers or indirect calls that represent the interface to the hardware. Let's get to it. |
| 16/2 | 2026/09/22 21:54 | tool | read-file |
0mArgs:{
"File": "drivers/usb/core/message.c",
"FirstLine": 1510,
"LineCount": 40
}Results: {
"Contents": "1510:\t/**\n1511:\t * usb_enable_endpoint - Enable an endpoint for USB communications\n1512:\t * @dev: the device whose interface is being enabled\n1513:\t * @ep: the endpoint\n1514:\t * @reset_ep: flag to reset the endpoint state\n1515:\t *\n1516:\t * Resets the endpoint state if asked, and sets dev-\u003eep_{in,out} pointers.\n1517:\t * For control endpoints, both the input and output sides are handled.\n1518:\t */\n1519:\tvoid usb_enable_endpoint(struct usb_device *dev, struct usb_host_endpoint *ep,\n1520:\t\t\tbool reset_ep)\n1521:\t{\n1522:\t\tint epnum = usb_endpoint_num(\u0026ep-\u003edesc);\n1523:\t\tint is_out = usb_endpoint_dir_out(\u0026ep-\u003edesc);\n1524:\t\tint is_control = usb_endpoint_xfer_control(\u0026ep-\u003edesc);\n1525:\t\n1526:\t\tif (reset_ep)\n1527:\t\t\tusb_hcd_reset_endpoint(dev, ep);\n1528:\t\tif (is_out || is_control)\n1529:\t\t\tdev-\u003eep_out[epnum] = ep;\n1530:\t\tif (!is_out || is_control)\n1531:\t\t\tdev-\u003eep_in[epnum] = ep;\n1532:\t\tep-\u003eenabled = 1;\n1533:\t}\n1534:\t\n1535:\t/**\n1536:\t * usb_enable_interface - Enable all the endpoints for an interface\n1537:\t * @dev: the device whose interface is being enabled\n1538:\t * @intf: pointer to the interface descriptor\n1539:\t * @reset_eps: flag to reset the endpoints' state\n1540:\t *\n1541:\t * Enables all the endpoints for the interface's current altsetting.\n1542:\t */\n1543:\tvoid usb_enable_interface(struct usb_device *dev,\n1544:\t\t\tstruct usb_interface *intf, bool reset_eps)\n1545:\t{\n1546:\t\tstruct usb_host_interface *alt = intf-\u003ecur_altsetting;\n1547:\t\tint i;\n1548:\t\n1549:\t\tfor (i = 0; i \u003c alt-\u003edesc.bNumEndpoints; ++i)\n"
} |
| 17/2 | 2026/09/22 21:54 | llm | patch-evaluator |
0mModel:gemini-3.8-flash Args: null Results: null Tokens: input: 11055 output: 24 thoughts: 667 Thoughts: **Analyzing a Potential USB Endpoint Management Bug** Okay, let's break this down. I'm looking at the `usb_enable_endpoint` function, and I see how it handles endpoint configuration. The core is the setting of `dev->ep_out[epnum]` and `dev->ep_in[epnum]` based on the endpoint direction (OUT or IN) and transfer type. Notice, for *control* endpoints, it sets *both* `dev->ep_out[epnum]` and `dev->ep_in[epnum]` to the same endpoint structure (`ep`). That's the first key point. Now, I'm reviewing the `usb_disable_endpoint` function, and I immediately spot the potential problem. Originally, it would only null out the entry in either `dev->ep_out[epnum]` or `dev->ep_in[epnum]` *depending on the direction of the endpoint address*. If we had a control endpoint (other than endpoint 0, because it's always special) and called `usb_disable_interface()`, which in turn calls `usb_disable_endpoint` on each endpoint in the interface, we'd have a situation. The call to `usb_disable_endpoint()` could get called for, say, the IN direction of the control endpoint. It would clear `dev->ep_in[epnum]`, but not `dev->ep_out[epnum]`. Or vice versa. This leaves a dangling pointer if the endpoint has been freed or reallocated. This creates a classic use-after-free or dangling pointer vulnerability! The patch cleverly addresses this. It introduces a check within `usb_disable_endpoint` that *explicitly* clears *both* `dev->ep_out[epnum]` and `dev->ep_in[epnum]` if the endpoint is a non-zero control endpoint *and* the `reset_hardware` flag is set. That's a clean and correct solution. Both entries will be nulled out, avoiding that potential access problem. I'll need to check the git log to understand if I can learn anything further. |
| 18/2 | 2026/09/22 21:54 | tool | grepper |
0mArgs:{
"Expression": "clearing both ep_in and ep_out"
}Results: {
"Output": "drivers/usb/core/message.c=1317=static void remove_intf_ep_devs(struct usb_interface *intf)\n--\ndrivers/usb/core/message.c-1339- * If @reset_hardware is set then also deallocates hcd/hardware state\ndrivers/usb/core/message.c:1340: * for the endpoint (clearing both ep_in and ep_out pointers for\ndrivers/usb/core/message.c-1341- * bidirectional non-ep0 control endpoints).\n"
} |
| 19/2 | 2026/09/22 21:54 | llm | patch-evaluator |
0mModel:gemini-3.8-flash Args: null Results: null Tokens: input: 12346 output: 33 thoughts: 34 Thoughts: Okay, let's dive into this USB driver's configuration. **Investigating USB Driver Configuration in Depth** Right, so I want to pinpoint exactly which Kconfig options are governing the behavior of `drivers/usb/core/message.c`. My initial instinct, as always, is to begin with the Makefile. It usually holds the key to the build process, including the conditional compilation flags influenced by Kconfig. Therefore, I'll go directly to `drivers/usb/core/Makefile` to see if I can trace the relevant dependencies from there. This should give me a solid starting point for understanding how the core messaging component's inclusion or exclusion is controlled at build time. Once I have the Makefile details, I'll likely proceed to inspect the Kconfig hierarchy to get the full picture of the configuration options. |
| 20/2 | 2026/09/22 21:54 | tool | read-file |
0mArgs:{
"File": "drivers/usb/core/Makefile",
"FirstLine": 1,
"LineCount": 30
}Results: {
"Contents": " 1:\t# SPDX-License-Identifier: GPL-2.0\n 2:\t#\n 3:\t# Makefile for USB Core files and filesystem\n 4:\t#\n 5:\t\n 6:\t# define_trace.h needs to know how to find our header\n 7:\tCFLAGS_trace.o := -I$(src)\n 8:\t\n 9:\tusbcore-y := usb.o hub.o hcd.o urb.o message.o driver.o\n 10:\tusbcore-y += config.o file.o buffer.o sysfs.o endpoint.o\n 11:\tusbcore-y += devio.o notify.o generic.o quirks.o devices.o\n 12:\tusbcore-y += phy.o port.o trace.o\n 13:\t\n 14:\tusbcore-$(CONFIG_OF)\t\t+= of.o\n 15:\tusbcore-$(CONFIG_USB_XHCI_SIDEBAND)\t+= offload.o\n 16:\tusbcore-$(CONFIG_USB_PCI)\t\t+= hcd-pci.o\n 17:\tusbcore-$(CONFIG_ACPI)\t\t+= usb-acpi.o\n 18:\t\n 19:\tifdef CONFIG_USB_ONBOARD_DEV\n 20:\tusbcore-y\t\t\t+= ../misc/onboard_usb_dev_pdevs.o\n 21:\tendif\n 22:\t\n 23:\tobj-$(CONFIG_USB)\t\t+= usbcore.o\n 24:\t\n 25:\tobj-$(CONFIG_USB_LEDS_TRIGGER_USBPORT)\t+= ledtrig-usbport.o\n"
} |
| 21/2 | 2026/09/22 21:54 | llm | patch-evaluator |
0mModel:gemini-3.8-flash Args: null Results: null Tokens: input: 13004 output: 26 thoughts: 74 Thoughts: Okay, let's see what we have here. **Deconstructing this USB Module Build Configuration** Right, so I'm looking at this build system fragment: `obj-$(CONFIG_USB) += usbcore.o`. That immediately tells me that `usbcore.o` is only going to be included if `CONFIG_USB` is set. Makes perfect sense. Then we have `usbcore-y := usb.o hub.o hcd.o urb.o message.o driver.o ...`. This defines the components that are *always* linked into `usbcore.o` when it's built into the kernel, the `-y` is important. This means `CONFIG_USB` is the gatekeeper. The next logical step is to confirm the actual configuration that controls all this. I'll need to head over to `drivers/usb/Kconfig` and take a look around the `CONFIG_USB` definition to understand its dependencies and any associated options. I bet it is defined in there, and that will give me the clarity on how to use `CONFIG_USB` and any related parameters. Excellent, let's go check the Kconfig. |
| 22/2 | 2026/09/22 21:54 | tool | grepper |
0mArgs:{
"Expression": "menuconfig USB",
"PathPrefix": "drivers/usb"
}Results: {
"Output": "drivers/usb/Kconfig=26=config USB_UHCI_BIG_ENDIAN_DESC\n--\ndrivers/usb/Kconfig-28-\ndrivers/usb/Kconfig:29:menuconfig USB_SUPPORT\ndrivers/usb/Kconfig-30-\tbool \"USB support\"\n--\ndrivers/usb/atm/Kconfig-5-\ndrivers/usb/atm/Kconfig:6:menuconfig USB_ATM\ndrivers/usb/atm/Kconfig-7-\ttristate \"USB DSL modem support\"\n--\ndrivers/usb/gadget/Kconfig-16-\ndrivers/usb/gadget/Kconfig:17:menuconfig USB_GADGET\ndrivers/usb/gadget/Kconfig-18-\ttristate \"USB Gadget Support\"\n--\ndrivers/usb/serial/Kconfig-5-\ndrivers/usb/serial/Kconfig:6:menuconfig USB_SERIAL\ndrivers/usb/serial/Kconfig-7-\ttristate \"USB Serial Converter support\"\n"
} |
| 23/2 | 2026/09/22 21:54 | llm | patch-evaluator |
0mModel:gemini-3.8-flash Args: null Results: null Tokens: input: 13600 output: 33 thoughts: 12 Thoughts: Okay, here's my interpretation of that thought process, tailored for an expert audience, and written in the first person: **Diving into USB Configuration** Alright, time to get my hands dirty. My instinct immediately leads me to the `drivers/usb/Kconfig` file. I know this is the central configuration file for the USB subsystem. I need to refresh my memory on what options are available and how they're structured. This is the starting point for understanding how the USB stack is configured within this kernel. I want to see how various controllers, device classes, and other USB-related features are enabled or disabled. It will be very helpful in understanding how this configuration works. I need to ensure a proper and up-to-date configuration, based on specific goals. |
| 24/2 | 2026/09/22 21:54 | tool | read-file |
0mArgs:{
"File": "drivers/usb/Kconfig",
"FirstLine": 30,
"LineCount": 40
}Results: {
"Contents": " 30:\t\tbool \"USB support\"\n 31:\t\tdepends on HAS_IOMEM\n 32:\t\tdefault y\n 33:\t\thelp\n 34:\t\t This option adds core support for Universal Serial Bus (USB).\n 35:\t\t You will also need drivers from the following menu to make use of it.\n 36:\t\n 37:\tif USB_SUPPORT\n 38:\t\n 39:\tsource \"drivers/usb/common/Kconfig\"\n 40:\t\n 41:\tconfig USB_ARCH_HAS_HCD\n 42:\t\tdef_bool y\n 43:\t\n 44:\tconfig USB\n 45:\t\ttristate \"Support for Host-side USB\"\n 46:\t\tdepends on USB_ARCH_HAS_HCD\n 47:\t\tselect GENERIC_ALLOCATOR\n 48:\t\tselect USB_COMMON\n 49:\t\tselect NLS # for UTF-8 strings\n 50:\t\thelp\n 51:\t\t Universal Serial Bus (USB) is a specification for a serial bus\n 52:\t\t subsystem which offers higher speeds and more features than the\n 53:\t\t traditional PC serial port. The bus supplies power to peripherals\n 54:\t\t and allows for hot swapping. Up to 127 USB peripherals can be\n 55:\t\t connected to a single USB host in a tree structure.\n 56:\t\t \n 57:\t\t The USB host is the root of the tree, the peripherals are the\n 58:\t\t leaves and the inner nodes are special USB devices called hubs.\n 59:\t\t Most PCs now have USB host ports, used to connect peripherals\n 60:\t\t such as scanners, keyboards, mice, modems, cameras, disks,\n 61:\t\t flash memory, network links, and printers to the PC.\n 62:\t\n 63:\t\t Say Y here if your computer has a host-side USB port and you want\n 64:\t\t to use USB devices. You then need to say Y to at least one of the\n 65:\t\t Host Controller Driver (HCD) options below. Choose a USB 1.1\n 66:\t\t controller, such as \"UHCI HCD support\" or \"OHCI HCD support\",\n 67:\t\t and \"EHCI HCD (USB 2.0) support\" except for older systems that\n 68:\t\t do not have USB 2.0 support. It doesn't normally hurt to select\n 69:\t\t them all if you are not certain.\n"
} |
| 25/2 | 2026/09/22 21:54 | llm | patch-evaluator |
0mModel:gemini-3.8-flash Args: null Results: null Tokens: input: 14441 output: 161 thoughts: 1369 Thoughts: **Analysis of USB Core Patch for Fuzzing Suitability** Okay, so we're looking at a patch related to USB, specifically `usb_disable_endpoint`. My initial thought is to determine if this change warrants fuzzing. `CONFIG_USB` is standard, so that's a good starting point. The crucial question is reachability and whether fuzzing is even a useful endeavor here. The patch guidelines are clear: reachability is *the* primary factor. The code has to be executable in a standard virtualized environment like QEMU or GCE. This means no unreachable code or functions that are not standard. Also, we cannot just blindly trust claims of "no functional change" or "refactoring". It needs to be demonstrable. Now, considering the Linux USB subsystem and syzkaller, we know syzkaller extensively uses Dummy HCD, Raw Gadget, and USBip, among other tools. It crafts USB device descriptors, including those with multiple interfaces and configurations, and uses functions like `usb_disable_endpoint`, `usb_disable_interface`, and the like to execute USB enumeration and teardown. The modified code directly affects the state tracking of non-ep0 control endpoints in the `struct usb_device`, specifically clearing `ep_out` and `ep_in` pointers. This code is absolutely reachable. This impacts the core USB subsystem (`drivers/usb/core/message.c`). Therefore, this code modification is worth fuzzing. My conclusion is: **WorthFuzzing is true!** Next, I need to figure out what symbols to focus on. Since the patch modifies `usb_disable_endpoint`, that function becomes the center of my attention. Also, any functions that directly call `usb_disable_endpoint` or are entrypoints to functionality. So, `usb_disable_endpoint`, `usb_disable_interface`, `usb_enable_endpoint`, `usb_set_interface`, and `usb_set_configuration` are what I'm looking at. I need to confirm these symbols are actually in the vmlinux and the USB core. It looks like `usb_disable_endpoint` is a non-static function declared in `drivers/usb/core/usb.h` and defined in `drivers/usb/core/message.c`. It is reachable by the listed callers. Great! It is a public API. The others seem to have similar visibility and are likely directly invoked by userland or from the kernel. Are these functions common, core functions? No, these are very specific to USB configuration, interface, and endpoint management. They're not memory allocators, page fault handlers, or called on every syscall. So, the `FocusSymbols` will absolutely include those functions I identified. I'll check the required kernel configs. `USB` is the primary config. `USB_SUPPORT` is also in the menuconfig. Looking at the `drivers/usb/core/Makefile`, `usbcore-y := usb.o hub.o hcd.o urb.o message.o driver.o ...` and `obj-$(CONFIG_USB) += usbcore.o` indicate that only `USB` (or `USB_SUPPORT`) is needed. Syzkaller probably uses `USB_SUPPORT` and `USB`. It looks like `USB` is essential. I will verify whether `usb_endpoint_xfer_control` has anything unusual. It is a static inline in `include/uapi/linux/usb/ch9.h` or `include/linux/usb/ch9.h`, so nothing special there. I am now ready to present my findings in the required format. * `WorthFuzzing`: true * `Reasoning`: The patch modifies `usb_disable_endpoint` in the USB core (`drivers/usb/core/message.c`) to clear both `ep_in` and `ep_out` pointers when resetting/disabling non-ep0 control endpoints. This modifies endpoint state tracking and teardown logic in core USB, which is fully reachable and exercisable in standard virtualized environments via USB emulation / Raw Gadget / usbfs ioctls. * `FocusSymbols`: `["usb_disable_endpoint", "usb_disable_interface", "usb_enable_endpoint", "usb_set_interface", "usb_set_configuration"]` * `EnableConfigs`: `["USB"]` Alright, I've checked everything carefully and consistently. Let's submit. |
| 26/2 | 2026/09/22 21:54 | tool | set-results |
0mArgs:{
"EnableConfigs": [
"USB"
],
"FocusSymbols": [
"usb_disable_endpoint",
"usb_disable_interface",
"usb_enable_endpoint",
"usb_set_interface",
"usb_set_configuration"
],
"Reasoning": "The patch modifies usb_disable_endpoint() in drivers/usb/core/message.c to ensure both ep_in and ep_out endpoint pointers are cleared when disabling non-ep0 bidirectional control endpoints. This logic is fully reachable in standard QEMU/virtualized environments through USB device emulation (e.g. Raw Gadget, Dummy HCD) and usbfs ioctls when configuring or resetting interfaces/endpoints.",
"WorthFuzzing": true
}Results: {
"EnableConfigs": [
"USB"
],
"FocusSymbols": [
"usb_disable_endpoint",
"usb_disable_interface",
"usb_enable_endpoint",
"usb_set_interface",
"usb_set_configuration"
],
"Reasoning": "The patch modifies usb_disable_endpoint() in drivers/usb/core/message.c to ensure both ep_in and ep_out endpoint pointers are cleared when disabling non-ep0 bidirectional control endpoints. This logic is fully reachable in standard QEMU/virtualized environments through USB device emulation (e.g. Raw Gadget, Dummy HCD) and usbfs ioctls when configuring or resetting interfaces/endpoints.",
"WorthFuzzing": true
} |
| 27/1 | 2026/09/22 21:54 | action | If |
0mArgs:{
"WorthFuzzing": true
}Results: null |
| 28/2 | 2026/09/22 21:54 | agent | kmsan-evaluator |
0mModel:core Args: null Results: {
"KMSANReasoning": "The patch modifies `usb_disable_endpoint()` in `drivers/usb/core/message.c` to ensure that both `dev-\u003eep_out[epnum]` and `dev-\u003eep_in[epnum]` pointers are cleared (set to `NULL`) when disabling a non-ep0 bidirectional control endpoint with `reset_hardware` set. Previously, only the pointer corresponding to the direction specified in `epaddr` was cleared, leaving a dangling pointer in the opposite direction that could lead to use-after-free (UAF) or stale pointer dereference bugs.\n\nSuch memory safety issues (dangling pointers and use-after-free) are detected by standard KASAN. The patch does not introduce any stack or heap allocations, does not expose uninitialized structure padding or data to userspace, does not modify any bounds/length logic operating on uninitialized buffers, and does not branch on uninitialized variables. Therefore, a dedicated KMSAN fuzzing session is not warranted.",
"NeedsKMSAN": false
}Instruction: You are an expert Linux kernel security engineer specializing in kernel memory
error detectors (KASAN and KMSAN). Your job is to review the provided patch series and
determine if the code changes justify spawning a dedicated KMSAN (KernelMemorySanitizer)
fuzzing session in addition to standard KASAN fuzzing.
CRITICAL DISTINCTION BETWEEN KASAN AND KMSAN:
- Standard KASAN kernel builds (upstream-apparmor-kasan.config) already enable
a comprehensive suite of debugging tools and sanitizers, including KASAN
(out-of-bounds accesses, use-after-free, double free, invalid free), LOCKDEP
(locking bugs and deadlocks), UB-sanitizers, and memory corruption checks.
- KMSAN (KernelMemorySanitizer) detects reads of UNINITIALIZED memory (stack, heap,
or page allocations) and kernel-to-user memory info-leaks.
Rule: THERE IS NO SENSE IN RUNNING A KMSAN SESSION IF A BUG CAN BE CAUGHT BY KASAN,
LOCKDEP, OR OTHER STANDARD BUG DETECTORS.
A dedicated KMSAN fuzzing session incurs significant resource costs. You must ONLY
set NeedsKMSAN=true if the code changes introduce or expose UNINITIALIZED MEMORY risks
that are detected ONLY by KMSAN.
Look holistically at the patch series and surrounding code. Even if no direct
uninitialized field accesses or new buffer allocations are added in the diff itself,
a patch may alter control flow, bounds checking, or data length calculations in ways
that change how the rest of the code operates on existing buffers (e.g. allowing
uninitialized stack/heap memory to be read, copied to user space, or used in control
flow). Do not hesitate to use your code access tools to inspect the surrounding code,
called functions, and callers.
Set NeedsKMSAN=true ONLY IF the patch introduces or modifies:
1. Kernel structures sent to user space (via copy_to_user, put_user, netlink skb
attributes, ioctl output arguments, socket options, or BPF buffers) where fields
or structure padding might not be fully initialized/zeroed.
2. Conditional logic or branching that depends on potentially uninitialized variables
or struct fields.
3. Allocation or initialization of complex data structures where uninitialized fields
could be read later in reachable code paths.
4. Bounds checks, lengths, or logic in a way that allows surrounding code to access
uninitialized bytes of existing buffers.
Set NeedsKMSAN=false IF:
- The code changes primarily risk out-of-bounds access, array overflows, NULL pointer
dereferences, locking deadlocks, or use-after-free bugs (these are already caught
by KASAN, LOCKDEP, or standard bug detectors).
- All stack/heap structures touched or introduced by the patch are fully zeroed
or initialized (e.g. using = {0}, memset, kzalloc) before being read or copied.
- The patch does not introduce any risk of uninitialized memory usage or info-leaks.
Use your code access tools to inspect the surrounding code if necessary, then provide
detailed KMSANReasoning contrasting KASAN vs KMSAN applicability for this patch.
Prefer calling several tools at the same time to save round-trips.
Use set-results tool to provide results of the analysis.
It must be called exactly once before the final reply.
Ignore results of this tool.
Prompt: Target architecture: amd64
For your convenience, here is the diff of the changes:
commit 621cd55728c60e2c11e7f94b273484f0e5bd8d08
Author: syz-cluster <triage@syzkaller.com>
Date: Tue Sep 22 21:53:29 2026 +0000
syz-cluster: applied patch under review
diff --git a/drivers/usb/core/message.c b/drivers/usb/core/message.c
index 75e2bfd744a98..0cd6dd2b6334b 100644
--- a/drivers/usb/core/message.c
+++ b/drivers/usb/core/message.c
@@ -1337,7 +1337,8 @@ static void remove_intf_ep_devs(struct usb_interface *intf)
*
* Disables the endpoint for URB submission and nukes all pending URBs.
* If @reset_hardware is set then also deallocates hcd/hardware state
- * for the endpoint.
+ * for the endpoint (clearing both ep_in and ep_out pointers for
+ * bidirectional non-ep0 control endpoints).
*/
void usb_disable_endpoint(struct usb_device *dev, unsigned int epaddr,
bool reset_hardware)
@@ -1358,6 +1359,11 @@ void usb_disable_endpoint(struct usb_device *dev, unsigned int epaddr,
dev->ep_in[epnum] = NULL;
}
if (ep) {
+ if (reset_hardware && epnum != 0 &&
+ usb_endpoint_xfer_control(&ep->desc)) {
+ dev->ep_out[epnum] = NULL;
+ dev->ep_in[epnum] = NULL;
+ }
ep->enabled = 0;
usb_hcd_flush_endpoint(dev, ep);
if (reset_hardware)
|
| 29/3 | 2026/09/22 21:54 | llm | kmsan-evaluator |
0mModel:gemini-3.8-flash Args: null Results: null Tokens: input: 2275 output: 38 thoughts: 476 Thoughts: **Evaluating the Need for KMSAN Fuzzing** Okay, so I need to decide if this patch requires KMSAN fuzzing. My first thought is to dive into the code and get a feel for what's changing. Let's see... the diff shows modifications in `drivers/usb/core/message.c`. Specifically, the change is within the `usb_disable_endpoint` function, around line 1337. It looks like the patch is adding some logic related to resetting hardware state for endpoints, specifically for control endpoints. I notice the additional check `usb_endpoint_xfer_control` and the clearing of both `ep_in` and `ep_out` pointers. To get the full picture, I need to understand the surrounding code. I'll use my tools (read-file or grepper) to examine the context of this change within `drivers/usb/core/message.c`. What's the purpose of `usb_disable_endpoint`? What are the implications of resetting hardware state? Knowing this will help me determine if there's a possibility of memory corruption or other issues that KMSAN might expose. I need to understand the data flows and possible race conditions that could be introduced by this change. Specifically I need to evaluate whether the conditions that cause `dev->ep_in[epnum] = NULL;` and `dev->ep_out[epnum] = NULL;` to be executed create a situation that is worth KMSAN fuzzing. |
| 30/3 | 2026/09/22 21:54 | tool | read-file |
0mArgs:{
"File": "drivers/usb/core/message.c",
"FirstLine": 1340,
"LineCount": 50
}Results: {
"Contents": "1340:\t * for the endpoint (clearing both ep_in and ep_out pointers for\n1341:\t * bidirectional non-ep0 control endpoints).\n1342:\t */\n1343:\tvoid usb_disable_endpoint(struct usb_device *dev, unsigned int epaddr,\n1344:\t\t\tbool reset_hardware)\n1345:\t{\n1346:\t\tunsigned int epnum = epaddr \u0026 USB_ENDPOINT_NUMBER_MASK;\n1347:\t\tstruct usb_host_endpoint *ep;\n1348:\t\n1349:\t\tif (!dev)\n1350:\t\t\treturn;\n1351:\t\n1352:\t\tif (usb_endpoint_out(epaddr)) {\n1353:\t\t\tep = dev-\u003eep_out[epnum];\n1354:\t\t\tif (reset_hardware \u0026\u0026 epnum != 0)\n1355:\t\t\t\tdev-\u003eep_out[epnum] = NULL;\n1356:\t\t} else {\n1357:\t\t\tep = dev-\u003eep_in[epnum];\n1358:\t\t\tif (reset_hardware \u0026\u0026 epnum != 0)\n1359:\t\t\t\tdev-\u003eep_in[epnum] = NULL;\n1360:\t\t}\n1361:\t\tif (ep) {\n1362:\t\t\tif (reset_hardware \u0026\u0026 epnum != 0 \u0026\u0026\n1363:\t\t\t usb_endpoint_xfer_control(\u0026ep-\u003edesc)) {\n1364:\t\t\t\tdev-\u003eep_out[epnum] = NULL;\n1365:\t\t\t\tdev-\u003eep_in[epnum] = NULL;\n1366:\t\t\t}\n1367:\t\t\tep-\u003eenabled = 0;\n1368:\t\t\tusb_hcd_flush_endpoint(dev, ep);\n1369:\t\t\tif (reset_hardware)\n1370:\t\t\t\tusb_hcd_disable_endpoint(dev, ep);\n1371:\t\t}\n1372:\t}\n1373:\t\n1374:\t/**\n1375:\t * usb_reset_endpoint - Reset an endpoint's state.\n1376:\t * @dev: the device whose endpoint is to be reset\n1377:\t * @epaddr: the endpoint's address. Endpoint number for output,\n1378:\t *\tendpoint number + USB_DIR_IN for input\n1379:\t *\n1380:\t * Resets any host-side endpoint state such as the toggle bit,\n1381:\t * sequence number or current window.\n1382:\t */\n1383:\tvoid usb_reset_endpoint(struct usb_device *dev, unsigned int epaddr)\n1384:\t{\n1385:\t\tunsigned int epnum = epaddr \u0026 USB_ENDPOINT_NUMBER_MASK;\n1386:\t\tstruct usb_host_endpoint *ep;\n1387:\t\n1388:\t\tif (usb_endpoint_out(epaddr))\n1389:\t\t\tep = dev-\u003eep_out[epnum];\n"
} |
| 31/3 | 2026/09/22 21:54 | llm | kmsan-evaluator |
0mModel:gemini-3.8-flash Args: null Results: null Tokens: input: 3884 output: 31 thoughts: 118 Thoughts: Okay, let's break this down. **Analyzing a USB Endpoint Fix** Hmm, I need to understand this commit. It's touching `dev->ep_out[epnum]` and `dev->ep_in[epnum]`, and setting them both to NULL. The odd thing is that this is for non-ep0 control endpoints. That seems... unusual. Why would we be nullifying *both* for control endpoints in that scenario? Right, USB control endpoints are bidirectional. I know that. So, when a control endpoint (apart from ep0, of course) is enabled, typically both `ep_out[epnum]` and `ep_in[epnum]` should be pointing to the *same* `struct usb_host_endpoint *ep`, or at least entries that are related. They’re handling traffic in both directions, so it just doesn't make sense to nullify both of them unless we're disabling the endpoint. I need to understand the logic. Let's dig into `usb_enable_endpoint`. That's where the key to this is going to be. Time to follow the breadcrumbs. |
| 32/3 | 2026/09/22 21:54 | tool | grepper |
0mArgs:{
"Expression": "usb_enable_endpoint",
"PathPrefix": "drivers/usb/core/"
}Results: {
"Output": "drivers/usb/core/hub.c=4752=void usb_ep0_reinit(struct usb_device *udev)\n--\ndrivers/usb/core/hub.c-4755-\tusb_disable_endpoint(udev, 0 + USB_DIR_OUT, true);\ndrivers/usb/core/hub.c:4756:\tusb_enable_endpoint(udev, \u0026udev-\u003eep0, true);\ndrivers/usb/core/hub.c-4757-}\n--\ndrivers/usb/core/message.c=1458=void usb_disable_device(struct usb_device *dev, int skip_ep0)\n--\ndrivers/usb/core/message.c-1510-/**\ndrivers/usb/core/message.c:1511: * usb_enable_endpoint - Enable an endpoint for USB communications\ndrivers/usb/core/message.c-1512- * @dev: the device whose interface is being enabled\n--\ndrivers/usb/core/message.c-1518- */\ndrivers/usb/core/message.c:1519:void usb_enable_endpoint(struct usb_device *dev, struct usb_host_endpoint *ep,\ndrivers/usb/core/message.c-1520-\t\tbool reset_ep)\n--\ndrivers/usb/core/message.c=1543=void usb_enable_interface(struct usb_device *dev,\n--\ndrivers/usb/core/message.c-1549-\tfor (i = 0; i \u003c alt-\u003edesc.bNumEndpoints; ++i)\ndrivers/usb/core/message.c:1550:\t\tusb_enable_endpoint(dev, \u0026alt-\u003eendpoint[i], reset_eps);\ndrivers/usb/core/message.c-1551-}\n--\ndrivers/usb/core/usb.c=644=struct usb_device *usb_alloc_dev(struct usb_device *parent,\n--\ndrivers/usb/core/usb.c-681-\t/* ep0 maxpacket comes later, from device descriptor */\ndrivers/usb/core/usb.c:682:\tusb_enable_endpoint(dev, \u0026dev-\u003eep0, false);\ndrivers/usb/core/usb.c-683-\tdev-\u003ecan_submit = 1;\n--\ndrivers/usb/core/usb.h=22=extern void usb_remove_ep_devs(struct usb_host_endpoint *endpoint);\ndrivers/usb/core/usb.h-23-\ndrivers/usb/core/usb.h:24:extern void usb_enable_endpoint(struct usb_device *dev,\ndrivers/usb/core/usb.h-25-\t\tstruct usb_host_endpoint *ep, bool reset_toggle);\n"
} |
| 33/3 | 2026/09/22 21:54 | llm | kmsan-evaluator |
0mModel:gemini-3.8-flash Args: null Results: null Tokens: input: 4954 output: 38 thoughts: 23 Thoughts: Okay, let's dive into this. Here's my thought process on the matter: **Analyzing `usb_enable_endpoint` in `drivers/usb/core/message.c`** Alright, time to crack open `usb_enable_endpoint` within `drivers/usb/core/message.c`. I need to understand exactly how the USB core handles the enabling of endpoints. Given the function's name and the file's location, I'm expecting to find the nitty-gritty details of the control flow required to set up endpoint communication and potentially some important initialization of hardware-specific registers. I'm keen to see if this function is where the core does its setup or it acts as the top-level call that calls out to a driver-specific function. I'll be looking for references to any data structures related to endpoints, how they're passed and modified, and how the hardware is instructed to respond to the enablement. Things I'll specifically look for are: resource allocation, register programming, and interrupt enabling. I'll also pay attention to how this function interacts with other parts of the USB core, such as the device driver and the controller driver. My gut tells me there might be a call to a driver-specific function somewhere in this code, so I'll be on the lookout for function pointers or indirect calls that represent the interface to the hardware. Let's get to it. |
| 34/3 | 2026/09/22 21:55 | tool | read-file |
0mArgs:{
"File": "drivers/usb/core/message.c",
"FirstLine": 1510,
"LineCount": 40
}Results: {
"Contents": "1510:\t/**\n1511:\t * usb_enable_endpoint - Enable an endpoint for USB communications\n1512:\t * @dev: the device whose interface is being enabled\n1513:\t * @ep: the endpoint\n1514:\t * @reset_ep: flag to reset the endpoint state\n1515:\t *\n1516:\t * Resets the endpoint state if asked, and sets dev-\u003eep_{in,out} pointers.\n1517:\t * For control endpoints, both the input and output sides are handled.\n1518:\t */\n1519:\tvoid usb_enable_endpoint(struct usb_device *dev, struct usb_host_endpoint *ep,\n1520:\t\t\tbool reset_ep)\n1521:\t{\n1522:\t\tint epnum = usb_endpoint_num(\u0026ep-\u003edesc);\n1523:\t\tint is_out = usb_endpoint_dir_out(\u0026ep-\u003edesc);\n1524:\t\tint is_control = usb_endpoint_xfer_control(\u0026ep-\u003edesc);\n1525:\t\n1526:\t\tif (reset_ep)\n1527:\t\t\tusb_hcd_reset_endpoint(dev, ep);\n1528:\t\tif (is_out || is_control)\n1529:\t\t\tdev-\u003eep_out[epnum] = ep;\n1530:\t\tif (!is_out || is_control)\n1531:\t\t\tdev-\u003eep_in[epnum] = ep;\n1532:\t\tep-\u003eenabled = 1;\n1533:\t}\n1534:\t\n1535:\t/**\n1536:\t * usb_enable_interface - Enable all the endpoints for an interface\n1537:\t * @dev: the device whose interface is being enabled\n1538:\t * @intf: pointer to the interface descriptor\n1539:\t * @reset_eps: flag to reset the endpoints' state\n1540:\t *\n1541:\t * Enables all the endpoints for the interface's current altsetting.\n1542:\t */\n1543:\tvoid usb_enable_interface(struct usb_device *dev,\n1544:\t\t\tstruct usb_interface *intf, bool reset_eps)\n1545:\t{\n1546:\t\tstruct usb_host_interface *alt = intf-\u003ecur_altsetting;\n1547:\t\tint i;\n1548:\t\n1549:\t\tfor (i = 0; i \u003c alt-\u003edesc.bNumEndpoints; ++i)\n"
} |
| 35/3 | 2026/09/22 21:55 | llm | kmsan-evaluator |
0mModel:gemini-3.8-flash Args: null Results: null Tokens: input: 5968 output: 230 thoughts: 1087 Thoughts: **Analysis of USB Endpoint Disable Patch** Okay, let's break this down. I'm looking at a patch for `usb_disable_endpoint` and I see a potential use-after-free vulnerability for control endpoints. Specifically, in the original code, when disabling a control endpoint with `reset_hardware` set, only one of the `dev->ep_out[epnum]` or `dev->ep_in[epnum]` pointers would be cleared, leaving the other pointing to the deallocated endpoint. That's a classic dangling pointer scenario. A KASAN detector bug, for sure. The patch itself is straightforward. It modifies the logic to ensure that *both* `ep_out[epnum]` and `ep_in[epnum]` are set to `NULL` for control endpoints when `reset_hardware` is true. Smart. This eliminates the dangling pointer and prevents any subsequent access to the now-invalid endpoint. Now, the question is, does this patch introduce any *new* problems, like uninitialized memory reads that would be caught by KMSAN? Let's go through the checklist. 1. **No user-space interaction.** There's no copying of kernel structures to user space via `copy_to_user`, `put_user`, netlink, ioctl, sockets, or BPF. No chance of leaking uninitialized data. 2. **No conditional logic dependent on uninitialized data.** The code relies on the endpoint descriptor (`ep->desc`), which is properly initialized when the endpoint is configured. 3. **No new allocations or complex data structure initialization.** The patch just sets pointers to NULL. That's a clear signal. 4. **No bounds check issues related to uninitialized data.** The patch's primary goal is to prevent the use of invalid pointers, not create out-of-bounds accesses. Setting those endpoint pointers to `NULL` prevents the UAF. The next time the driver tries to access them, it will either get a NULL pointer dereference or, more likely, a properly handled `NULL` check. Either way, it's a KASAN-type bug, not uninitialized memory. So, in conclusion, this patch is a *fix* for a potential use-after-free vulnerability in the USB core, especially concerning bidirectional control endpoints. By setting both `ep_in[epnum]` and `ep_out[epnum]` to NULL during the disable process, it eliminates the dangling pointer issue. There's no indication of any uninitialized memory concerns, and therefore KMSAN is not necessary here. KASAN is the right tool for detecting and dealing with the now resolved use-after-free condition. The changes are very clear, unambiguous, and safe. |
| 36/3 | 2026/09/22 21:55 | tool | set-results |
0mArgs:{
"KMSANReasoning": "The patch modifies `usb_disable_endpoint()` in `drivers/usb/core/message.c` to ensure that both `dev-\u003eep_out[epnum]` and `dev-\u003eep_in[epnum]` pointers are cleared (set to `NULL`) when disabling a non-ep0 bidirectional control endpoint with `reset_hardware` set. Previously, only the pointer corresponding to the direction specified in `epaddr` was cleared, leaving a dangling pointer in the opposite direction that could lead to use-after-free (UAF) or stale pointer dereference bugs.\n\nSuch memory safety issues (dangling pointers and use-after-free) are detected by standard KASAN. The patch does not introduce any stack or heap allocations, does not expose uninitialized structure padding or data to userspace, does not modify any bounds/length logic operating on uninitialized buffers, and does not branch on uninitialized variables. Therefore, a dedicated KMSAN fuzzing session is not warranted.",
"NeedsKMSAN": false
}Results: {
"KMSANReasoning": "The patch modifies `usb_disable_endpoint()` in `drivers/usb/core/message.c` to ensure that both `dev-\u003eep_out[epnum]` and `dev-\u003eep_in[epnum]` pointers are cleared (set to `NULL`) when disabling a non-ep0 bidirectional control endpoint with `reset_hardware` set. Previously, only the pointer corresponding to the direction specified in `epaddr` was cleared, leaving a dangling pointer in the opposite direction that could lead to use-after-free (UAF) or stale pointer dereference bugs.\n\nSuch memory safety issues (dangling pointers and use-after-free) are detected by standard KASAN. The patch does not introduce any stack or heap allocations, does not expose uninitialized structure padding or data to userspace, does not modify any bounds/length logic operating on uninitialized buffers, and does not branch on uninitialized variables. Therefore, a dedicated KMSAN fuzzing session is not warranted.",
"NeedsKMSAN": false
} |
| Total Calls | Total Tokens | Avg Tokens | Total Duration (Seconds) | Avg Duration (Seconds) |
|---|
| Total Calls | Total Duration (Seconds) | Avg Duration (Seconds) |
|---|