syzbot


BUG: unable to handle kernel NULL pointer dereference in nci_send_cmd

Status: upstream: reported C repro on 2022/11/16 10:52
Reported-by: syzbot+4adf5ff0f6e6876c6a81@syzkaller.appspotmail.com
First crash: 13d, last: 4d12h

Cause bisection: introduced by (bisect log) :
commit e624e6c3e777fb3dfed036b9da4d433aee3608a5
Author: Bongsu Jeon <bongsu.jeon@samsung.com>
Date: Wed Jan 27 13:08:28 2021 +0000

  nfc: Add a virtual nci device driver

Crash: general protection fault in nci_send_cmd (log)
Repro: C syz .config
Patch testing requests:
Created Duration User Patch Repo Result
2022/11/16 13:11 19m linma@zju.edu.cn https://github.com/f0rm2l1n/linux-fix.git master OK log
2022/11/16 12:37 0m kylin.formalin@gmail.com https://github.com/f0rm2l1n/linux-forfix.git master error

Sample crash report:
general protection fault, probably for non-canonical address 0xdffffc0000000000: 0000 [#1] PREEMPT SMP KASAN
KASAN: null-ptr-deref in range [0x0000000000000000-0x0000000000000007]
CPU: 0 PID: 3636 Comm: syz-executor551 Not tainted 6.1.0-rc5-syzkaller-00015-g81e7cfa3a9eb #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 10/26/2022
RIP: 0010:__queue_work+0x1f6/0x13b0 kernel/workqueue.c:1459
Code: ff ff 48 89 c3 e8 2a 6b 2e 00 4c 89 e7 e8 f2 59 ff ff 48 85 c0 49 89 c5 0f 84 57 01 00 00 e8 11 6b 2e 00 48 89 d8 48 c1 e8 03 <80> 3c 28 00 0f 85 4a 10 00 00 4c 39 2b 0f 84 51 01 00 00 e8 f2 6a
RSP: 0018:ffffc90003dff388 EFLAGS: 00010056
RAX: 0000000000000000 RBX: 0000000000000000 RCX: 0000000000000000
RDX: ffff888020e2ba80 RSI: ffffffff8151ae6f RDI: 0000000000000001
RBP: dffffc0000000000 R08: 0000000000000001 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000000 R12: ffff888020a890f8
R13: ffff888012069800 R14: ffff888021d5d800 R15: ffff888021d5d800
FS:  00007f11539a4700(0000) GS:ffff8880b9a00000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00007f1153a55390 CR3: 0000000077b28000 CR4: 0000000000350ef0
Call Trace:
 <TASK>
 queue_work_on+0xf2/0x110 kernel/workqueue.c:1545
 queue_work include/linux/workqueue.h:503 [inline]
 nci_send_cmd+0x247/0x340 net/nfc/nci/core.c:1376
 nci_reset_req+0x76/0xa0 net/nfc/nci/core.c:166
 __nci_request+0x87/0x280 net/nfc/nci/core.c:107
 nci_open_device net/nfc/nci/core.c:502 [inline]
 nci_dev_up+0x2af/0x670 net/nfc/nci/core.c:631
 nfc_dev_up+0x1aa/0x3b0 net/nfc/core.c:118
 nfc_genl_dev_up+0xa6/0xf0 net/nfc/netlink.c:770
 genl_family_rcv_msg_doit+0x228/0x320 net/netlink/genetlink.c:756
 genl_family_rcv_msg net/netlink/genetlink.c:833 [inline]
 genl_rcv_msg+0x445/0x780 net/netlink/genetlink.c:850
 netlink_rcv_skb+0x157/0x430 net/netlink/af_netlink.c:2540
 genl_rcv+0x28/0x40 net/netlink/genetlink.c:861
 netlink_unicast_kernel net/netlink/af_netlink.c:1319 [inline]
 netlink_unicast+0x547/0x7f0 net/netlink/af_netlink.c:1345
 netlink_sendmsg+0x91b/0xe10 net/netlink/af_netlink.c:1921
 sock_sendmsg_nosec net/socket.c:714 [inline]
 sock_sendmsg+0xd3/0x120 net/socket.c:734
 ____sys_sendmsg+0x712/0x8c0 net/socket.c:2482
 ___sys_sendmsg+0x110/0x1b0 net/socket.c:2536
 __sys_sendmsg+0xf7/0x1c0 net/socket.c:2565
 do_syscall_x64 arch/x86/entry/common.c:50 [inline]
 do_syscall_64+0x39/0xb0 arch/x86/entry/common.c:80
 entry_SYSCALL_64_after_hwframe+0x63/0xcd
RIP: 0033:0x7f1153a142f9
Code: 28 00 00 00 75 05 48 83 c4 28 c3 e8 d1 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:00007f11539a4318 EFLAGS: 00000246 ORIG_RAX: 000000000000002e
RAX: ffffffffffffffda RBX: 00007f1153a9d438 RCX: 00007f1153a142f9
RDX: 0000000000000000 RSI: 0000000020000040 RDI: 0000000000000004
RBP: 00007f1153a9d430 R08: 0000000000000001 R09: 0000000000000000
R10: 0000000000000008 R11: 0000000000000246 R12: 00007f1153a6a134
R13: 00007ffc4c3309cf R14: 00007f11539a4400 R15: 0000000000022000
 </TASK>
Modules linked in:
---[ end trace 0000000000000000 ]---
RIP: 0010:__queue_work+0x1f6/0x13b0 kernel/workqueue.c:1459
Code: ff ff 48 89 c3 e8 2a 6b 2e 00 4c 89 e7 e8 f2 59 ff ff 48 85 c0 49 89 c5 0f 84 57 01 00 00 e8 11 6b 2e 00 48 89 d8 48 c1 e8 03 <80> 3c 28 00 0f 85 4a 10 00 00 4c 39 2b 0f 84 51 01 00 00 e8 f2 6a
RSP: 0018:ffffc90003dff388 EFLAGS: 00010056
RAX: 0000000000000000 RBX: 0000000000000000 RCX: 0000000000000000
RDX: ffff888020e2ba80 RSI: ffffffff8151ae6f RDI: 0000000000000001
RBP: dffffc0000000000 R08: 0000000000000001 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000000 R12: ffff888020a890f8
R13: ffff888012069800 R14: ffff888021d5d800 R15: ffff888021d5d800
FS:  00007f11539a4700(0000) GS:ffff8880b9a00000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00007f1153a55390 CR3: 0000000077b28000 CR4: 0000000000350ef0
----------------
Code disassembly (best guess), 1 bytes skipped:
   0:	ff 48 89             	decl   -0x77(%rax)
   3:	c3                   	retq
   4:	e8 2a 6b 2e 00       	callq  0x2e6b33
   9:	4c 89 e7             	mov    %r12,%rdi
   c:	e8 f2 59 ff ff       	callq  0xffff5a03
  11:	48 85 c0             	test   %rax,%rax
  14:	49 89 c5             	mov    %rax,%r13
  17:	0f 84 57 01 00 00    	je     0x174
  1d:	e8 11 6b 2e 00       	callq  0x2e6b33
  22:	48 89 d8             	mov    %rbx,%rax
  25:	48 c1 e8 03          	shr    $0x3,%rax
* 29:	80 3c 28 00          	cmpb   $0x0,(%rax,%rbp,1) <-- trapping instruction
  2d:	0f 85 4a 10 00 00    	jne    0x107d
  33:	4c 39 2b             	cmp    %r13,(%rbx)
  36:	0f 84 51 01 00 00    	je     0x18d
  3c:	e8                   	.byte 0xe8
  3d:	f2                   	repnz
  3e:	6a                   	.byte 0x6a

Crashes (137):
Manager Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Title
ci-upstream-kasan-gce-root 2022/11/16 08:15 upstream 81e7cfa3a9eb 3a127a31 .config log report syz C general protection fault in nci_send_cmd
ci-upstream-kasan-gce-root 2022/11/16 07:44 upstream 81e7cfa3a9eb 3a127a31 .config log report syz C general protection fault in nci_send_cmd
ci-qemu2-arm32 2022/11/24 22:40 upstream c3eb11fbb826 3b903dad .config log report info BUG: unable to handle kernel NULL pointer dereference in nci_send_cmd
ci-qemu2-arm32 2022/11/24 21:14 upstream c3eb11fbb826 3b903dad .config log report info BUG: unable to handle kernel NULL pointer dereference in nci_send_cmd
ci-qemu2-arm32 2022/11/24 17:05 upstream c3eb11fbb826 3b903dad .config log report info BUG: unable to handle kernel NULL pointer dereference in nci_send_cmd
ci-qemu2-arm32 2022/11/24 09:39 upstream 4312098baf37 ff68ff8f .config log report info BUG: unable to handle kernel NULL pointer dereference in nci_send_cmd
ci-qemu2-arm32 2022/11/23 18:57 upstream eb7081409f94 52fdf57a .config log report info BUG: unable to handle kernel NULL pointer dereference in nci_send_cmd
ci-qemu2-arm32 2022/11/23 09:25 upstream eb7081409f94 75740b3f .config log report info BUG: unable to handle kernel NULL pointer dereference in nci_send_cmd
ci-qemu2-arm32 2022/11/22 22:26 upstream eb7081409f94 1c8e10bc .config log report info BUG: unable to handle kernel NULL pointer dereference in nci_send_cmd
ci-qemu2-arm32 2022/11/22 20:51 upstream eb7081409f94 1c8e10bc .config log report info BUG: unable to handle kernel NULL pointer dereference in nci_send_cmd
ci-qemu2-arm32 2022/11/22 19:16 upstream eb7081409f94 1c8e10bc .config log report info BUG: unable to handle kernel NULL pointer dereference in nci_send_cmd
ci-qemu2-arm32 2022/11/22 17:48 upstream eb7081409f94 1c8e10bc .config log report info BUG: unable to handle kernel NULL pointer dereference in nci_send_cmd
ci-qemu2-arm32 2022/11/22 08:57 upstream eb7081409f94 1c576c23 .config log report info BUG: unable to handle kernel NULL pointer dereference in nci_send_cmd
ci-qemu2-arm32 2022/11/21 21:11 upstream eb7081409f94 f9a97739 .config log report info BUG: unable to handle kernel NULL pointer dereference in nci_send_cmd
ci-qemu2-arm32 2022/11/21 19:36 upstream eb7081409f94 f9a97739 .config log report info BUG: unable to handle kernel NULL pointer dereference in nci_send_cmd
ci-qemu2-arm32 2022/11/21 17:58 upstream eb7081409f94 f9a97739 .config log report info BUG: unable to handle kernel NULL pointer dereference in nci_send_cmd
ci-qemu2-arm32 2022/11/21 16:50 upstream eb7081409f94 f9a97739 .config log report info BUG: unable to handle kernel NULL pointer dereference in nci_send_cmd
ci-qemu2-arm32 2022/11/21 09:55 upstream eb7081409f94 5bb70014 .config log report info BUG: unable to handle kernel NULL pointer dereference in nci_send_cmd
ci-qemu2-arm32 2022/11/21 08:39 upstream eb7081409f94 5bb70014 .config log report info BUG: unable to handle kernel NULL pointer dereference in nci_send_cmd
ci-qemu2-arm32 2022/11/21 01:23 upstream 77c51ba552a1 5bb70014 .config log report info BUG: unable to handle kernel NULL pointer dereference in nci_send_cmd
ci-qemu2-arm32 2022/11/20 23:16 upstream 77c51ba552a1 5bb70014 .config log report info BUG: unable to handle kernel NULL pointer dereference in nci_send_cmd
ci-qemu2-arm32 2022/11/20 21:42 upstream 77c51ba552a1 5bb70014 .config log report info BUG: unable to handle kernel NULL pointer dereference in nci_send_cmd
ci-qemu2-arm32 2022/11/20 19:37 upstream 77c51ba552a1 5bb70014 .config log report info BUG: unable to handle kernel NULL pointer dereference in nci_send_cmd
ci-qemu2-arm32 2022/11/20 10:03 upstream b6e7fdfd6f6a 5bb70014 .config log report info BUG: unable to handle kernel NULL pointer dereference in nci_send_cmd
ci-qemu2-arm32 2022/11/20 07:53 upstream b6e7fdfd6f6a 5bb70014 .config log report info BUG: unable to handle kernel NULL pointer dereference in nci_send_cmd
ci-qemu2-arm32 2022/11/19 22:41 upstream fe24a97cf254 5bb70014 .config log report info BUG: unable to handle kernel NULL pointer dereference in nci_send_cmd
ci-qemu2-arm32 2022/11/19 19:10 upstream fe24a97cf254 5bb70014 .config log report info BUG: unable to handle kernel NULL pointer dereference in nci_send_cmd
ci-qemu2-arm32 2022/11/19 05:42 upstream 950a9f564aea 5bb70014 .config log report info BUG: unable to handle kernel NULL pointer dereference in nci_send_cmd
ci-qemu2-arm32 2022/11/18 19:02 upstream 84368d882b96 5bb70014 .config log report info BUG: unable to handle kernel NULL pointer dereference in nci_send_cmd
ci-qemu2-arm32 2022/11/18 17:09 upstream 84368d882b96 5bb70014 .config log report info BUG: unable to handle kernel NULL pointer dereference in nci_send_cmd
ci-qemu2-arm32 2022/11/18 13:31 upstream 84368d882b96 5bb70014 .config log report info BUG: unable to handle kernel NULL pointer dereference in nci_send_cmd
ci-qemu2-arm32 2022/11/18 13:02 upstream 84368d882b96 5bb70014 .config log report info BUG: unable to handle kernel NULL pointer dereference in nci_send_cmd
ci-qemu2-arm32 2022/11/18 12:44 upstream 84368d882b96 5bb70014 .config log report info BUG: unable to handle kernel NULL pointer dereference in nci_send_cmd
ci-qemu2-arm32 2022/11/18 11:46 upstream 84368d882b96 5bb70014 .config log report info BUG: unable to handle kernel NULL pointer dereference in nci_send_cmd
ci-qemu2-arm32 2022/11/18 10:40 upstream 84368d882b96 5bb70014 .config log report info BUG: unable to handle kernel NULL pointer dereference in nci_send_cmd
ci-qemu2-arm32 2022/11/18 10:11 upstream 84368d882b96 5bb70014 .config log report info BUG: unable to handle kernel NULL pointer dereference in nci_send_cmd
ci-qemu2-arm32 2022/11/17 13:38 upstream cc675d22e422 bfcab33d .config log report info BUG: unable to handle kernel NULL pointer dereference in nci_send_cmd
ci-qemu2-arm32 2022/11/16 02:21 upstream 81e7cfa3a9eb bfcab33d .config log report info BUG: unable to handle kernel NULL pointer dereference in nci_send_cmd
ci-upstream-kasan-gce-selinux-root 2022/11/24 05:16 upstream 4312098baf37 12c66417 .config log report info general protection fault in nci_send_cmd
ci-qemu-upstream 2022/11/23 08:22 upstream eb7081409f94 75740b3f .config log report info general protection fault in nci_send_cmd
ci-upstream-kasan-gce-smack-root 2022/11/21 06:16 upstream 77c51ba552a1 5bb70014 .config log report info general protection fault in nci_send_cmd
ci-upstream-kasan-gce-root 2022/11/21 04:20 upstream 77c51ba552a1 5bb70014 .config log report info general protection fault in nci_send_cmd
ci-upstream-kasan-gce-smack-root 2022/11/20 16:16 upstream b6e7fdfd6f6a 5bb70014 .config log report info general protection fault in nci_send_cmd
ci-upstream-kasan-gce-root 2022/11/18 21:26 upstream 84368d882b96 5bb70014 .config log report info general protection fault in nci_send_cmd
ci-qemu2-arm64 2022/11/24 10:58 upstream 4312098baf37 ff68ff8f .config log report info BUG: unable to handle kernel paging request in nci_send_cmd
ci-qemu2-arm64 2022/11/23 10:28 upstream eb7081409f94 75740b3f .config log report info BUG: unable to handle kernel paging request in nci_send_cmd
ci-qemu2-arm64-mte 2022/11/21 00:17 upstream 77c51ba552a1 5bb70014 .config log report info KASAN: use-after-free Read in nci_send_cmd
ci-qemu2-arm64 2022/11/20 12:45 upstream b6e7fdfd6f6a 5bb70014 .config log report info BUG: unable to handle kernel paging request in nci_send_cmd
ci-qemu2-arm64 2022/11/20 12:16 upstream b6e7fdfd6f6a 5bb70014 .config log report info BUG: unable to handle kernel paging request in nci_send_cmd
ci-qemu2-arm64 2022/11/20 11:09 upstream b6e7fdfd6f6a 5bb70014 .config log report info BUG: unable to handle kernel paging request in nci_send_cmd
ci-qemu2-arm64 2022/11/19 08:31 upstream ab290eaddc4c 5bb70014 .config log report info BUG: unable to handle kernel paging request in nci_send_cmd
ci-qemu2-arm64 2022/11/18 20:28 upstream 84368d882b96 5bb70014 .config log report info BUG: unable to handle kernel paging request in nci_send_cmd
ci-qemu2-arm64 2022/11/18 15:42 upstream 84368d882b96 5bb70014 .config log report info BUG: unable to handle kernel paging request in nci_send_cmd
ci-qemu2-arm64 2022/11/18 14:33 upstream 84368d882b96 5bb70014 .config log report info BUG: unable to handle kernel paging request in nci_send_cmd
ci-qemu2-arm64 2022/11/18 14:29 upstream 84368d882b96 5bb70014 .config log report info BUG: unable to handle kernel paging request in nci_send_cmd
ci-qemu2-arm64 2022/11/18 14:19 upstream 84368d882b96 5bb70014 .config log report info BUG: unable to handle kernel paging request in nci_send_cmd
ci-qemu2-arm64 2022/11/17 13:42 upstream cc675d22e422 bfcab33d .config log report info BUG: unable to handle kernel paging request in nci_send_cmd
ci-qemu2-arm64 2022/11/17 13:22 upstream cc675d22e422 bfcab33d .config log report info BUG: unable to handle kernel paging request in nci_send_cmd
ci-qemu2-arm64 2022/11/17 10:14 upstream cc675d22e422 bfcab33d .config log report info KASAN: use-after-free Read in nci_send_cmd
ci-upstream-linux-next-kasan-gce-root 2022/11/18 13:20 linux-next 15f3bff12cf6 4ba8ab94 .config log report info general protection fault in nci_send_cmd
ci-qemu2-riscv64 2022/11/20 08:40 git://git.kernel.org/pub/scm/linux/kernel/git/riscv/linux.git fixes 0966d385830d 5bb70014 .config log report info KASAN: null-ptr-deref Read in nci_send_cmd
* Struck through repros no longer work on HEAD.