syzbot
kernel panic: corrupted stack end in sys_ppoll
Status: closed as invalid on 2026/11/08 10:18
Subsystems:
fs
Labels:
prio:normal
[Documentation on labels]
First crash: 4d01h, last: 4d01h
✨ AI-generated root cause summary:
A root user can mmap an active PCI device's BAR MMIO memory through sysfs (/sys/bus/pci/devices/0000:00:02.0/resource0) via pci_mmap_resource(). Because CONFIG_IO_STRICT_DEVMEM is not enabled, iomem_is_exclusive() permits mapping busy MMIO regions that lack the explicit IORESOURCE_EXCLUSIVE flag. Writing arbitrary fuzzed data into the device's live MMIO space causes hardware aborts (triggering an ARM64 Synchronous External Abort in do_sea() and setting TAINT_MACHINE_CHECK) and corrupts active device/DMA state, leading to rogue memory writes that overwrite STACK_END_MAGIC on a background thread's stack and triggering a panic in schedule_debug().
▶
▼
✨ Full AI root cause analysis
Root Cause Analysis
1. Functions, Structs, and Files Involved
2. Trigger Mechanism and Lifecycle / Invariant Violation
-
Unrestricted MMIO Resource Mapping (drivers/pci/pci-sysfs.c, kernel/resource.c):
-
MMIO Overwrite & Hardware Abort (arch/arm64/mm/fault.c):
- The reproducer writes fuzzed data into the range
0x20001b00–0x200023f8, which falls directly within the 0x20001000–0x20003000 mmapped MMIO page.
- Accessing undefined/unimplemented register offsets in the device's MMIO aperture causes the bus interconnect to return an error response, triggering an ARM64 Synchronous External Abort (SEA).
- This abort is processed by
do_sea() in arch/arm64/mm/fault.c, which calls add_taint(TAINT_MACHINE_CHECK, LOCKDEP_STILL_OK), explaining the Tainted: [M]=MACHINE_CHECK taint flag on the system.
-
Rogue DMA and Kernel Stack Corruption (kernel/sched/core.c):
- Writing garbage to control, queue descriptor, or doorbell registers of an active PCI device (a bus-mastering network controller servicing network traffic on the VM) corrupts the device's internal state machine and DMA descriptor rings.
- As the device attempts to process receive or transmit traffic (such as DHCP packets handled by
dhcpcd), it initiates rogue DMA transfers into arbitrary physical memory addresses.
- One or more writes land on the physical page hosting the bottom of the kernel stack for PID 4402 (
dhcpcd), corrupting the STACK_END_MAGIC canary (0x57AC6E9D) stored at end_of_stack(task).
- When
dhcpcd subsequently blocks during ppoll (poll_schedule_timeout -> schedule -> __schedule), schedule_debug() evaluates task_stack_end_corrupted(prev), detects that *end_of_stack(prev) != STACK_END_MAGIC, and triggers the kernel panic:
"Kernel panic - not syncing: corrupted stack end detected inside scheduler".
Sample crash report:
* Struck through repros no longer work on HEAD.