syzbot


stack segment fault in bpf_xdp_redirect

Status: fixed on 2024/08/14 03:44
Subsystems: bpf net
[Documentation on labels]
Reported-by: syzbot+5ae46b237278e2369cac@syzkaller.appspotmail.com
Fix commit: fecef4cd42c6 tun: Assign missing bpf_net_context.
First crash: 226d, last: 214d
Discussions (2)
Title Replies (including bot) Last reply
[PATCH net-net] tun: Assign missing bpf_net_context. 18 (18) 2024/09/16 10:19
[syzbot] [bpf?] [net?] stack segment fault in bpf_xdp_redirect 0 (3) 2024/07/06 03:39

Sample crash report:
Oops: stack segment: 0000 [#1] PREEMPT SMP KASAN PTI
CPU: 1 UID: 0 PID: 5100 Comm: syz-executor326 Not tainted 6.10.0-rc6-next-20240703-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 06/07/2024
RIP: 0010:bpf_net_ctx_get_ri include/linux/filter.h:788 [inline]
RIP: 0010:____bpf_xdp_redirect net/core/filter.c:4561 [inline]
RIP: 0010:bpf_xdp_redirect+0x59/0x1a0 net/core/filter.c:4559
Code: 81 c3 00 18 00 00 48 89 d8 48 c1 e8 03 42 80 3c 28 00 74 08 48 89 df e8 b5 18 90 f8 48 8b 1b 4c 8d 63 38 4c 89 e5 48 c1 ed 03 <42> 0f b6 44 2d 00 84 c0 0f 85 d0 00 00 00 45 8b 34 24 44 89 f6 83
RSP: 0018:ffffc900033bf6f8 EFLAGS: 00010202
RAX: 1ffff11004549e40 RBX: 0000000000000000 RCX: ffff888022a4da00
RDX: 0000000000000000 RSI: 0000000002000000 RDI: ffffc900033bf900
RBP: 0000000000000007 R08: ffffffff895fff80 R09: 1ffff110172a8938
R10: dffffc0000000000 R11: ffffed10172a8939 R12: 0000000000000038
R13: dffffc0000000000 R14: 1ffff92000677f21 R15: 0000000002000000
FS:  000055557e4d4380(0000) GS:ffff8880b9500000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 000000002000f000 CR3: 000000007abc8000 CR4: 00000000003506f0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
Call Trace:
 <TASK>
 bpf_prog_56e821181540367a+0x1d/0x1f
 __bpf_prog_run include/linux/filter.h:691 [inline]
 bpf_prog_run_xdp include/net/xdp.h:514 [inline]
 bpf_prog_run_generic_xdp+0x679/0x14c0 net/core/dev.c:4962
 netif_receive_generic_xdp net/core/dev.c:5075 [inline]
 do_xdp_generic+0x673/0xb90 net/core/dev.c:5134
 tun_get_user+0x2805/0x4560 drivers/net/tun.c:1924
 tun_chr_write_iter+0x113/0x1f0 drivers/net/tun.c:2048
 new_sync_write fs/read_write.c:497 [inline]
 vfs_write+0xa72/0xc90 fs/read_write.c:590
 ksys_write+0x1a0/0x2c0 fs/read_write.c:643
 do_syscall_x64 arch/x86/entry/common.c:52 [inline]
 do_syscall_64+0xf3/0x230 arch/x86/entry/common.c:83
 entry_SYSCALL_64_after_hwframe+0x77/0x7f
RIP: 0033:0x7f806d71bfd0
Code: 40 00 48 c7 c2 b8 ff ff ff f7 d8 64 89 02 48 c7 c0 ff ff ff ff eb b7 0f 1f 00 80 3d d1 e0 07 00 00 74 17 b8 01 00 00 00 0f 05 <48> 3d 00 f0 ff ff 77 58 c3 0f 1f 80 00 00 00 00 48 83 ec 28 48 89
RSP: 002b:00007fff9b41b6b8 EFLAGS: 00000202 ORIG_RAX: 0000000000000001
RAX: ffffffffffffffda RBX: 00007fff9b41b750 RCX: 00007f806d71bfd0
RDX: 000000000000fdef RSI: 0000000020000100 RDI: 00000000000000c8
RBP: 00007fff9b41b700 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000202 R12: 0000000000000000
R13: 0000000000000000 R14: 0000000000000000 R15: 0000000000000000
 </TASK>
Modules linked in:
---[ end trace 0000000000000000 ]---
RIP: 0010:bpf_net_ctx_get_ri include/linux/filter.h:788 [inline]
RIP: 0010:____bpf_xdp_redirect net/core/filter.c:4561 [inline]
RIP: 0010:bpf_xdp_redirect+0x59/0x1a0 net/core/filter.c:4559
Code: 81 c3 00 18 00 00 48 89 d8 48 c1 e8 03 42 80 3c 28 00 74 08 48 89 df e8 b5 18 90 f8 48 8b 1b 4c 8d 63 38 4c 89 e5 48 c1 ed 03 <42> 0f b6 44 2d 00 84 c0 0f 85 d0 00 00 00 45 8b 34 24 44 89 f6 83
RSP: 0018:ffffc900033bf6f8 EFLAGS: 00010202
RAX: 1ffff11004549e40 RBX: 0000000000000000 RCX: ffff888022a4da00
RDX: 0000000000000000 RSI: 0000000002000000 RDI: ffffc900033bf900
RBP: 0000000000000007 R08: ffffffff895fff80 R09: 1ffff110172a8938
R10: dffffc0000000000 R11: ffffed10172a8939 R12: 0000000000000038
R13: dffffc0000000000 R14: 1ffff92000677f21 R15: 0000000002000000
FS:  000055557e4d4380(0000) GS:ffff8880b9500000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 000000002000f000 CR3: 000000007abc8000 CR4: 00000000003506f0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
----------------
Code disassembly (best guess):
   0:	81 c3 00 18 00 00    	add    $0x1800,%ebx
   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 b5 18 90 f8       	call   0xf89018d1
  1c:	48 8b 1b             	mov    (%rbx),%rbx
  1f:	4c 8d 63 38          	lea    0x38(%rbx),%r12
  23:	4c 89 e5             	mov    %r12,%rbp
  26:	48 c1 ed 03          	shr    $0x3,%rbp
* 2a:	42 0f b6 44 2d 00    	movzbl 0x0(%rbp,%r13,1),%eax <-- trapping instruction
  30:	84 c0                	test   %al,%al
  32:	0f 85 d0 00 00 00    	jne    0x108
  38:	45 8b 34 24          	mov    (%r12),%r14d
  3c:	44 89 f6             	mov    %r14d,%esi
  3f:	83                   	.byte 0x83

Crashes (181):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2024/07/06 03:38 linux-next 0b58e108042b 2a40360c .config strace log report syz / log C [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root stack segment fault in bpf_xdp_redirect
2024/07/01 23:18 net-next 1c5fc27bc48a b294e901 .config console log report syz / log [disk image] [vmlinux] [kernel image] ci-upstream-net-kasan-gce stack segment fault in bpf_xdp_redirect
2024/07/02 13:03 net-next 19e6ad2c7578 8373af66 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-net-kasan-gce stack segment fault in bpf_xdp_redirect
2024/07/01 20:25 net-next 1c5fc27bc48a b294e901 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-net-kasan-gce stack segment fault in bpf_xdp_redirect
2024/07/09 09:09 linux-next 0b58e108042b bc23a442 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root stack segment fault in bpf_xdp_redirect
2024/07/09 08:28 linux-next 0b58e108042b bc23a442 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root stack segment fault in bpf_xdp_redirect
2024/07/09 07:04 linux-next 0b58e108042b bc23a442 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root stack segment fault in bpf_xdp_redirect
2024/07/09 05:46 linux-next 0b58e108042b bc23a442 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root stack segment fault in bpf_xdp_redirect
2024/07/08 22:16 linux-next 0b58e108042b cde64f7d .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root stack segment fault in bpf_xdp_redirect
2024/07/08 18:51 linux-next 0b58e108042b cde64f7d .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root stack segment fault in bpf_xdp_redirect
2024/07/08 15:03 linux-next 0b58e108042b cde64f7d .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root stack segment fault in bpf_xdp_redirect
2024/07/08 07:11 linux-next 0b58e108042b bc4ebbb5 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root stack segment fault in bpf_xdp_redirect
2024/07/08 06:10 linux-next 0b58e108042b bc4ebbb5 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root stack segment fault in bpf_xdp_redirect
2024/07/07 18:58 linux-next 0b58e108042b bc4ebbb5 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root stack segment fault in bpf_xdp_redirect
2024/07/07 17:56 linux-next 0b58e108042b bc4ebbb5 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root stack segment fault in bpf_xdp_redirect
2024/07/07 17:35 linux-next 0b58e108042b bc4ebbb5 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root stack segment fault in bpf_xdp_redirect
2024/07/07 11:13 linux-next 0b58e108042b bc4ebbb5 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root stack segment fault in bpf_xdp_redirect
2024/07/07 08:10 linux-next 0b58e108042b bc4ebbb5 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root stack segment fault in bpf_xdp_redirect
2024/07/07 04:56 linux-next 0b58e108042b bc4ebbb5 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root stack segment fault in bpf_xdp_redirect
2024/07/07 04:51 linux-next 0b58e108042b bc4ebbb5 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root stack segment fault in bpf_xdp_redirect
2024/07/06 23:21 linux-next 0b58e108042b bc4ebbb5 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root stack segment fault in bpf_xdp_redirect
2024/07/06 20:30 linux-next 0b58e108042b bc4ebbb5 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root stack segment fault in bpf_xdp_redirect
2024/07/06 12:13 linux-next 0b58e108042b bc4ebbb5 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root stack segment fault in bpf_xdp_redirect
2024/07/05 21:00 linux-next 0b58e108042b 2a40360c .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root stack segment fault in bpf_xdp_redirect
2024/07/05 15:29 linux-next 0b58e108042b 2a40360c .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root stack segment fault in bpf_xdp_redirect
2024/07/05 08:30 linux-next 0b58e108042b dc6bbff0 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root stack segment fault in bpf_xdp_redirect
2024/07/05 05:28 linux-next 0b58e108042b dc6bbff0 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root stack segment fault in bpf_xdp_redirect
2024/07/04 23:07 linux-next 0b58e108042b dc6bbff0 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root stack segment fault in bpf_xdp_redirect
2024/07/04 23:06 linux-next 0b58e108042b dc6bbff0 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root stack segment fault in bpf_xdp_redirect
2024/07/04 21:48 linux-next 0b58e108042b dc6bbff0 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root stack segment fault in bpf_xdp_redirect
2024/07/04 19:42 linux-next 0b58e108042b dc6bbff0 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root stack segment fault in bpf_xdp_redirect
2024/07/04 18:31 linux-next 0b58e108042b dc6bbff0 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root stack segment fault in bpf_xdp_redirect
2024/07/04 18:22 linux-next 0b58e108042b dc6bbff0 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root stack segment fault in bpf_xdp_redirect
2024/07/04 10:05 linux-next 0b58e108042b 409d975c .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root stack segment fault in bpf_xdp_redirect
2024/07/04 05:23 linux-next 0b58e108042b 409d975c .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root stack segment fault in bpf_xdp_redirect
2024/07/04 03:52 linux-next 0b58e108042b 409d975c .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root stack segment fault in bpf_xdp_redirect
2024/07/04 01:51 linux-next 0b58e108042b 409d975c .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root stack segment fault in bpf_xdp_redirect
2024/07/03 21:20 linux-next 0b58e108042b 409d975c .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root stack segment fault in bpf_xdp_redirect
2024/07/03 18:08 linux-next 0b58e108042b 409d975c .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root stack segment fault in bpf_xdp_redirect
2024/07/03 10:51 linux-next 0b58e108042b 1ecfa2d8 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root stack segment fault in bpf_xdp_redirect
2024/07/03 02:46 linux-next 82e4255305c5 1ecfa2d8 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root stack segment fault in bpf_xdp_redirect
2024/07/03 02:45 linux-next 82e4255305c5 1ecfa2d8 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root stack segment fault in bpf_xdp_redirect
2024/07/02 18:45 linux-next 82e4255305c5 8373af66 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root stack segment fault in bpf_xdp_redirect
2024/07/02 15:49 linux-next 82e4255305c5 8373af66 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root stack segment fault in bpf_xdp_redirect
2024/07/02 14:04 linux-next 82e4255305c5 8373af66 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root stack segment fault in bpf_xdp_redirect
2024/07/01 21:38 linux-next 74564adfd352 b294e901 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root stack segment fault in bpf_xdp_redirect
2024/06/27 20:27 linux-next 642a16ca7994 b62c7d46 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root stack segment fault in bpf_xdp_redirect
* Struck through repros no longer work on HEAD.