syzbot


BUG: unable to handle kernel NULL pointer dereference in kcsan_setup_watchpoint

Status: fixed on 2021/03/10 01:48
Subsystems: kasan
[Documentation on labels]
Fix commit: 55a2346c7ac4 kcsan: Never set up watchpoints on NULL pointers
First crash: 1508d, last: 1495d

Sample crash report:
BUG: kernel NULL pointer dereference, address: 0000000000000000
#PF: supervisor read access in kernel mode
#PF: error_code(0x0000) - not-present page
PGD 10d999067 P4D 10d999067 PUD 10e71a067 PMD 0 
Oops: 0000 [#1] PREEMPT SMP
CPU: 1 PID: 20832 Comm: syz-executor.4 Not tainted 5.10.0-rc1-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
RIP: 0010:kcsan_setup_watchpoint+0x1c7/0x4d0 kernel/kcsan/core.c:473
Code: fd 07 4c 89 14 24 48 89 54 24 48 4c 89 6c 24 10 48 89 7c 24 40 48 89 6c 24 20 77 14 31 d2 48 8b 44 24 08 ff 24 ed 28 d0 c5 85 <8a> 08 31 db 31 f6 31 d2 eb 6a f0 48 ff 05 b7 44 db 06 80 3d 72 42
RSP: 0018:ffffc900012bf7e8 EFLAGS: 00010046
RAX: 0000000000000000 RBX: 0000000000000000 RCX: 0000000000000000
RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000000000000
RBP: 0000000000000000 R08: 00000000aaaaaaab R09: 0002000000000000
R10: 0000000000000246 R11: ffff88810e550040 R12: 0000000000000001
R13: 0000000000000000 R14: 0000000100004db6 R15: 0000000000000001
FS:  00007fca5765f700(0000) GS:ffff88813bd00000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 0000000000000000 CR3: 000000010a28a000 CR4: 00000000001506e0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
Call Trace:
 scsi_command_size include/scsi/scsi_common.h:24 [inline]
 scsi_setup_scsi_cmnd drivers/scsi/scsi_lib.c:1195 [inline]
 scsi_prepare_cmd drivers/scsi/scsi_lib.c:1577 [inline]
 scsi_queue_rq+0xddf/0x1380 drivers/scsi/scsi_lib.c:1666
 blk_mq_dispatch_rq_list+0x4cc/0xd30 block/blk-mq.c:1388
 __blk_mq_sched_dispatch_requests+0x1e7/0x2a0 block/blk-mq-sched.c:308
 blk_mq_sched_dispatch_requests+0x8f/0xf0 block/blk-mq-sched.c:341
 __blk_mq_run_hw_queue+0xee/0x1c0 block/blk-mq.c:1532
 __blk_mq_delay_run_hw_queue+0x17d/0x330 block/blk-mq.c:1609
 blk_mq_run_hw_queue+0x231/0x260 block/blk-mq.c:1662
 blk_mq_sched_insert_request+0x247/0x280 block/blk-mq-sched.c:467
 blk_execute_rq_nowait block/blk-exec.c:64 [inline]
 blk_execute_rq+0x111/0x160 block/blk-exec.c:86
 sg_io+0x5d9/0x810 block/scsi_ioctl.c:360
 scsi_cmd_ioctl+0x540/0x990 block/scsi_ioctl.c:809
 scsi_cmd_blk_ioctl+0xa1/0xb0 block/scsi_ioctl.c:867
 sd_ioctl_common+0x13f/0x1a0 drivers/scsi/sd.c:1575
 sd_ioctl+0x26/0x90 drivers/scsi/sd.c:1765
 __blkdev_driver_ioctl block/ioctl.c:228 [inline]
 blkdev_ioctl+0x1d6/0x3f0 block/ioctl.c:623
 block_ioctl+0x6d/0x80 fs/block_dev.c:1869
 vfs_ioctl fs/ioctl.c:48 [inline]
 __do_sys_ioctl fs/ioctl.c:753 [inline]
 __se_sys_ioctl+0xcb/0x140 fs/ioctl.c:739
 __x64_sys_ioctl+0x3f/0x50 fs/ioctl.c:739
 do_syscall_64+0x39/0x80 arch/x86/entry/common.c:46
 entry_SYSCALL_64_after_hwframe+0x44/0xa9
RIP: 0033:0x45deb9
Code: 0d b4 fb ff c3 66 2e 0f 1f 84 00 00 00 00 00 66 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 0f 83 db b3 fb ff c3 66 2e 0f 1f 84 00 00 00 00
RSP: 002b:00007fca5765ec78 EFLAGS: 00000246 ORIG_RAX: 0000000000000010
RAX: ffffffffffffffda RBX: 0000000000014fc0 RCX: 000000000045deb9
RDX: 0000000020002300 RSI: 0000000000002285 RDI: 0000000000000004
RBP: 000000000118bf60 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 000000000118bf2c
R13: 00007fff382c225f R14: 00007fca5765f9c0 R15: 000000000118bf2c
Modules linked in:
CR2: 0000000000000000
---[ end trace 8f91f3c2cfdfa3a5 ]---
RIP: 0010:kcsan_setup_watchpoint+0x1c7/0x4d0 kernel/kcsan/core.c:473
Code: fd 07 4c 89 14 24 48 89 54 24 48 4c 89 6c 24 10 48 89 7c 24 40 48 89 6c 24 20 77 14 31 d2 48 8b 44 24 08 ff 24 ed 28 d0 c5 85 <8a> 08 31 db 31 f6 31 d2 eb 6a f0 48 ff 05 b7 44 db 06 80 3d 72 42
RSP: 0018:ffffc900012bf7e8 EFLAGS: 00010046
RAX: 0000000000000000 RBX: 0000000000000000 RCX: 0000000000000000
RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000000000000
RBP: 0000000000000000 R08: 00000000aaaaaaab R09: 0002000000000000
R10: 0000000000000246 R11: ffff88810e550040 R12: 0000000000000001
R13: 0000000000000000 R14: 0000000100004db6 R15: 0000000000000001
FS:  00007fca5765f700(0000) GS:ffff88813bd00000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 0000000000000000 CR3: 000000010a28a000 CR4: 00000000001506e0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400

Crashes (128):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2020/10/30 15:55 upstream 07e088730245 a6e3ac3b .config console log report info ci2-upstream-kcsan-gce
2020/10/29 20:43 upstream 23859ae44402 a0c7169a .config console log report info ci2-upstream-kcsan-gce
2020/10/29 19:38 upstream 23859ae44402 a0c7169a .config console log report info ci2-upstream-kcsan-gce
2020/10/29 14:19 upstream 23859ae44402 f24824d3 .config console log report info ci2-upstream-kcsan-gce
2020/10/29 12:28 upstream 23859ae44402 f24824d3 .config console log report info ci2-upstream-kcsan-gce
2020/10/29 10:32 upstream 23859ae44402 f24824d3 .config console log report info ci2-upstream-kcsan-gce
2020/10/29 09:09 upstream 23859ae44402 f24824d3 .config console log report info ci2-upstream-kcsan-gce
2020/10/29 08:39 upstream 23859ae44402 f24824d3 .config console log report info ci2-upstream-kcsan-gce
2020/10/29 07:02 upstream 23859ae44402 f24824d3 .config console log report info ci2-upstream-kcsan-gce
2020/10/29 04:41 upstream ed8780e3f2ec f24824d3 .config console log report info ci2-upstream-kcsan-gce
2020/10/28 21:48 upstream ed8780e3f2ec f24824d3 .config console log report info ci2-upstream-kcsan-gce
2020/10/28 20:40 upstream ed8780e3f2ec f24824d3 .config console log report info ci2-upstream-kcsan-gce
2020/10/28 18:01 upstream ed8780e3f2ec f24824d3 .config console log report info ci2-upstream-kcsan-gce
2020/10/28 14:58 upstream ed8780e3f2ec 96e03c1c .config console log report info ci2-upstream-kcsan-gce
2020/10/28 11:42 upstream ed8780e3f2ec 96e03c1c .config console log report info ci2-upstream-kcsan-gce
2020/10/28 08:57 upstream ed8780e3f2ec 96e03c1c .config console log report info ci2-upstream-kcsan-gce
2020/10/28 02:39 upstream ed8780e3f2ec 96e03c1c .config console log report info ci2-upstream-kcsan-gce
2020/10/28 01:04 upstream ed8780e3f2ec 96e03c1c .config console log report info ci2-upstream-kcsan-gce
2020/10/27 21:58 upstream 4525c8781ec0 94942294 .config console log report info ci2-upstream-kcsan-gce
2020/10/27 20:46 upstream 4525c8781ec0 94942294 .config console log report info ci2-upstream-kcsan-gce
2020/10/27 16:39 upstream 4525c8781ec0 94942294 .config console log report info ci2-upstream-kcsan-gce
2020/10/27 15:14 upstream 4525c8781ec0 94942294 .config console log report info ci2-upstream-kcsan-gce
2020/10/27 14:47 upstream 4525c8781ec0 94942294 .config console log report info ci2-upstream-kcsan-gce
2020/10/27 11:47 upstream 4525c8781ec0 94942294 .config console log report info ci2-upstream-kcsan-gce
2020/10/27 09:37 upstream 41ba50b0572e 8b3eaf58 .config console log report info ci2-upstream-kcsan-gce
2020/10/27 00:25 upstream 41ba50b0572e 8b3eaf58 .config console log report info ci2-upstream-kcsan-gce
2020/10/26 23:25 upstream 41ba50b0572e 8b3eaf58 .config console log report info ci2-upstream-kcsan-gce
2020/10/26 18:51 upstream 3650b228f83a a7aac492 .config console log report info ci2-upstream-kcsan-gce
2020/10/26 13:19 upstream 3650b228f83a a7aac492 .config console log report info ci2-upstream-kcsan-gce
2020/10/26 10:59 upstream 3650b228f83a a7aac492 .config console log report info ci2-upstream-kcsan-gce
2020/10/26 09:12 upstream 3650b228f83a a1839e81 .config console log report info ci2-upstream-kcsan-gce
2020/10/26 05:51 upstream 986b9eacb259 a1839e81 .config console log report info ci2-upstream-kcsan-gce
2020/10/26 03:39 upstream 986b9eacb259 a1839e81 .config console log report info ci2-upstream-kcsan-gce
2020/10/25 22:58 upstream 986b9eacb259 a1839e81 .config console log report info ci2-upstream-kcsan-gce
2020/10/25 21:45 upstream 986b9eacb259 a1839e81 .config console log report info ci2-upstream-kcsan-gce
2020/10/25 18:08 upstream d76913908102 a1839e81 .config console log report info ci2-upstream-kcsan-gce
2020/10/25 15:22 upstream d76913908102 a1839e81 .config console log report info ci2-upstream-kcsan-gce
2020/10/25 15:14 upstream d76913908102 a1839e81 .config console log report info ci2-upstream-kcsan-gce
2020/10/25 11:02 upstream d76913908102 a1839e81 .config console log report info ci2-upstream-kcsan-gce
2020/10/25 04:35 upstream d76913908102 a1839e81 .config console log report info ci2-upstream-kcsan-gce
2020/10/25 01:05 upstream f11901ed723d a1839e81 .config console log report info ci2-upstream-kcsan-gce
2020/10/24 23:27 upstream f11901ed723d a1839e81 .config console log report info ci2-upstream-kcsan-gce
2020/10/24 19:42 upstream f11901ed723d a1839e81 .config console log report info ci2-upstream-kcsan-gce
2020/10/24 16:07 upstream f11901ed723d a1839e81 .config console log report info ci2-upstream-kcsan-gce
2020/10/24 12:15 upstream f11901ed723d a1839e81 .config console log report info ci2-upstream-kcsan-gce
2020/10/24 10:27 upstream f11901ed723d 2bb6666c .config console log report info ci2-upstream-kcsan-gce
2020/10/24 02:06 upstream 0adc313c4f20 2bb6666c .config console log report info ci2-upstream-kcsan-gce
2020/10/22 02:58 upstream f804b3159482 be6b1582 .config console log report info ci2-upstream-kcsan-gce
2020/10/17 13:08 upstream 071a0578b0ce fea47c01 .config console log report info ci2-upstream-kcsan-gce
* Struck through repros no longer work on HEAD.