syzbot


KASAN: null-ptr-deref Write in blk_mq_map_swqueue

Status: fixed on 2020/06/25 16:52
Subsystems: block
[Documentation on labels]
Reported-by: syzbot+313d95e8a7a49263f88d@syzkaller.appspotmail.com
Fix commit: d0930bb8f46b blk-mq: Fix a recently introduced regression in blk_mq_realloc_hw_ctxs()
First crash: 1489d, last: 1453d
Cause bisection: introduced by (bisect log) :
commit 768134d4f48109b90f4248feecbeeb7d684e410c
Author: Jens Axboe <axboe@kernel.dk>
Date: Mon Nov 11 03:30:53 2019 +0000

  io_uring: don't do flush cancel under inflight_lock

Crash: general protection fault in batadv_iv_ogm_queue_add (log)
Repro: C syz .config
  
Discussions (1)
Title Replies (including bot) Last reply
KASAN: null-ptr-deref Write in blk_mq_map_swqueue 6 (9) 2020/06/25 04:05

Sample crash report:
RSP: 002b:00007ffca409c958 EFLAGS: 00000246 ORIG_RAX: 0000000000000010
RAX: ffffffffffffffda RBX: 00007ffca409c970 RCX: 00000000004411c9
RDX: 0000000000000000 RSI: 0000000000004c80 RDI: 0000000000000003
RBP: 0000000000000000 R08: 0000000000000002 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: ffffffffffffffff
R13: 0000000000000004 R14: 0000000000000000 R15: 0000000000000000
==================================================================
BUG: KASAN: null-ptr-deref in memset include/linux/string.h:366 [inline]
BUG: KASAN: null-ptr-deref in bitmap_zero include/linux/bitmap.h:232 [inline]
BUG: KASAN: null-ptr-deref in cpumask_clear include/linux/cpumask.h:406 [inline]
BUG: KASAN: null-ptr-deref in blk_mq_map_swqueue+0xea/0xe90 block/blk-mq.c:2502
Write of size 8 at addr 0000000000000118 by task syz-executor083/7593

CPU: 0 PID: 7593 Comm: syz-executor083 Not tainted 5.6.0-rc7-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
Call Trace:
 __dump_stack lib/dump_stack.c:77 [inline]
 dump_stack+0x188/0x20d lib/dump_stack.c:118
 __kasan_report.cold+0x5/0x32 mm/kasan/report.c:510
 kasan_report+0xe/0x20 mm/kasan/common.c:641
 check_memory_region_inline mm/kasan/generic.c:185 [inline]
 check_memory_region+0x128/0x190 mm/kasan/generic.c:192
 memset+0x20/0x40 mm/kasan/common.c:108
 memset include/linux/string.h:366 [inline]
 bitmap_zero include/linux/bitmap.h:232 [inline]
 cpumask_clear include/linux/cpumask.h:406 [inline]
 blk_mq_map_swqueue+0xea/0xe90 block/blk-mq.c:2502
 blk_mq_init_allocated_queue+0xf21/0x13c0 block/blk-mq.c:2943
 blk_mq_init_queue+0x5c/0xa0 block/blk-mq.c:2733
 loop_add+0x2cb/0x8a0 drivers/block/loop.c:2022
 loop_control_ioctl drivers/block/loop.c:2175 [inline]
 loop_control_ioctl+0x153/0x340 drivers/block/loop.c:2157
 vfs_ioctl fs/ioctl.c:47 [inline]
 ksys_ioctl+0x11a/0x180 fs/ioctl.c:763
 __do_sys_ioctl fs/ioctl.c:772 [inline]
 __se_sys_ioctl fs/ioctl.c:770 [inline]
 __x64_sys_ioctl+0x6f/0xb0 fs/ioctl.c:770
 do_syscall_64+0xf6/0x7d0 arch/x86/entry/common.c:294
 entry_SYSCALL_64_after_hwframe+0x49/0xbe
RIP: 0033:0x4411c9
Code: e8 5c ae 02 00 48 83 c4 18 c3 0f 1f 80 00 00 00 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 0f 83 bb 0a fc ff c3 66 2e 0f 1f 84 00 00 00 00
RSP: 002b:00007ffca409c958 EFLAGS: 00000246 ORIG_RAX: 0000000000000010
RAX: ffffffffffffffda RBX: 00007ffca409c970 RCX: 00000000004411c9
RDX: 0000000000000000 RSI: 0000000000004c80 RDI: 0000000000000003
RBP: 0000000000000000 R08: 0000000000000002 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: ffffffffffffffff
R13: 0000000000000004 R14: 0000000000000000 R15: 0000000000000000
==================================================================

Crashes (3):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2020/03/26 19:33 upstream 1b649e0bcae7 6d25c5a0 .config console log report syz C ci-upstream-kasan-gce-selinux-root
2020/03/26 18:31 upstream 1b649e0bcae7 6d25c5a0 .config console log report ci-upstream-kasan-gce-selinux-root
2020/02/19 12:55 linux-next 1d7f85df0f9c 135c18aa .config console log report ci-upstream-linux-next-kasan-gce-root
* Struck through repros no longer work on HEAD.