syzbot


general protection fault in xdp_do_generic_redirect

Status: moderation: reported on 2024/07/01 23:32
Subsystems: net bpf
[Documentation on labels]
Reported-by: syzbot+87f05747fb345549036d@syzkaller.appspotmail.com
First crash: 6d13h, last: 6d12h

Sample crash report:
Oops: general protection fault, probably for non-canonical address 0xdffffc0000000007: 0000 [#1] PREEMPT SMP KASAN PTI
KASAN: null-ptr-deref in range [0x0000000000000038-0x000000000000003f]
CPU: 1 UID: 0 PID: 6705 Comm: syz.2.436 Not tainted 6.10.0-rc5-next-20240627-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:xdp_do_generic_redirect+0x7e/0x8f0 net/core/filter.c:4508
Code: 3c 01 00 74 12 48 89 df e8 ef f2 90 f8 48 b8 00 00 00 00 00 fc ff df 48 89 5c 24 48 48 8b 1b 4c 8d 73 38 4d 89 f7 49 c1 ef 03 <41> 0f b6 04 07 84 c0 0f 85 37 06 00 00 41 8b 2e 89 ee 83 e6 02 31
RSP: 0018:ffffc900095a77f8 EFLAGS: 00010202
RAX: dffffc0000000000 RBX: 0000000000000000 RCX: 1ffff110045f6a81
RDX: ffffc90011096000 RSI: 0000000000001c41 RDI: 0000000000001c42
RBP: ffffc900095a79b0 R08: 0000000000000005 R09: ffffffff895f485e
R10: 0000000000000003 R11: ffff888022fb3c00 R12: ffffc900095a7b60
R13: 1ffff920012b4f1c R14: 0000000000000038 R15: 0000000000000007
FS:  00007fce5ceb76c0(0000) GS:ffff8880b9500000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 0000000020011000 CR3: 0000000021d3a000 CR4: 00000000003506f0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
Call Trace:
 <TASK>
 do_xdp_generic+0x884/0xb90 net/core/dev.c:5139
 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:0x7fce5c1746df
Code: 89 54 24 18 48 89 74 24 10 89 7c 24 08 e8 f9 8b 02 00 48 8b 54 24 18 48 8b 74 24 10 41 89 c0 8b 7c 24 08 b8 01 00 00 00 0f 05 <48> 3d 00 f0 ff ff 77 31 44 89 c7 48 89 44 24 08 e8 4c 8c 02 00 48
RSP: 002b:00007fce5ceb7010 EFLAGS: 00000293 ORIG_RAX: 0000000000000001
RAX: ffffffffffffffda RBX: 00007fce5c303fa0 RCX: 00007fce5c1746df
RDX: 000000000000fdef RSI: 0000000020001540 RDI: 00000000000000c8
RBP: 00007fce5c1f6756 R08: 0000000000000000 R09: 0000000000000000
R10: 000000000000fdef R11: 0000000000000293 R12: 0000000000000000
R13: 000000000000000b R14: 00007fce5c303fa0 R15: 00007ffcb6ee1f58
 </TASK>
Modules linked in:
---[ end trace 0000000000000000 ]---
RIP: 0010:bpf_net_ctx_get_ri include/linux/filter.h:788 [inline]
RIP: 0010:xdp_do_generic_redirect+0x7e/0x8f0 net/core/filter.c:4508
Code: 3c 01 00 74 12 48 89 df e8 ef f2 90 f8 48 b8 00 00 00 00 00 fc ff df 48 89 5c 24 48 48 8b 1b 4c 8d 73 38 4d 89 f7 49 c1 ef 03 <41> 0f b6 04 07 84 c0 0f 85 37 06 00 00 41 8b 2e 89 ee 83 e6 02 31
RSP: 0018:ffffc900095a77f8 EFLAGS: 00010202
RAX: dffffc0000000000 RBX: 0000000000000000 RCX: 1ffff110045f6a81
RDX: ffffc90011096000 RSI: 0000000000001c41 RDI: 0000000000001c42
RBP: ffffc900095a79b0 R08: 0000000000000005 R09: ffffffff895f485e
R10: 0000000000000003 R11: ffff888022fb3c00 R12: ffffc900095a7b60
R13: 1ffff920012b4f1c R14: 0000000000000038 R15: 0000000000000007
FS:  00007fce5ceb76c0(0000) GS:ffff8880b9500000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 0000000020011000 CR3: 0000000021d3a000 CR4: 00000000003506f0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
----------------
Code disassembly (best guess):
   0:	3c 01                	cmp    $0x1,%al
   2:	00 74 12 48          	add    %dh,0x48(%rdx,%rdx,1)
   6:	89 df                	mov    %ebx,%edi
   8:	e8 ef f2 90 f8       	call   0xf890f2fc
   d:	48 b8 00 00 00 00 00 	movabs $0xdffffc0000000000,%rax
  14:	fc ff df
  17:	48 89 5c 24 48       	mov    %rbx,0x48(%rsp)
  1c:	48 8b 1b             	mov    (%rbx),%rbx
  1f:	4c 8d 73 38          	lea    0x38(%rbx),%r14
  23:	4d 89 f7             	mov    %r14,%r15
  26:	49 c1 ef 03          	shr    $0x3,%r15
* 2a:	41 0f b6 04 07       	movzbl (%r15,%rax,1),%eax <-- trapping instruction
  2f:	84 c0                	test   %al,%al
  31:	0f 85 37 06 00 00    	jne    0x66e
  37:	41 8b 2e             	mov    (%r14),%ebp
  3a:	89 ee                	mov    %ebp,%esi
  3c:	83 e6 02             	and    $0x2,%esi
  3f:	31                   	.byte 0x31

Crashes (3):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2024/06/28 00:06 linux-next 642a16ca7994 b62c7d46 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root general protection fault in xdp_do_generic_redirect
2024/06/27 23:24 linux-next 642a16ca7994 b62c7d46 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root general protection fault in xdp_do_generic_redirect
2024/06/27 23:24 linux-next 642a16ca7994 b62c7d46 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root general protection fault in xdp_do_generic_redirect
* Struck through repros no longer work on HEAD.