syzbot


general protection fault in __inet_hash_connect

Status: fixed on 2023/02/24 13:50
Subsystems: net
[Documentation on labels]
Fix commit: 593d1ebe00a4 Revert "net: Add a second bind table hashed by port and address"
First crash: 682d, last: 535d

Sample crash report:
general protection fault, probably for non-canonical address 0xdffffc0000000008: 0000 [#1] PREEMPT SMP KASAN
KASAN: null-ptr-deref in range [0x0000000000000040-0x0000000000000047]
CPU: 0 PID: 24256 Comm: syz-executor.3 Not tainted 6.1.0-rc1-syzkaller-00427-gd47136c28015 #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 10/11/2022
RIP: 0010:hlist_empty include/linux/list.h:876 [inline]
RIP: 0010:sk_head include/net/sock.h:706 [inline]
RIP: 0010:__inet_hash_connect+0x217/0x1660 net/ipv4/inet_hashtables.c:941
Code: 85 aa 13 00 00 49 8b 9c 24 a0 06 00 00 48 89 ef e8 0e 29 b4 01 48 b8 00 00 00 00 00 fc ff df 48 8d 7b 40 48 89 fa 48 c1 ea 03 <80> 3c 02 00 0f 85 86 12 00 00 4c 8b 73 40 4d 85 f6 74 0d e8 41 23
RSP: 0018:ffffc9000cc37770 EFLAGS: 00010202

RAX: dffffc0000000000 RBX: 0000000000000000 RCX: ffffffff81600890
RDX: 0000000000000008 RSI: 0000000000000004 RDI: 0000000000000040
RBP: ffff888028094a40 R08: 0000000000000001 R09: 0000000000000003
R10: fffff52001986ee0 R11: 000000000008c07e R12: ffff88807bc870c0
R13: 000000000000c194 R14: ffffffff8da9f1c0 R15: ffff888075bf54c0
FS:  00007f12d64de700(0000) GS:ffff8880b9a00000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00007f12d64ddff8 CR3: 000000007c080000 CR4: 00000000003506f0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 000000000000003b DR6: 00000000ffff0ff0 DR7: 0000000000000400
Call Trace:
 <TASK>
 dccp_v4_connect+0xc40/0x2010 net/dccp/ipv4.c:129
 __inet_stream_connect+0x69a/0xec0 net/ipv4/af_inet.c:665
 inet_stream_connect+0x53/0xa0 net/ipv4/af_inet.c:729
 __sys_connect_file+0x14f/0x190 net/socket.c:1976
 io_connect+0x3c8/0x720 io_uring/net.c:1425
 io_issue_sqe+0x83b/0x1210 io_uring/io_uring.c:1739
 io_queue_sqe io_uring/io_uring.c:1912 [inline]
 io_submit_sqe io_uring/io_uring.c:2170 [inline]
 io_submit_sqes+0x968/0x1df0 io_uring/io_uring.c:2281
 __do_sys_io_uring_enter+0xadb/0x2570 io_uring/io_uring.c:3215
 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+0x63/0xcd
RIP: 0033:0x7f12d528b5f9
Code: ff ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 40 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 b8 ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007f12d64de168 EFLAGS: 00000246 ORIG_RAX: 00000000000001aa
RAX: ffffffffffffffda RBX: 00007f12d53abf80 RCX: 00007f12d528b5f9
RDX: 0000000000000000 RSI: 00000000000045f5 RDI: 0000000000000003
RBP: 00007f12d64de1d0 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000001
R13: 00007f12d58dfb1f R14: 00007f12d64de300 R15: 0000000000022000
 </TASK>
Modules linked in:
---[ end trace 0000000000000000 ]---
RIP: 0010:hlist_empty include/linux/list.h:876 [inline]
RIP: 0010:sk_head include/net/sock.h:706 [inline]
RIP: 0010:__inet_hash_connect+0x217/0x1660 net/ipv4/inet_hashtables.c:941
Code: 85 aa 13 00 00 49 8b 9c 24 a0 06 00 00 48 89 ef e8 0e 29 b4 01 48 b8 00 00 00 00 00 fc ff df 48 8d 7b 40 48 89 fa 48 c1 ea 03 <80> 3c 02 00 0f 85 86 12 00 00 4c 8b 73 40 4d 85 f6 74 0d e8 41 23
RSP: 0018:ffffc9000cc37770 EFLAGS: 00010202
RAX: dffffc0000000000 RBX: 0000000000000000 RCX: ffffffff81600890
RDX: 0000000000000008 RSI: 0000000000000004 RDI: 0000000000000040
RBP: ffff888028094a40 R08: 0000000000000001 R09: 0000000000000003
R10: fffff52001986ee0 R11: 000000000008c07e R12: ffff88807bc870c0
R13: 000000000000c194 R14: ffffffff8da9f1c0 R15: ffff888075bf54c0
FS:  00007f12d64de700(0000) GS:ffff8880b9a00000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00007f12d64ddff8 CR3: 000000007c080000 CR4: 00000000003506f0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 000000000000003b DR6: 00000000ffff0ff0 DR7: 0000000000000400
----------------
Code disassembly (best guess):
   0:	85 aa 13 00 00 49    	test   %ebp,0x49000013(%rdx)
   6:	8b 9c 24 a0 06 00 00 	mov    0x6a0(%rsp),%ebx
   d:	48 89 ef             	mov    %rbp,%rdi
  10:	e8 0e 29 b4 01       	callq  0x1b42923
  15:	48 b8 00 00 00 00 00 	movabs $0xdffffc0000000000,%rax
  1c:	fc ff df
  1f:	48 8d 7b 40          	lea    0x40(%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 86 12 00 00    	jne    0x12ba
  34:	4c 8b 73 40          	mov    0x40(%rbx),%r14
  38:	4d 85 f6             	test   %r14,%r14
  3b:	74 0d                	je     0x4a
  3d:	e8                   	.byte 0xe8
  3e:	41                   	rex.B
  3f:	23                   	.byte 0x23

Crashes (5):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2022/10/23 08:47 upstream d47136c28015 c0b80a55 .config console log report info ci-upstream-kasan-gce general protection fault in __inet_hash_connect
2022/10/21 09:40 upstream 6d36c728bc2e 63e790dd .config console log report info ci-upstream-kasan-gce general protection fault in __inet_hash_connect
2022/10/09 15:04 upstream a6afa4199d3d aea5da89 .config console log report info [disk image] [vmlinux] ci-upstream-kasan-gce general protection fault in __inet_hash_connect
2022/06/15 07:42 upstream 018ab4fabddd 127d1faf .config console log report info ci-upstream-kasan-gce general protection fault in __inet_hash_connect
2022/11/08 12:27 git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux.git for-kernelci 3577a7611842 881db35d .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-gce-arm64 BUG: unable to handle kernel NULL pointer dereference in __inet_hash_connect
* Struck through repros no longer work on HEAD.