syzbot


general protection fault in dev_get_by_index_rcu (2)

Status: fixed on 2022/03/08 16:11
Subsystems: bpf net
[Documentation on labels]
Reported-by: syzbot+983941aa85af6ded1fd9@syzkaller.appspotmail.com
Fix commit: 382778edc826 xdp: check prog type before updating BPF link
First crash: 925d, last: 810d
Cause bisection: failed (error log, bisect log)
  
Discussions (6)
Title Replies (including bot) Last reply
[PATCH 5.10 000/563] 5.10.94-rc1 review 580 (580) 2022/02/09 07:59
[PATCH 5.16 0000/1039] 5.16.3-rc1 review 1058 (1058) 2022/02/03 14:49
[PATCH 5.15 000/846] 5.15.17-rc1 review 859 (859) 2022/01/27 16:04
[PATCH bpf v2 1/3] xdp: check prog type before updating BPF link 6 (6) 2022/01/11 17:49
[PATCH bpf 1/2] xdp: check prog type before updating BPF link 7 (7) 2022/01/07 21:30
[syzbot] general protection fault in dev_get_by_index_rcu (2) 3 (4) 2022/01/07 18:37
Similar bugs (1)
Kernel Title Repro Cause bisect Fix bisect Count Last Reported Patched Status
upstream general protection fault in dev_get_by_index_rcu net 6 1740d 1861d 0/26 auto-closed as invalid on 2019/10/25 08:51
Last patch testing requests (1)
Created Duration User Patch Repo Result
2022/01/07 17:46 11m toke@redhat.com patch https://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf-next.git master OK

Sample crash report:
general protection fault, probably for non-canonical address 0xdffffc000000003e: 0000 [#1] PREEMPT SMP KASAN
KASAN: null-ptr-deref in range [0x00000000000001f0-0x00000000000001f7]
CPU: 1 PID: 19 Comm: ksoftirqd/1 Not tainted 5.16.0-rc5-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
RIP: 0010:dev_index_hash net/core/dev.c:222 [inline]
RIP: 0010:dev_get_by_index_rcu+0x28/0x140 net/core/dev.c:885
Code: 00 00 41 55 41 54 55 89 f5 53 48 89 fb e8 00 9d 4d fa 48 8d bb f0 01 00 00 48 b8 00 00 00 00 00 fc ff df 48 89 fa 48 c1 ea 03 <80> 3c 02 00 0f 85 fc 00 00 00 48 8b 93 f0 01 00 00 40 0f b6 c5 48
RSP: 0018:ffffc90000d97608 EFLAGS: 00010202
RAX: dffffc0000000000 RBX: 0000000000000000 RCX: 0000000000000100
RDX: 000000000000003e RSI: ffffffff872a14d0 RDI: 00000000000001f0
RBP: 0000000000000003 R08: 0000000000000000 R09: 0000000000000001
R10: ffffffff873745ad R11: 000000000008808a R12: ffff88806a062100
R13: 0000000000000003 R14: ffff88806a062100 R15: ffffc90001116000
FS:  0000000000000000(0000) GS:ffff8880b9d00000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 000055555733a848 CR3: 000000001479e000 CR4: 00000000003506e0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
Call Trace:
 <TASK>
 ____bpf_clone_redirect net/core/filter.c:2410 [inline]
 bpf_clone_redirect+0x91/0x420 net/core/filter.c:2401
 bpf_prog_bebbfe2050753572+0x56/0xcc0
 __bpf_prog_run include/linux/filter.h:626 [inline]
 bpf_prog_run_xdp include/linux/filter.h:801 [inline]
 veth_xdp_rcv_skb+0x64b/0x1b20 drivers/net/veth.c:775
 veth_xdp_rcv+0x3ac/0x810 drivers/net/veth.c:881
 veth_poll+0x134/0x850 drivers/net/veth.c:913
 __napi_poll+0xaf/0x440 net/core/dev.c:7023
 napi_poll net/core/dev.c:7090 [inline]
 net_rx_action+0x801/0xb40 net/core/dev.c:7177
 __do_softirq+0x29b/0x9c2 kernel/softirq.c:558
 run_ksoftirqd kernel/softirq.c:921 [inline]
 run_ksoftirqd+0x2d/0x60 kernel/softirq.c:913
 smpboot_thread_fn+0x645/0x9c0 kernel/smpboot.c:164
 kthread+0x405/0x4f0 kernel/kthread.c:327
 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:295
 </TASK>
Modules linked in:
---[ end trace 86b7d5782a67ad32 ]---
RIP: 0010:dev_index_hash net/core/dev.c:222 [inline]
RIP: 0010:dev_get_by_index_rcu+0x28/0x140 net/core/dev.c:885
Code: 00 00 41 55 41 54 55 89 f5 53 48 89 fb e8 00 9d 4d fa 48 8d bb f0 01 00 00 48 b8 00 00 00 00 00 fc ff df 48 89 fa 48 c1 ea 03 <80> 3c 02 00 0f 85 fc 00 00 00 48 8b 93 f0 01 00 00 40 0f b6 c5 48
RSP: 0018:ffffc90000d97608 EFLAGS: 00010202
RAX: dffffc0000000000 RBX: 0000000000000000 RCX: 0000000000000100
RDX: 000000000000003e RSI: ffffffff872a14d0 RDI: 00000000000001f0
RBP: 0000000000000003 R08: 0000000000000000 R09: 0000000000000001
R10: ffffffff873745ad R11: 000000000008808a R12: ffff88806a062100
R13: 0000000000000003 R14: ffff88806a062100 R15: ffffc90001116000
FS:  0000000000000000(0000) GS:ffff8880b9d00000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 000055555733a848 CR3: 000000001479e000 CR4: 00000000003506e0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
----------------
Code disassembly (best guess):
   0:	00 00                	add    %al,(%rax)
   2:	41 55                	push   %r13
   4:	41 54                	push   %r12
   6:	55                   	push   %rbp
   7:	89 f5                	mov    %esi,%ebp
   9:	53                   	push   %rbx
   a:	48 89 fb             	mov    %rdi,%rbx
   d:	e8 00 9d 4d fa       	callq  0xfa4d9d12
  12:	48 8d bb f0 01 00 00 	lea    0x1f0(%rbx),%rdi
  19:	48 b8 00 00 00 00 00 	movabs $0xdffffc0000000000,%rax
  20:	fc ff df
  23:	48 89 fa             	mov    %rdi,%rdx
  26:	48 c1 ea 03          	shr    $0x3,%rdx
* 2a:	80 3c 02 00          	cmpb   $0x0,(%rdx,%rax,1) <-- trapping instruction
  2e:	0f 85 fc 00 00 00    	jne    0x130
  34:	48 8b 93 f0 01 00 00 	mov    0x1f0(%rbx),%rdx
  3b:	40 0f b6 c5          	movzbl %bpl,%eax
  3f:	48                   	rex.W

Crashes (18):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2021/12/27 00:13 bpf 819d11507f66 e4f103c4 .config console log report syz C ci-upstream-bpf-kasan-gce general protection fault in dev_get_by_index_rcu
2022/01/06 00:05 bpf-next 5e22dd186267 6acc789a .config console log report syz C ci-upstream-bpf-next-kasan-gce general protection fault in dev_get_by_index_rcu
2022/01/05 20:51 net-next-old c5bcdd8228d8 6acc789a .config console log report syz ci-upstream-net-kasan-gce general protection fault in dev_get_by_index_rcu
2021/12/26 23:58 bpf-next 4b443bc1785f e4f103c4 .config console log report syz ci-upstream-bpf-next-kasan-gce general protection fault in dev_get_by_index_rcu
2022/01/06 13:43 upstream 75acfdb6fd92 6acc789a .config console log report info ci-upstream-kasan-gce-smack-root general protection fault in dev_get_by_index_rcu
2022/01/04 19:05 upstream c9e6606c7fe9 0a2584dd .config console log report info ci-upstream-kasan-gce-selinux-root general protection fault in dev_get_by_index_rcu
2021/12/20 10:00 upstream a7904a538933 021b36cb .config console log report info ci-upstream-kasan-gce-selinux-root general protection fault in dev_get_by_index_rcu
2021/12/15 19:06 upstream 5472f14a3742 572bcb40 .config console log report info ci-upstream-kasan-gce-root general protection fault in dev_get_by_index_rcu
2022/01/07 19:55 upstream ddec8ed2d490 2ca0d385 .config console log report info ci-qemu-upstream-386 general protection fault in dev_get_by_index_rcu
2022/01/07 17:30 upstream ddec8ed2d490 2ca0d385 .config console log report info ci-qemu-upstream-386 general protection fault in dev_get_by_index_rcu
2021/12/17 09:51 net-old 6441998e2e37 44068e19 .config console log report info ci-upstream-net-this-kasan-gce general protection fault in dev_get_by_index_rcu
2021/12/11 13:58 bpf 0be2516f865f 49ca1f59 .config console log report info ci-upstream-bpf-kasan-gce general protection fault in dev_get_by_index_rcu
2021/11/30 00:45 bpf c0d95d3380ee d0830353 .config console log report info ci-upstream-bpf-kasan-gce general protection fault in dev_get_by_index_rcu
2021/11/29 03:59 net-next-old d40ce48cb3a6 63eeac02 .config console log report info ci-upstream-net-kasan-gce general protection fault in dev_get_by_index_rcu
2021/11/19 12:33 net-next-old 3b1abcf12894 31a30fc0 .config console log report info ci-upstream-net-kasan-gce general protection fault in dev_get_by_index_rcu
2021/10/04 03:48 net-next-old 0693b27644f0 db0f5787 .config console log report info ci-upstream-net-kasan-gce general protection fault in dev_get_by_index_rcu
2021/09/27 04:22 net-next-old d59bdda85eb7 78494d16 .config console log report info ci-upstream-net-kasan-gce general protection fault in dev_get_by_index_rcu
2021/09/15 04:14 net-next-old 55bd079a3cb6 07e953c1 .config console log report info ci-upstream-net-kasan-gce general protection fault in dev_get_by_index_rcu
* Struck through repros no longer work on HEAD.