syzbot


general protection fault in llc_build_and_send_test_pkt

Status: internal: reported C repro on 2022/03/24 15:36
Reported-by: syzbot+@syzkaller.appspotmail.com
Fix commit: 2d327a79ee17 llc: only change llc->dev when bind() succeeds
Patched on: [ci-qemu-upstream ci-qemu-upstream-386 ci-qemu2-arm32 ci-qemu2-arm64 ci-qemu2-arm64-compat ci-qemu2-arm64-mte ci-upstream-bpf-kasan-gce ci-upstream-bpf-next-kasan-gce ci-upstream-gce-leak ci-upstream-kasan-gce ci-upstream-kasan-gce-386 ci-upstream-kasan-gce-root ci-upstream-kasan-gce-selinux-root ci-upstream-kasan-gce-smack-root ci-upstream-kmsan-gce ci-upstream-kmsan-gce-386 ci-upstream-linux-next-kasan-gce-root ci-upstream-net-kasan-gce ci-upstream-net-this-kasan-gce ci2-upstream-kcsan-gce ci2-upstream-usb], missing on: [ci-qemu2-riscv64]
First crash: 96d, last: 91d

Cause bisection: introduced by (bisect log) :
commit 764f4eb6846f5475f1244767d24d25dd86528a4a
Author: Eric Dumazet <edumazet@google.com>
Date: Wed Mar 23 00:41:47 2022 +0000

  llc: fix netdevice reference leaks in llc_ui_bind()

Crash: general protection fault in llc_build_and_send_test_pkt (log)
Repro: C syz .config

Sample crash report:
general protection fault, probably for non-canonical address 0xdffffc0000000070: 0000 [#1] PREEMPT SMP KASAN
KASAN: null-ptr-deref in range [0x0000000000000380-0x0000000000000387]
CPU: 1 PID: 4626 Comm: syz-executor106 Tainted: G        W         5.17.0-syzkaller-07558-ga81687886ca9 #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
RIP: 0010:llc_build_and_send_test_pkt+0xda/0x1f0 net/llc/llc_sap.c:238
Code: 48 c1 ea 03 80 3c 02 00 0f 85 20 01 00 00 48 b8 00 00 00 00 00 fc ff df 48 8b 5d 10 48 8d bb 80 03 00 00 48 89 fa 48 c1 ea 03 <80> 3c 02 00 0f 85 f0 00 00 00 48 8b b3 80 03 00 00 48 8d 7d 2e ba
RSP: 0018:ffffc9000af0f898 EFLAGS: 00010202
RAX: dffffc0000000000 RBX: 0000000000000000 RCX: 0000000000000000
RDX: 0000000000000070 RSI: ffffffff875ccbf8 RDI: 0000000000000380
RBP: ffff888070659780 R08: 0000000000000000 R09: 0000000000000009
R10: ffffffff875d4257 R11: 0000000000000000 R12: ffff88801e4b2000
R13: ffff888073afa510 R14: 0000000000000002 R15: 0000000000000000
FS:  00007fa4c98c6700(0000) GS:ffff8880b9d00000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00007fa4c98a5718 CR3: 000000006f7e3000 CR4: 00000000003506e0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
Call Trace:
 <TASK>
 llc_ui_sendmsg+0x9f9/0x10d0 net/llc/af_llc.c:973
 sock_sendmsg_nosec net/socket.c:705 [inline]
 sock_sendmsg+0xcf/0x120 net/socket.c:725
 ____sys_sendmsg+0x331/0x810 net/socket.c:2413
 ___sys_sendmsg+0xf3/0x170 net/socket.c:2467
 __sys_sendmmsg+0x195/0x470 net/socket.c:2553
 __do_sys_sendmmsg net/socket.c:2582 [inline]
 __se_sys_sendmmsg net/socket.c:2579 [inline]
 __x64_sys_sendmmsg+0x99/0x100 net/socket.c:2579
 do_syscall_x64 arch/x86/entry/common.c:50 [inline]
 do_syscall_64+0x35/0xb0 arch/x86/entry/common.c:80
 entry_SYSCALL_64_after_hwframe+0x44/0xae
RIP: 0033:0x7fa4ca123a49
Code: 28 00 00 00 75 05 48 83 c4 28 c3 e8 61 19 00 00 90 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 c7 c1 b8 ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007fa4c98c61d8 EFLAGS: 00000246 ORIG_RAX: 0000000000000133
RAX: ffffffffffffffda RBX: 00007fa4ca1ac248 RCX: 00007fa4ca123a49
RDX: 03fffffffffffeed RSI: 0000000020001380 RDI: 0000000000000004
RBP: 00007fa4ca1ac240 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 00007fa4ca1ac24c
R13: 00007ffcd6b73b6f R14: 00007fa4c98c6300 R15: 0000000000022000
 </TASK>
Modules linked in:
---[ end trace 0000000000000000 ]---
RIP: 0010:llc_build_and_send_test_pkt+0xda/0x1f0 net/llc/llc_sap.c:238
Code: 48 c1 ea 03 80 3c 02 00 0f 85 20 01 00 00 48 b8 00 00 00 00 00 fc ff df 48 8b 5d 10 48 8d bb 80 03 00 00 48 89 fa 48 c1 ea 03 <80> 3c 02 00 0f 85 f0 00 00 00 48 8b b3 80 03 00 00 48 8d 7d 2e ba
RSP: 0018:ffffc9000af0f898 EFLAGS: 00010202
RAX: dffffc0000000000 RBX: 0000000000000000 RCX: 0000000000000000
RDX: 0000000000000070 RSI: ffffffff875ccbf8 RDI: 0000000000000380
RBP: ffff888070659780 R08: 0000000000000000 R09: 0000000000000009
R10: ffffffff875d4257 R11: 0000000000000000 R12: ffff88801e4b2000
R13: ffff888073afa510 R14: 0000000000000002 R15: 0000000000000000
FS:  00007fa4c98c6700(0000) GS:ffff8880b9d00000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00007fa4c98a5718 CR3: 000000006f7e3000 CR4: 00000000003506e0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
----------------
Code disassembly (best guess):
   0:	48 c1 ea 03          	shr    $0x3,%rdx
   4:	80 3c 02 00          	cmpb   $0x0,(%rdx,%rax,1)
   8:	0f 85 20 01 00 00    	jne    0x12e
   e:	48 b8 00 00 00 00 00 	movabs $0xdffffc0000000000,%rax
  15:	fc ff df
  18:	48 8b 5d 10          	mov    0x10(%rbp),%rbx
  1c:	48 8d bb 80 03 00 00 	lea    0x380(%rbx),%rdi
  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 f0 00 00 00    	jne    0x124
  34:	48 8b b3 80 03 00 00 	mov    0x380(%rbx),%rsi
  3b:	48 8d 7d 2e          	lea    0x2e(%rbp),%rdi
  3f:	ba                   	.byte 0xba

Crashes (25):
Manager Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Title
ci-upstream-net-this-kasan-gce 2022/03/26 02:43 net a81687886ca9 89bc8608 .config log report syz C general protection fault in llc_build_and_send_test_pkt
ci-upstream-net-kasan-gce 2022/03/26 02:16 net-next 169e77764adc 89bc8608 .config log report syz C general protection fault in llc_build_and_send_test_pkt
ci-upstream-net-kasan-gce 2022/03/24 16:10 net-next 89695196f0ba 89bc8608 .config log report syz C general protection fault in llc_build_and_send_test_pkt
ci-upstream-kasan-gce-root 2022/03/29 11:39 upstream cffb2b72d3ed 6bdac766 .config log report info general protection fault in llc_build_and_send_test_pkt
ci-upstream-net-kasan-gce 2022/03/28 06:19 net-next 169e77764adc 89bc8608 .config log report info general protection fault in llc_build_and_send_test_pkt
ci-upstream-net-kasan-gce 2022/03/28 05:45 net-next 169e77764adc 89bc8608 .config log report info general protection fault in llc_build_and_send_test_pkt
ci-upstream-net-kasan-gce 2022/03/28 03:39 net-next 169e77764adc 89bc8608 .config log report info general protection fault in llc_build_and_send_test_pkt
ci-upstream-net-kasan-gce 2022/03/27 15:32 net-next 169e77764adc 89bc8608 .config log report info general protection fault in llc_build_and_send_test_pkt
ci-upstream-net-kasan-gce 2022/03/27 15:00 net-next 169e77764adc 89bc8608 .config log report info general protection fault in llc_build_and_send_test_pkt
ci-upstream-net-kasan-gce 2022/03/27 08:23 net-next 169e77764adc 89bc8608 .config log report info general protection fault in llc_build_and_send_test_pkt
ci-upstream-net-kasan-gce 2022/03/26 22:01 net-next 169e77764adc 89bc8608 .config log report info general protection fault in llc_build_and_send_test_pkt
ci-upstream-net-kasan-gce 2022/03/26 21:50 net-next 169e77764adc 89bc8608 .config log report info general protection fault in llc_build_and_send_test_pkt
ci-upstream-net-kasan-gce 2022/03/26 13:43 net-next 169e77764adc 89bc8608 .config log report info general protection fault in llc_build_and_send_test_pkt
ci-upstream-net-kasan-gce 2022/03/26 09:33 net-next 169e77764adc 89bc8608 .config log report info general protection fault in llc_build_and_send_test_pkt
ci-upstream-net-kasan-gce 2022/03/26 00:42 net-next 169e77764adc 89bc8608 .config log report info general protection fault in llc_build_and_send_test_pkt
ci-upstream-net-kasan-gce 2022/03/26 00:23 net-next 169e77764adc 89bc8608 .config log report info general protection fault in llc_build_and_send_test_pkt
ci-upstream-net-kasan-gce 2022/03/25 12:30 net-next 169e77764adc 89bc8608 .config log report info general protection fault in llc_build_and_send_test_pkt
ci-upstream-net-kasan-gce 2022/03/25 10:07 net-next 169e77764adc 89bc8608 .config log report info general protection fault in llc_build_and_send_test_pkt
ci-upstream-net-kasan-gce 2022/03/25 07:50 net-next 169e77764adc 89bc8608 .config log report info general protection fault in llc_build_and_send_test_pkt
ci-upstream-net-kasan-gce 2022/03/25 06:31 net-next 169e77764adc 89bc8608 .config log report info general protection fault in llc_build_and_send_test_pkt
ci-upstream-net-kasan-gce 2022/03/25 05:34 net-next 169e77764adc 89bc8608 .config log report info general protection fault in llc_build_and_send_test_pkt
ci-upstream-net-kasan-gce 2022/03/24 20:06 net-next 89695196f0ba 89bc8608 .config log report info general protection fault in llc_build_and_send_test_pkt
ci-upstream-net-kasan-gce 2022/03/24 20:06 net-next 89695196f0ba 89bc8608 .config log report info general protection fault in llc_build_and_send_test_pkt
ci-upstream-net-kasan-gce 2022/03/24 17:08 net-next 89695196f0ba 89bc8608 .config log report info general protection fault in llc_build_and_send_test_pkt
ci-upstream-net-kasan-gce 2022/03/24 15:35 net-next 89695196f0ba 89bc8608 .config log report info general protection fault in llc_build_and_send_test_pkt