syzbot


general protection fault in llc_ui_connect

Status: fixed on 2023/02/24 13:50
Subsystems: net
[Documentation on labels]
Fix commit: 2d327a79ee17 llc: only change llc->dev when bind() succeeds
First crash: 924d, last: 920d
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_ui_connect (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: 3590 Comm: syz-executor359 Tainted: G        W         5.17.0-syzkaller-07551-g169e77764adc #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
RIP: 0010:llc_ui_connect+0x400/0xcb0 net/llc/af_llc.c:500
Code: 80 3c 02 00 0f 85 fc 07 00 00 4c 8b a5 38 05 00 00 48 b8 00 00 00 00 00 fc ff df 49 8d bc 24 80 03 00 00 48 89 fa 48 c1 ea 03 <80> 3c 02 00 0f 85 a9 07 00 00 49 8b b4 24 80 03 00 00 4c 89 f2 48
RSP: 0018:ffffc900038dfcc0 EFLAGS: 00010202
RAX: dffffc0000000000 RBX: ffff888075746000 RCX: 0000000000000000
RDX: 0000000000000070 RSI: ffffc900038dfe3e RDI: 0000000000000380
RBP: ffff8881423a8000 R08: 0000000000000001 R09: ffff8881423a8535
R10: ffffed10284750a6 R11: 0000000000000000 R12: 0000000000000000
R13: ffffc900038dfe37 R14: ffffc900038dfe38 R15: ffff8881423a8012
FS:  0000555555d8a300(0000) GS:ffff8880b9d00000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 0000000020000280 CR3: 000000007f17d000 CR4: 00000000003506e0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
Call Trace:
 <TASK>
 __sys_connect_file+0x155/0x1a0 net/socket.c:1900
 __sys_connect+0x161/0x190 net/socket.c:1917
 __do_sys_connect net/socket.c:1927 [inline]
 __se_sys_connect net/socket.c:1924 [inline]
 __x64_sys_connect+0x6f/0xb0 net/socket.c:1924
 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:0x7f74b59990b9
Code: 28 c3 e8 2a 14 00 00 66 2e 0f 1f 84 00 00 00 00 00 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 c0 ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007ffe147b7fa8 EFLAGS: 00000246 ORIG_RAX: 000000000000002a
RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 00007f74b59990b9
RDX: 0000000000000010 RSI: 0000000020000140 RDI: 0000000000000003
RBP: 00007f74b595d0a0 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 00007f74b595d130
R13: 0000000000000000 R14: 0000000000000000 R15: 0000000000000000
 </TASK>
Modules linked in:
---[ end trace 0000000000000000 ]---
RIP: 0010:llc_ui_connect+0x400/0xcb0 net/llc/af_llc.c:500
Code: 80 3c 02 00 0f 85 fc 07 00 00 4c 8b a5 38 05 00 00 48 b8 00 00 00 00 00 fc ff df 49 8d bc 24 80 03 00 00 48 89 fa 48 c1 ea 03 <80> 3c 02 00 0f 85 a9 07 00 00 49 8b b4 24 80 03 00 00 4c 89 f2 48
RSP: 0018:ffffc900038dfcc0 EFLAGS: 00010202
RAX: dffffc0000000000 RBX: ffff888075746000 RCX: 0000000000000000
RDX: 0000000000000070 RSI: ffffc900038dfe3e RDI: 0000000000000380
RBP: ffff8881423a8000 R08: 0000000000000001 R09: ffff8881423a8535
R10: ffffed10284750a6 R11: 0000000000000000 R12: 0000000000000000
R13: ffffc900038dfe37 R14: ffffc900038dfe38 R15: ffff8881423a8012
FS:  0000555555d8a300(0000) GS:ffff8880b9d00000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 000055c5ab377018 CR3: 000000007f17d000 CR4: 00000000003506e0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
----------------
Code disassembly (best guess):
   0:	80 3c 02 00          	cmpb   $0x0,(%rdx,%rax,1)
   4:	0f 85 fc 07 00 00    	jne    0x806
   a:	4c 8b a5 38 05 00 00 	mov    0x538(%rbp),%r12
  11:	48 b8 00 00 00 00 00 	movabs $0xdffffc0000000000,%rax
  18:	fc ff df
  1b:	49 8d bc 24 80 03 00 	lea    0x380(%r12),%rdi
  22:	00
  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 a9 07 00 00    	jne    0x7dd
  34:	49 8b b4 24 80 03 00 	mov    0x380(%r12),%rsi
  3b:	00
  3c:	4c 89 f2             	mov    %r14,%rdx
  3f:	48                   	rex.W

Crashes (17):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2022/03/25 12:12 net-old 169e77764adc 89bc8608 .config console log report syz C ci-upstream-net-this-kasan-gce general protection fault in llc_ui_connect
2022/03/25 02:37 net-next-old 169e77764adc 89bc8608 .config console log report syz C ci-upstream-net-kasan-gce general protection fault in llc_ui_connect
2022/03/25 23:09 upstream 34af78c4e616 89bc8608 .config console log report info ci-upstream-kasan-gce-smack-root general protection fault in llc_ui_connect
2022/03/28 20:20 net-next-old 169e77764adc ee339263 .config console log report info ci-upstream-net-kasan-gce general protection fault in llc_ui_connect
2022/03/28 05:47 net-next-old 169e77764adc 89bc8608 .config console log report info ci-upstream-net-kasan-gce general protection fault in llc_ui_connect
2022/03/28 04:56 net-next-old 169e77764adc 89bc8608 .config console log report info ci-upstream-net-kasan-gce general protection fault in llc_ui_connect
2022/03/28 01:49 net-next-old 169e77764adc 89bc8608 .config console log report info ci-upstream-net-kasan-gce general protection fault in llc_ui_connect
2022/03/27 14:18 net-next-old 169e77764adc 89bc8608 .config console log report info ci-upstream-net-kasan-gce general protection fault in llc_ui_connect
2022/03/27 12:25 net-next-old 169e77764adc 89bc8608 .config console log report info ci-upstream-net-kasan-gce general protection fault in llc_ui_connect
2022/03/27 10:31 net-next-old 169e77764adc 89bc8608 .config console log report info ci-upstream-net-kasan-gce general protection fault in llc_ui_connect
2022/03/27 08:32 net-next-old 169e77764adc 89bc8608 .config console log report info ci-upstream-net-kasan-gce general protection fault in llc_ui_connect
2022/03/27 07:16 net-next-old 169e77764adc 89bc8608 .config console log report info ci-upstream-net-kasan-gce general protection fault in llc_ui_connect
2022/03/26 05:09 net-next-old 169e77764adc 89bc8608 .config console log report info ci-upstream-net-kasan-gce general protection fault in llc_ui_connect
2022/03/25 22:52 net-next-old 169e77764adc 89bc8608 .config console log report info ci-upstream-net-kasan-gce general protection fault in llc_ui_connect
2022/03/25 14:17 net-next-old 169e77764adc 89bc8608 .config console log report info ci-upstream-net-kasan-gce general protection fault in llc_ui_connect
2022/03/25 02:19 net-next-old 169e77764adc 89bc8608 .config console log report info ci-upstream-net-kasan-gce general protection fault in llc_ui_connect
2022/03/25 23:08 linux-next fd4fbb998102 89bc8608 .config console log report info ci-upstream-linux-next-kasan-gce-root general protection fault in llc_ui_connect
* Struck through repros no longer work on HEAD.