yshigeru / linux-devel

Linux kernel source tree
Other
0 stars 0 forks source link

BUG: unable to handle kernel NULL pointer dereference in dccp_write_xmit #22

Closed yshigeru closed 9 months ago

yshigeru commented 9 months ago
BUG: kernel NULL pointer dereference, address: 0000000000000000
#PF: supervisor read access in kernel mode
#PF: error_code(0x0000) - not-present page
PGD 34d81067 P4D 34d81067 PUD 33cd7067 PMD 0 
Oops: 0000 [#1] PREEMPT SMP
CPU: 1 PID: 8696 Comm: syz-executor.6 Not tainted 6.6.0-03860-g5a6a09e97199 #7
Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.16.2-1.fc38 04/01/2014
RIP: 0010:ccid_hc_tx_send_packet net/dccp/ccid.h:166 [inline]
RIP: 0010:dccp_write_xmit+0x49/0x140 net/dccp/output.c:356
Code: 00 00 48 85 c0 49 89 c4 0f 84 da 00 00 00 e8 4e 28 f5 fc 4c 89 ef e8 b6 7a 09 fd 48 8b 9d 38 06 00 00 48 89 df e8 a7 7a 09 fd <48> 8b 1b 48 8d bb b0 00 00 00 e8 98 7a 09 fd 48 8b 9b b0 00 00 00
RSP: 0018:ffffc90000ad3b70 EFLAGS: 00010246
RAX: ffff88803153ceb0 RBX: 0000000000000000 RCX: 0001ffffffffffff
RDX: 0000000000000578 RSI: ffffffff8432ec29 RDI: 0000000000000000
RBP: ffff88800888a580 R08: ffffffff86ca8698 R09: 0000000000000000
R10: 0001c90000ad3bd4 R11: 0000000000000000 R12: ffff888009d83c00
R13: ffff88800888abb8 R14: ffffc90000ad3e78 R15: ffff888009d83c00
FS:  00007f81db37d6c0(0000) GS:ffff88807dd00000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 0000000000000000 CR3: 0000000034d19000 CR4: 0000000000750ef0
PKRU: 55555554
Call Trace:
 <TASK>
 dccp_sendmsg+0x642/0x7e0 net/dccp/proto.c:801
 inet_sendmsg+0x63/0x90 net/ipv4/af_inet.c:846
 sock_sendmsg_nosec net/socket.c:730 [inline]
 __sock_sendmsg+0x83/0xe0 net/socket.c:745
 ____sys_sendmsg+0x443/0x510 net/socket.c:2558
 ___sys_sendmsg+0xe5/0x150 net/socket.c:2612
 __sys_sendmsg+0xa6/0x120 net/socket.c:2641
 __do_sys_sendmsg net/socket.c:2650 [inline]
 __se_sys_sendmsg net/socket.c:2648 [inline]
 __x64_sys_sendmsg+0x45/0x50 net/socket.c:2648
 do_syscall_x64 arch/x86/entry/common.c:51 [inline]
 do_syscall_64+0x43/0x110 arch/x86/entry/common.c:82
 entry_SYSCALL_64_after_hwframe+0x63/0x6b
RIP: 0033:0x4448cd
Code: 2e 0f 1f 84 00 00 00 00 00 0f 1f 40 00 f3 0f 1e fa 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:00007f81db37d0c8 EFLAGS: 00000246 ORIG_RAX: 000000000000002e
RAX: ffffffffffffffda RBX: 000000000057c050 RCX: 00000000004448cd
RDX: 0000000000000000 RSI: 0000000020000380 RDI: 0000000000000003
RBP: 0000000000000000 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 000000000057c05c
R13: ffffffffffffffb8 R14: 000000000057c050 R15: 00007fff4479eab0
 </TASK>
Modules linked in:
CR2: 0000000000000000
---[ end trace 0000000000000000 ]---
RIP: 0010:ccid_hc_tx_send_packet net/dccp/ccid.h:166 [inline]
RIP: 0010:dccp_write_xmit+0x49/0x140 net/dccp/output.c:356
Code: 00 00 48 85 c0 49 89 c4 0f 84 da 00 00 00 e8 4e 28 f5 fc 4c 89 ef e8 b6 7a 09 fd 48 8b 9d 38 06 00 00 48 89 df e8 a7 7a 09 fd <48> 8b 1b 48 8d bb b0 00 00 00 e8 98 7a 09 fd 48 8b 9b b0 00 00 00
RSP: 0018:ffffc90000ad3b70 EFLAGS: 00010246
RAX: ffff88803153ceb0 RBX: 0000000000000000 RCX: 0001ffffffffffff
RDX: 0000000000000578 RSI: ffffffff8432ec29 RDI: 0000000000000000
RBP: ffff88800888a580 R08: ffffffff86ca8698 R09: 0000000000000000
R10: 0001c90000ad3bd4 R11: 0000000000000000 R12: ffff888009d83c00
R13: ffff88800888abb8 R14: ffffc90000ad3e78 R15: ffff888009d83c00
FS:  00007f81db37d6c0(0000) GS:ffff88807dd00000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 0000000000000000 CR3: 0000000034d19000 CR4: 0000000000750ef0
PKRU: 55555554
----------------
Code disassembly (best guess):
   0:   00 00                   add    %al,(%rax)
   2:   48 85 c0                test   %rax,%rax
   5:   49 89 c4                mov    %rax,%r12
   8:   0f 84 da 00 00 00       je     0xe8
   e:   e8 4e 28 f5 fc          call   0xfcf52861
  13:   4c 89 ef                mov    %r13,%rdi
  16:   e8 b6 7a 09 fd          call   0xfd097ad1
  1b:   48 8b 9d 38 06 00 00    mov    0x638(%rbp),%rbx
  22:   48 89 df                mov    %rbx,%rdi
  25:   e8 a7 7a 09 fd          call   0xfd097ad1
* 2a:   48 8b 1b                mov    (%rbx),%rbx <-- trapping instruction
  2d:   48 8d bb b0 00 00 00    lea    0xb0(%rbx),%rdi
  34:   e8 98 7a 09 fd          call   0xfd097ad1
  39:   48 8b 9b b0 00 00 00    mov    0xb0(%rbx),%rbx
yshigeru commented 9 months ago

repro.c.gz

yshigeru commented 9 months ago

Sent v1 patch: https://lore.kernel.org/all/20231214050922.3480023-1-syoshida@redhat.com/

yshigeru commented 9 months ago

Merged on net tree:https://git.kernel.org/pub/scm/linux/kernel/git/netdev/net.git/commit/?id=cac23b7d7627