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: 2109d, last: 2096d
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
* Struck through repros no longer work on HEAD.