syzbot


general protection fault in llc_build_and_send_xid_pkt

Status: fixed on 2023/02/24 13:51
Subsystems: net
[Documentation on labels]
Fix commit: 2d327a79ee17 llc: only change llc->dev when bind() succeeds
First crash: 764d, last: 764d
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_xid_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: 3594 Comm: syz-executor210 Not tainted 5.17.0-rc8-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
RIP: 0010:llc_build_and_send_xid_pkt+0xda/0x1f0 net/llc/llc_sap.c:264
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:ffffc9000387f898 EFLAGS: 00010202
RAX: dffffc0000000000 RBX: 0000000000000000 RCX: 0000000000000000
RDX: 0000000000000070 RSI: ffffffff874f28a8 RDI: 0000000000000380
RBP: ffff88807ccda780 R08: 0000000000000000 R09: 0000000000000008
R10: ffffffff874f9d68 R11: 0000000000000000 R12: ffff888019be2000
R13: ffff888078e5f510 R14: 00000000000000c0 R15: 0000000000000000
FS:  00007fae34338700(0000) GS:ffff8880b9d00000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 0000000020010038 CR3: 0000000078273000 CR4: 00000000003506e0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
Call Trace:
 <TASK>
 llc_ui_sendmsg+0xa72/0x10d0 net/llc/af_llc.c:979
 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:0x7fae343a78d9
Code: 28 00 00 00 75 05 48 83 c4 28 c3 e8 11 15 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:00007fae34338318 EFLAGS: 00000246 ORIG_RAX: 0000000000000133
RAX: ffffffffffffffda RBX: 00007fae3442f3f8 RCX: 00007fae343a78d9
RDX: 03fffffffffffeed RSI: 0000000020001380 RDI: 0000000000000003
RBP: 00007fae3442f3f0 R08: 00007fae34338700 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 00007fae3442f3fc
R13: 00007ffcf379395f R14: 00007fae34338400 R15: 0000000000022000
 </TASK>
Modules linked in:
---[ end trace 0000000000000000 ]---
RIP: 0010:llc_build_and_send_xid_pkt+0xda/0x1f0 net/llc/llc_sap.c:264
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:ffffc9000387f898 EFLAGS: 00010202
RAX: dffffc0000000000 RBX: 0000000000000000 RCX: 0000000000000000
RDX: 0000000000000070 RSI: ffffffff874f28a8 RDI: 0000000000000380
RBP: ffff88807ccda780 R08: 0000000000000000 R09: 0000000000000008
R10: ffffffff874f9d68 R11: 0000000000000000 R12: ffff888019be2000
R13: ffff888078e5f510 R14: 00000000000000c0 R15: 0000000000000000
FS:  00007fae34338700(0000) GS:ffff8880b9c00000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00007fae343e8a80 CR3: 0000000078273000 CR4: 00000000003506f0
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 (2):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2022/03/24 11:54 net-next-old 89695196f0ba 89bc8608 .config console log report syz C ci-upstream-net-kasan-gce general protection fault in llc_build_and_send_xid_pkt
2022/03/24 09:16 net-next-old 89695196f0ba 89bc8608 .config console log report info ci-upstream-net-kasan-gce general protection fault in llc_build_and_send_xid_pkt
* Struck through repros no longer work on HEAD.