syzbot


general protection fault in __xsk_map_flush

Status: fixed on 2024/08/23 02:59
Subsystems: bpf net
[Documentation on labels]
Reported-by: syzbot+61a1cfc2b6632363d319@syzkaller.appspotmail.com
Fix commit: 9da49aa80d68 tun: Add missing bpf_net_ctx_clear() in do_xdp_generic()
First crash: 55d, last: 37d
Cause bisection: introduced by (bisect log) :
commit fecef4cd42c689a200bdd39e6fffa71475904bc1
Author: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Date: Thu Jul 4 14:48:15 2024 +0000

  tun: Assign missing bpf_net_context.

Crash: general protection fault in __dev_flush (log)
Repro: C syz .config
  
Discussions (2)
Title Replies (including bot) Last reply
[PATCH net] tun: Add missing bpf_net_ctx_clear() in do_xdp_generic() 7 (7) 2024/07/29 10:08
[syzbot] [bpf?] [net?] general protection fault in __xsk_map_flush 0 (5) 2024/07/22 16:12
Last patch testing requests (4)
Created Duration User Patch Repo Result
2024/07/22 16:12 28m aha310510@gmail.com patch upstream report log
2024/07/22 14:57 57m aha310510@gmail.com patch upstream report log
2024/07/22 14:49 53m aha310510@gmail.com patch upstream report log
2024/07/22 12:53 34m aha310510@gmail.com upstream report log

Sample crash report:
Oops: general protection fault, probably for non-canonical address 0xe000140493916901: 0000 [#1] PREEMPT SMP KASAN PTI
KASAN: maybe wild-memory-access in range [0x0000c0249c8b4808-0x0000c0249c8b480f]
CPU: 1 UID: 0 PID: 5098 Comm: syz-executor400 Not tainted 6.10.0-rc7-next-20240712-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 06/07/2024
RIP: 0010:xskq_prod_submit net/xdp/xsk_queue.h:436 [inline]
RIP: 0010:xsk_flush net/xdp/xsk.c:331 [inline]
RIP: 0010:__xsk_map_flush+0x95/0x2b0 net/xdp/xsk.c:393
Code: 24 10 49 8d 5f e8 48 89 d8 48 c1 e8 03 42 80 3c 28 00 74 08 48 89 df e8 d9 ea 81 f6 48 8b 1b 48 8d 7b 08 48 89 f8 48 c1 e8 03 <42> 0f b6 04 28 84 c0 0f 85 72 01 00 00 8b 6b 08 48 83 c3 10 48 89
RSP: 0018:ffffc90000a18ae8 EFLAGS: 00010202
RAX: 0000180493916901 RBX: 0000c0249c8b4800 RCX: ffff888029608000
RDX: 0000000080000101 RSI: 0000000000000010 RDI: 0000c0249c8b4808
RBP: dffffc0000000000 R08: ffffffff896d0c9a R09: 1ffffffff1f5ffad
R10: dffffc0000000000 R11: fffffbfff1f5ffae R12: 0000000000000000
R13: dffffc0000000000 R14: 0000000000000010 R15: ffffffff8173aee3
FS:  000055557b0fb380(0000) GS:ffff8880b9500000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 000055557b0fbca8 CR3: 000000007eb32000 CR4: 00000000003506f0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
Call Trace:
 <IRQ>
 xdp_do_check_flushed+0x18e/0x240 net/core/filter.c:4308
 __napi_poll+0xe4/0x490 net/core/dev.c:6774
 napi_poll net/core/dev.c:6840 [inline]
 net_rx_action+0x89b/0x1240 net/core/dev.c:6962
 handle_softirqs+0x2c4/0x970 kernel/softirq.c:554
 __do_softirq kernel/softirq.c:588 [inline]
 invoke_softirq kernel/softirq.c:428 [inline]
 __irq_exit_rcu+0xf4/0x1c0 kernel/softirq.c:637
 irq_exit_rcu+0x9/0x30 kernel/softirq.c:649
 instr_sysvec_apic_timer_interrupt arch/x86/kernel/apic/apic.c:1043 [inline]
 sysvec_apic_timer_interrupt+0xa6/0xc0 arch/x86/kernel/apic/apic.c:1043
 </IRQ>
 <TASK>
 asm_sysvec_apic_timer_interrupt+0x1a/0x20 arch/x86/include/asm/idtentry.h:702
RIP: 0010:console_flush_all+0x9f7/0xf50 kernel/printk/printk.c:3103
Code: 20 00 90 0f 0b 90 e9 f3 f9 ff ff e8 c3 1b 20 00 e8 7e 56 20 0a 4d 85 f6 74 c0 e8 b4 1b 20 00 fb 49 bd 00 00 00 00 00 fc ff df <43> 80 3c 2f 00 48 8b 5c 24 30 74 08 48 89 df e8 d5 a1 87 00 4c 8b
RSP: 0018:ffffc90003527880 EFLAGS: 00000293
RAX: ffffffff8173af3c RBX: 0000000000000000 RCX: ffff888029608000
RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000000000000
RBP: ffffc90003527a10 R08: ffffffff8173aee3 R09: 1ffffffff1f5ffad
R10: dffffc0000000000 R11: fffffbfff1f5ffae R12: ffffffff8eb30c00
R13: dffffc0000000000 R14: 0000000000000200 R15: 1ffffffff1d6618b
 console_unlock+0x13b/0x4d0 kernel/printk/printk.c:3173
 vprintk_emit+0x7a1/0x900 kernel/printk/printk.c:2423
 _printk+0xd5/0x120 kernel/printk/printk.c:2450
 show_opcodes+0x148/0x170 arch/x86/kernel/dumpstack.c:123
 show_signal_msg arch/x86/mm/fault.c:775 [inline]
 __bad_area_nosemaphore+0x5f2/0x770 arch/x86/mm/fault.c:818
 handle_page_fault arch/x86/mm/fault.c:1481 [inline]
 exc_page_fault+0x61d/0x8c0 arch/x86/mm/fault.c:1539
 asm_exc_page_fault+0x26/0x30 arch/x86/include/asm/idtentry.h:623
RIP: 0033:0x7f9fe69c315e
Code: fd d7 c9 0f bc d1 c5 fe 7f 27 c5 fe 7f 6f 20 c5 fe 7f 77 40 c5 fe 7f 7f 60 49 83 c0 1f 49 29 d0 48 8d 7c 17 61 e9 d2 04 00 00 <c5> fe 6f 1e c5 fe 6f 56 20 c5 fd 74 cb c5 fd d7 d1 49 83 f8 21 0f
RSP: 002b:00007ffce01d48e8 EFLAGS: 00010287
RAX: 00007ffce01d4900 RBX: 0000000000000000 RCX: 0000000000000000
RDX: 00000000000003ff RSI: 0000000000000000 RDI: 00007ffce01d4900
RBP: 00007ffce01d4900 R08: 00000000000003ff R09: 00007ffce01d4e48
R10: 00007ffce01d4e48 R11: 0000000000000246 R12: 6666666666666667
R13: 0000000000000000 R14: 00007ffce01d4d50 R15: 00007ffce01d4d40
 </TASK>
Modules linked in:
---[ end trace 0000000000000000 ]---
RIP: 0010:xskq_prod_submit net/xdp/xsk_queue.h:436 [inline]
RIP: 0010:xsk_flush net/xdp/xsk.c:331 [inline]
RIP: 0010:__xsk_map_flush+0x95/0x2b0 net/xdp/xsk.c:393
Code: 24 10 49 8d 5f e8 48 89 d8 48 c1 e8 03 42 80 3c 28 00 74 08 48 89 df e8 d9 ea 81 f6 48 8b 1b 48 8d 7b 08 48 89 f8 48 c1 e8 03 <42> 0f b6 04 28 84 c0 0f 85 72 01 00 00 8b 6b 08 48 83 c3 10 48 89
RSP: 0018:ffffc90000a18ae8 EFLAGS: 00010202
RAX: 0000180493916901 RBX: 0000c0249c8b4800 RCX: ffff888029608000
RDX: 0000000080000101 RSI: 0000000000000010 RDI: 0000c0249c8b4808
RBP: dffffc0000000000 R08: ffffffff896d0c9a R09: 1ffffffff1f5ffad
R10: dffffc0000000000 R11: fffffbfff1f5ffae R12: 0000000000000000
R13: dffffc0000000000 R14: 0000000000000010 R15: ffffffff8173aee3
FS:  000055557b0fb380(0000) GS:ffff8880b9500000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 000055557b0fbca8 CR3: 000000007eb32000 CR4: 00000000003506f0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
----------------
Code disassembly (best guess):
   0:	24 10                	and    $0x10,%al
   2:	49 8d 5f e8          	lea    -0x18(%r15),%rbx
   6:	48 89 d8             	mov    %rbx,%rax
   9:	48 c1 e8 03          	shr    $0x3,%rax
   d:	42 80 3c 28 00       	cmpb   $0x0,(%rax,%r13,1)
  12:	74 08                	je     0x1c
  14:	48 89 df             	mov    %rbx,%rdi
  17:	e8 d9 ea 81 f6       	call   0xf681eaf5
  1c:	48 8b 1b             	mov    (%rbx),%rbx
  1f:	48 8d 7b 08          	lea    0x8(%rbx),%rdi
  23:	48 89 f8             	mov    %rdi,%rax
  26:	48 c1 e8 03          	shr    $0x3,%rax
* 2a:	42 0f b6 04 28       	movzbl (%rax,%r13,1),%eax <-- trapping instruction
  2f:	84 c0                	test   %al,%al
  31:	0f 85 72 01 00 00    	jne    0x1a9
  37:	8b 6b 08             	mov    0x8(%rbx),%ebp
  3a:	48 83 c3 10          	add    $0x10,%rbx
  3e:	48                   	rex.W
  3f:	89                   	.byte 0x89

Crashes (26):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2024/07/14 18:19 linux-next 3fe121b62282 eaeb5c15 .config console log report syz / log C [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root general protection fault in __xsk_map_flush
2024/07/31 18:26 upstream e4fc196f5ba3 1e9c4cf3 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-smack-root general protection fault in __xsk_map_flush
2024/07/30 22:24 upstream 22f546873149 a4e01e1e .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-smack-root general protection fault in __xsk_map_flush
2024/07/28 07:32 upstream 6342649c33d2 46eb10b7 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-smack-root general protection fault in __xsk_map_flush
2024/07/27 03:07 upstream 2f8c4f506285 46eb10b7 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-selinux-root general protection fault in __xsk_map_flush
2024/07/24 19:19 upstream 786c8248dbd3 b24754ac .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-root general protection fault in __xsk_map_flush
2024/07/21 16:06 upstream 2c9b3512402e b88348e9 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-selinux-root general protection fault in __xsk_map_flush
2024/08/01 19:04 upstream 21b136cc63d2 1e9c4cf3 .config console log report info [disk image (non-bootable)] [vmlinux] [kernel image] ci-qemu-upstream general protection fault in __xsk_map_flush
2024/08/01 04:00 upstream e4fc196f5ba3 1e9c4cf3 .config console log report info [disk image (non-bootable)] [vmlinux] [kernel image] ci-qemu-upstream general protection fault in __xsk_map_flush
2024/07/30 15:33 upstream 94ede2a3e913 3d5fb491 .config console log report info [disk image (non-bootable)] [vmlinux] [kernel image] ci-qemu-upstream general protection fault in __xsk_map_flush
2024/07/26 21:23 upstream 2f8c4f506285 46eb10b7 .config console log report info [disk image (non-bootable)] [vmlinux] [kernel image] ci-qemu-upstream general protection fault in __xsk_map_flush
2024/07/26 20:53 upstream 2f8c4f506285 7b1976c4 .config console log report info [disk image (non-bootable)] [vmlinux] [kernel image] ci-qemu-upstream general protection fault in __xsk_map_flush
2024/07/23 20:04 upstream 66ebbdfdeb09 1ede261d .config console log report info [disk image (non-bootable)] [vmlinux] [kernel image] ci-qemu-upstream general protection fault in __xsk_map_flush
2024/07/29 03:02 linux-next 931a3b3bccc9 46eb10b7 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root general protection fault in __xsk_map_flush
2024/07/27 03:33 linux-next 668d33c9ff92 46eb10b7 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root general protection fault in __xsk_map_flush
2024/07/26 08:26 linux-next 668d33c9ff92 3f86dfed .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root general protection fault in __xsk_map_flush
2024/07/24 02:14 linux-next 41c196e567fb 57b2edb1 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root general protection fault in __xsk_map_flush
2024/07/15 00:56 linux-next 3fe121b62282 eaeb5c15 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root general protection fault in __xsk_map_flush
2024/07/14 15:59 linux-next 3fe121b62282 eaeb5c15 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root general protection fault in __xsk_map_flush
2024/07/24 19:36 upstream 786c8248dbd3 b24754ac .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-root KASAN: slab-out-of-bounds Read in __xsk_map_flush
2024/07/23 00:47 upstream 933069701c1b f063dfd9 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-selinux-root KASAN: slab-use-after-free Read in __xsk_map_flush
2024/07/20 12:47 upstream d7e78951a8b8 b88348e9 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-selinux-root KASAN: slab-use-after-free Read in __xsk_map_flush
2024/07/19 03:56 upstream 68b59730459e ee4e11c8 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-root KASAN: slab-out-of-bounds Read in __xsk_map_flush
2024/07/29 21:29 upstream 6b5faec9f564 a4e01e1e .config console log report info [disk image (non-bootable)] [vmlinux] [kernel image] ci-qemu-upstream BUG: unable to handle kernel paging request in __xsk_map_flush
2024/07/27 07:52 upstream 2f8c4f506285 46eb10b7 .config console log report info [disk image (non-bootable)] [vmlinux] [kernel image] ci-qemu-upstream KASAN: stack-out-of-bounds Read in __xsk_map_flush
2024/07/17 04:33 upstream 51835949dda3 215bec2d .config console log report info [disk image (non-bootable)] [vmlinux] [kernel image] ci-qemu-upstream KASAN: stack-out-of-bounds Read in __xsk_map_flush
* Struck through repros no longer work on HEAD.