general protection fault in __iterate_interfaces (2)

Status: moderation: reported on 2026/11/12 04:37
Subsystems: wireless
Labels: prio:normal
[Documentation on labels]
Reported-by: syzbot+ead5e867b6a220904570@syzkaller.appspotmail.com
First crash: 4d01h, last: 4d01h
✨ AI-generated root cause summary:

Privileged userspace wrote to PCI configuration space via /proc/bus/pci (proc_bus_pci_write -> pci_user_write_config_dword), which reconfigured PCI host bridge / chipset registers (such as PAM/SMRAM/BAR registers on the QEMU Q35 chipset). This disrupted physical memory routing and caused memory reads in the affected RAM range to return all-ones (0xffffffffffffffff). Upon re-enabling interrupts at the end of pci_user_write_config_dword, a timer interrupt fired and executed mac80211_hwsim_beacon -> mac80211_hwsim_tx_frame_no_nl -> mac80211_hwsim_addr_match -> __iterate_interfaces. When __iterate_interfaces attempted to read local->interfaces, it received 0xffffffffffffffff and subsequently dereferenced sdata->vif.type at offset 0x1e90, crashing with a general protection fault.

▶ ▼ ✨ Full AI root cause analysis
Based on kernel commit d164c7d754f0:

Root Cause Analysis

1. Overview and Manifestation

The reported crash is a General Protection Fault (#GP) on a non-canonical address (0xdffffc00000003d1), reported by KASAN as a suspected user memory access in the range [0x0000000000001e88 - 0x0000000000001e8f].

The fault occurs in __iterate_interfaces() (net/mac80211/util.c:757):

static void __iterate_interfaces(struct ieee80211_local *local,
				 u32 iter_flags,
				 void (*iterator)(void *data, u8 *mac,
						  struct ieee80211_vif *vif),
				 void *data)
{
	struct ieee80211_sub_if_data *sdata;
	bool active_only = iter_flags & IEEE80211_IFACE_ITER_ACTIVE;

	list_for_each_entry_rcu(sdata, &local->interfaces, list,
				lockdep_is_held(&local->iflist_mtx) ||
				lockdep_is_held(&local->hw.wiphy->mtx)) {
		switch (sdata->vif.type) {

In the disassembly of __iterate_interfaces():

1c:  4c 8d a3 90 1e 00 00   lea    0x1e90(%rbx),%r12
23:  4c 89 e0               mov    %r12,%rax
26:  48 c1 e8 03            shr    $0x3,%rax
2a:  0f b6 04 28            movzbl (%rax,%rbp,1),%eax  <-- trapping instruction
...
3a:  8b bb 90 1e 00 00      mov    0x1e90(%rbx),%edi

Here, %rbx holds sdata, which was read from &local->interfaces (local->interfaces.next). Offset 0x1e90 corresponds to sdata->vif.type (offsetof(struct ieee80211_sub_if_data, vif.type) == 0x1e90). The registers show:

  • RBX: ffffffffffffffff
  • R12 = RBX + 0x1e90 = 0x0000000000001e8f
  • RAX = R12 >> 3 = 0x00000000000003d1
  • RBP = 0xdffffc0000000000 (KASAN shadow memory base)
  • Trapping address: RAX + RBP = 0xdffffc00000003d1

The value read for sdata (local->interfaces.next) was 0xffffffffffffffff (-1).

2. Root Cause Mechanism

Inspection of the stack trace reveals two concurrent activities:

  1. Task Context (Process syz.3.228, UID 0): The process was executing a write() system call on a PCI config space file in /proc/bus/pci:

    proc_reg_write() -> proc_bus_pci_write() -> pci_user_write_config_dword()
    

    In pci_user_write_config_dword() (drivers/pci/access.c:278), the kernel acquires raw_spin_lock_irq(&pci_lock), performs the configuration write to the target PCI device via dev->bus->ops->write(), and then releases the lock via raw_spin_unlock_irq(&pci_lock). In _raw_spin_unlock_irq(), the sti instruction re-enables CPU interrupts.

  2. Hardware / Chipset Configuration Corruption: Writing arbitrary configuration data into the PCI configuration space of root/host bridge devices (specifically on QEMU Q35 / ICH9 chipset, device 00:00.0) allows privileged userspace to reprogram memory controller routing registers, such as PAM (Programmable Attribute Map), SMRAM/TSEG, or BARs. Reprogramming these registers unmaps or aliases the underlying physical RAM pages. On x86 / PCI platforms, reads directed to unmapped or aborted memory spaces return all-ones (~0UL or 0xffffffffffffffff).

  3. Interrupt Context (<IRQ>): Immediately upon execution of the sti instruction in _raw_spin_unlock_irq(), an APIC timer interrupt fired. The timer softirq executed mac80211_hwsim_beacon(), which iterates active interfaces and transmits a simulated beacon frame:

    mac80211_hwsim_beacon()
      -> ieee80211_iterate_active_interfaces_atomic()
        -> mac80211_hwsim_beacon_tx()
          -> mac80211_hwsim_tx_frame()
            -> mac80211_hwsim_tx_frame_no_nl()
              -> mac80211_hwsim_addr_match()
                -> ieee80211_iterate_active_interfaces_atomic()
                  -> __iterate_interfaces()
    

    Inside __iterate_interfaces(), the list head &local->interfaces (R14 = 0xffff888059542a98, physical address 0x59542a98) fell within the physical address range whose mapping was corrupted by the PCI configuration write. Reading local->interfaces.next yielded 0xffffffffffffffff instead of a valid pointer. The function dereferenced sdata->vif.type at 0xffffffffffffffff + 0x1e90 = 0x1e8f, leading to the crash.

3. Summary

The bug is caused by allowing unrestricted writes to PCI host bridge configuration space via /proc/bus/pci (drivers/pci/proc.c and drivers/pci/access.c), which can corrupt chipset physical memory routing in virtualization environments. When memory reads subsequently return bus-abort all-ones (0xffffffffffffffff), kernel pointer dereferences in subsequent memory accesses crash the system.

▶ ▼ ✨ AI Jobs (2)
ID Workflow Result Correct Bug Created Started Finished Revision
dcf4d501 repro-c 💥 general protection fault in __iterate_interfaces (2) 2026/11/11 00:36 2026/11/11 00:36 2026/11/11 08:35 d3056657
70e6f5b5 assessment-security DenialOfService: ✅ Exploitable: ✅ FilesystemTrigger: ❌ FuzzingArtifact: ❌ MemoryCorruption: ✅ NetworkNeedsSetup: ❌ NetworkTrigger: ❌ PeripheralTrigger: ❌ RemoteTrigger: ❌ Unprivileged: ❌ UserNamespace: ❌ VMGuestTrigger: ❌ VMHostTrigger: ❌ ❓ general protection fault in __iterate_interfaces (2) 2026/11/08 03:13 2026/11/08 03:13 2026/11/08 04:14 5cecaf1f
▶ ▼ Similar bugs (1)
Kernel Title Rank 🛈 Repro Cause bisect Fix bisect Count Last Reported Patched Status
upstream general protection fault in __iterate_interfaces reiserfs 2 syz, C error 1 1263d 1259d 0/29 auto-obsoleted due to no activity on 2023/12/25 00:53

Sample crash report:
Oops: general protection fault, probably for non-canonical address 0xdffffc00000003d1: 0000 [#1] SMP KASAN NOPTI
KASAN: probably user-memory-access in range [0x0000000000001e88-0x0000000000001e8f]
CPU: 3 UID: 0 PID: 6876 Comm: syz.3.228 Tainted: G             L      syzkaller #0 PREEMPT(full) 
Tainted: [L]=SOFTLOCKUP
Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
RIP: 0010:__iterate_interfaces+0x9b/0x650 net/mac80211/util.c:757
Code: ff df 48 83 c0 68 48 89 44 24 28 48 c1 e8 03 48 01 e8 48 89 44 24 30 e8 03 f8 9e f6 4c 8d a3 90 1e 00 00 4c 89 e0 48 c1 e8 03 <0f> b6 04 28 84 c0 74 08 3c 03 0f 8e 16 05 00 00 8b bb 90 1e 00 00
RSP: 0018:ffffc90000708a10 EFLAGS: 00010207
RAX: 00000000000003d1 RBX: ffffffffffffffff RCX: 0000000000000102
RDX: ffff88802a720000 RSI: ffffffff8b6f843d RDI: ffffc90000708ad6
RBP: dffffc0000000000 R08: 0000000000000000 R09: 0000000000000000
R10: ffff88804b6c99ef R11: 0000000000000001 R12: 0000000000001e8f
R13: 0000000000000002 R14: ffff888059542a98 R15: 0000000000000002
FS:  00007fc9933ce6c0(0000) GS:ffff8880d4775000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00005555734a20a8 CR3: 000000002de12000 CR4: 0000000000352ef0
Call Trace:
 <IRQ>
 ieee80211_iterate_active_interfaces_atomic+0x71/0x1b0 net/mac80211/util.c:811
 mac80211_hwsim_addr_match+0x123/0x180 drivers/net/wireless/virtual/mac80211_hwsim_main.c:1479
 mac80211_hwsim_tx_frame_no_nl+0xcbe/0x1840 drivers/net/wireless/virtual/mac80211_hwsim_main.c:2032
 mac80211_hwsim_tx_frame+0x1b7/0x250 drivers/net/wireless/virtual/mac80211_hwsim_main.c:2440
 __mac80211_hwsim_beacon_tx drivers/net/wireless/virtual/mac80211_hwsim_main.c:2453 [inline]
 mac80211_hwsim_beacon_tx+0x56d/0xa00 drivers/net/wireless/virtual/mac80211_hwsim_main.c:2516
 __iterate_interfaces+0x2e6/0x650 net/mac80211/util.c:775
 ieee80211_iterate_active_interfaces_atomic+0x71/0x1b0 net/mac80211/util.c:811
 mac80211_hwsim_beacon+0xe5/0x2a0 drivers/net/wireless/virtual/mac80211_hwsim_main.c:2548
 __run_hrtimer kernel/time/hrtimer.c:2079 [inline]
 __hrtimer_run_queues+0x448/0x9a0 kernel/time/hrtimer.c:2136
 hrtimer_run_softirq+0x1ca/0x360 kernel/time/hrtimer.c:2153
 handle_softirqs+0x216/0xa20 kernel/softirq.c:669
 __do_softirq kernel/softirq.c:703 [inline]
 invoke_softirq kernel/softirq.c:542 [inline]
 __irq_exit_rcu+0x178/0x220 kernel/softirq.c:786
 irq_exit_rcu+0x9/0x30 kernel/softirq.c:809
 instr_sysvec_apic_timer_interrupt arch/x86/kernel/apic/apic.c:1062 [inline]
 sysvec_apic_timer_interrupt+0xa3/0xc0 arch/x86/kernel/apic/apic.c:1062
 </IRQ>
 <TASK>
 asm_sysvec_apic_timer_interrupt+0x1a/0x20 arch/x86/include/asm/idtentry.h:674
RIP: 0010:__raw_spin_unlock_irq include/linux/spinlock_api_smp.h:220 [inline]
RIP: 0010:_raw_spin_unlock_irq+0x29/0x50 kernel/locking/spinlock.c:229
Code: 90 f3 0f 1e fa 53 48 8b 74 24 08 48 89 fb 48 83 c7 18 e8 8a 1b f7 f5 48 89 df e8 12 72 f7 f5 e8 8d 86 24 f6 fb bf 01 00 00 00 <e8> c2 3a e6 f5 65 48 83 3d 51 64 c8 09 00 74 06 5b e9 01 4d 00 00
RSP: 0018:ffffc9000c01fc28 EFLAGS: 00000202
RAX: 000000000000008f RBX: ffffffff90cc2ac0 RCX: 0000000000000080
RDX: 0000000000000001 RSI: ffffffff8e629989 RDI: 0000000000000001
RBP: 0000000000000060 R08: 0000000000000001 R09: 0000000000000000
R10: 0000000000000001 R11: 0000000000000000 R12: ffff888024933000
R13: 000000004ce5e1cb R14: ffffffff8be39d00 R15: 0000000000000019
 pci_user_write_config_dword+0x150/0x230 drivers/pci/access.c:278
 proc_bus_pci_write+0x531/0x5e0 drivers/pci/proc.c:173
 pde_write fs/proc/inode.c:330 [inline]
 proc_reg_write+0x240/0x330 fs/proc/inode.c:342
 vfs_write+0x2aa/0x1050 fs/read_write.c:685
 ksys_write+0x12a/0x250 fs/read_write.c:739
 do_syscall_x64 arch/x86/entry/syscall_64.c:61 [inline]
 do_syscall_64+0x123/0x790 arch/x86/entry/syscall_64.c:84
 entry_SYSCALL_64_after_hwframe+0x77/0x7f
RIP: 0033:0x7fc99259fb19
Code: Unable to access opcode bytes at 0x7fc99259faef.
RSP: 002b:00007fc9933ce028 EFLAGS: 00000246 ORIG_RAX: 0000000000000001
RAX: ffffffffffffffda RBX: 00007fc992826180 RCX: 00007fc99259fb19
RDX: 000000000000007d RSI: 0000200000000240 RDI: 0000000000000008
RBP: 00007fc992637b70 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000
R13: 00007fc992826218 R14: 00007fc992826180 R15: 00007ffc383856d8
 </TASK>
Modules linked in:
---[ end trace 0000000000000000 ]---
RIP: 0010:__iterate_interfaces+0x9b/0x650 net/mac80211/util.c:757
Code: ff df 48 83 c0 68 48 89 44 24 28 48 c1 e8 03 48 01 e8 48 89 44 24 30 e8 03 f8 9e f6 4c 8d a3 90 1e 00 00 4c 89 e0 48 c1 e8 03 <0f> b6 04 28 84 c0 74 08 3c 03 0f 8e 16 05 00 00 8b bb 90 1e 00 00
RSP: 0018:ffffc90000708a10 EFLAGS: 00010207
RAX: 00000000000003d1 RBX: ffffffffffffffff RCX: 0000000000000102
RDX: ffff88802a720000 RSI: ffffffff8b6f843d RDI: ffffc90000708ad6
RBP: dffffc0000000000 R08: 0000000000000000 R09: 0000000000000000
R10: ffff88804b6c99ef R11: 0000000000000001 R12: 0000000000001e8f
R13: 0000000000000002 R14: ffff888059542a98 R15: 0000000000000002
FS:  00007fc9933ce6c0(0000) GS:ffff8880d4775000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00007fc99259faef CR3: 000000002de12000 CR4: 0000000000352ef0
----------------
Code disassembly (best guess):
   0:	ff                   	lcall  (bad)
   1:	df 48 83             	fisttps -0x7d(%rax)
   4:	c0 68 48 89          	shrb   $0x89,0x48(%rax)
   8:	44 24 28             	rex.R and $0x28,%al
   b:	48 c1 e8 03          	shr    $0x3,%rax
   f:	48 01 e8             	add    %rbp,%rax
  12:	48 89 44 24 30       	mov    %rax,0x30(%rsp)
  17:	e8 03 f8 9e f6       	call   0xf69ef81f
  1c:	4c 8d a3 90 1e 00 00 	lea    0x1e90(%rbx),%r12
  23:	4c 89 e0             	mov    %r12,%rax
  26:	48 c1 e8 03          	shr    $0x3,%rax
* 2a:	0f b6 04 28          	movzbl (%rax,%rbp,1),%eax <-- trapping instruction
  2e:	84 c0                	test   %al,%al
  30:	74 08                	je     0x3a
  32:	3c 03                	cmp    $0x3,%al
  34:	0f 8e 16 05 00 00    	jle    0x550
  3a:	8b bb 90 1e 00 00    	mov    0x1e90(%rbx),%edi

Crashes (1):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2026/11/08 03:13 upstream d164c7d754f0 5cecaf1f .config console log report info [disk image (non-bootable)] [vmlinux] [kernel image] ci-qemu-upstream general protection fault in __iterate_interfaces
* Struck through repros no longer work on HEAD.