The Linux Kernel Mailing List
 help / color / mirror / Atom feed
* [syzbot] [block?] KASAN: slab-out-of-bounds Read in blk_mq_free_rqs
@ 2026-04-23 17:45 syzbot
  2026-08-06  8:23 ` syzbot
  0 siblings, 1 reply; 2+ messages in thread
From: syzbot @ 2026-04-23 17:45 UTC (permalink / raw)
  To: axboe, linux-block, linux-kernel, syzkaller-bugs

Hello,

syzbot found the following issue on:

HEAD commit:    8a30aeb0d1b4 Merge tag 'nfsd-7.0-2' of git://git.kernel.or..
git tree:       upstream
console output: https://syzkaller.appspot.com/x/log.txt?x=163e72da580000
kernel config:  https://syzkaller.appspot.com/x/.config?x=555131780f7c7272
dashboard link: https://syzkaller.appspot.com/bug?extid=e90526cab23b9efcd03c
compiler:       gcc (Debian 14.2.0-19) 14.2.0, GNU ld (GNU Binutils for Debian) 2.44

Unfortunately, I don't have any reproducer for this issue yet.

Downloadable assets:
disk image: https://storage.googleapis.com/syzbot-assets/2dc05dfe27bf/disk-8a30aeb0.raw.xz
vmlinux: https://storage.googleapis.com/syzbot-assets/ec5900e43ce7/vmlinux-8a30aeb0.xz
kernel image: https://storage.googleapis.com/syzbot-assets/66501ac91f88/bzImage-8a30aeb0.xz

IMPORTANT: if you fix the issue, please add the following tag to the commit:
Reported-by: syzbot+e90526cab23b9efcd03c@syzkaller.appspotmail.com

==================================================================
BUG: KASAN: slab-out-of-bounds in blk_mq_free_rqs+0x6e2/0x760 block/blk-mq.c:3486
Read of size 8 at addr ffff888027b4f7e8 by task syz.3.686/9329

CPU: 0 UID: 0 PID: 9329 Comm: syz.3.686 Not tainted syzkaller #0 PREEMPT(full) 
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 02/12/2026
Call Trace:
 <TASK>
 __dump_stack lib/dump_stack.c:94 [inline]
 dump_stack_lvl+0x100/0x190 lib/dump_stack.c:120
 print_address_description mm/kasan/report.c:378 [inline]
 print_report+0x156/0x4c9 mm/kasan/report.c:482
 kasan_report+0xdf/0x1e0 mm/kasan/report.c:595
 blk_mq_free_rqs+0x6e2/0x760 block/blk-mq.c:3486
 blk_mq_free_map_and_rqs block/blk-mq.c:4157 [inline]
 blk_mq_free_map_and_rqs+0x30/0x120 block/blk-mq.c:4152
 blk_mq_free_sched_tags+0xeb/0x1b0 block/blk-mq-sched.c:425
 blk_mq_free_sched_res+0x52/0x150 block/blk-mq-sched.c:436
 elevator_change_done+0x187/0x650 block/elevator.c:639
 elevator_change+0x2d7/0x530 block/elevator.c:685
 elevator_set_none+0x92/0xf0 block/elevator.c:769
 blk_mq_elv_switch_none block/blk-mq.c:5110 [inline]
 __blk_mq_update_nr_hw_queues block/blk-mq.c:5155 [inline]
 blk_mq_update_nr_hw_queues+0x4c1/0x15f0 block/blk-mq.c:5220
 nbd_start_device+0x1a6/0xbd0 drivers/block/nbd.c:1489
 nbd_start_device_ioctl drivers/block/nbd.c:1548 [inline]
 __nbd_ioctl drivers/block/nbd.c:1623 [inline]
 nbd_ioctl+0x4a6/0xd30 drivers/block/nbd.c:1663
 blkdev_ioctl+0x5ad/0x6f0 block/ioctl.c:804
 vfs_ioctl fs/ioctl.c:51 [inline]
 __do_sys_ioctl fs/ioctl.c:597 [inline]
 __se_sys_ioctl fs/ioctl.c:583 [inline]
 __x64_sys_ioctl+0x18e/0x210 fs/ioctl.c:583
 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline]
 do_syscall_64+0x106/0xf80 arch/x86/entry/syscall_64.c:94
 entry_SYSCALL_64_after_hwframe+0x77/0x7f
RIP: 0033:0x7f854359c799
Code: ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 44 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 73 01 c3 48 c7 c1 e8 ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007f854451d028 EFLAGS: 00000246 ORIG_RAX: 0000000000000010
RAX: ffffffffffffffda RBX: 00007f8543815fa0 RCX: 00007f854359c799
RDX: 0000000000000000 RSI: 000000000000ab03 RDI: 0000000000000003
RBP: 00007f8543632c99 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000
R13: 00007f8543816038 R14: 00007f8543815fa0 R15: 00007ffc336cfa78
 </TASK>

Allocated by task 1:
 kasan_save_stack+0x30/0x50 mm/kasan/common.c:57
 kasan_save_track+0x14/0x30 mm/kasan/common.c:78
 poison_kmalloc_redzone mm/kasan/common.c:398 [inline]
 __kasan_kmalloc+0xaa/0xb0 mm/kasan/common.c:415
 kasan_kmalloc include/linux/kasan.h:263 [inline]
 __do_kmalloc_node mm/slub.c:5260 [inline]
 __kmalloc_node_noprof+0x307/0x850 mm/slub.c:5266
 kmalloc_array_node_noprof include/linux/slab.h:1169 [inline]
 blk_mq_alloc_tag_set+0x477/0x1330 block/blk-mq.c:4903
 nbd_dev_add+0x342/0xb10 drivers/block/nbd.c:1933
 nbd_init+0x291/0x2b0 drivers/block/nbd.c:2692
 do_one_initcall+0x11d/0x760 init/main.c:1382
 do_initcall_level init/main.c:1444 [inline]
 do_initcalls init/main.c:1460 [inline]
 do_basic_setup init/main.c:1479 [inline]
 kernel_init_freeable+0x6e5/0x7a0 init/main.c:1692
 kernel_init+0x1f/0x1e0 init/main.c:1582
 ret_from_fork+0x754/0xd80 arch/x86/kernel/process.c:158
 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:245

The buggy address belongs to the object at ffff888027b4f7e0
 which belongs to the cache kmalloc-8 of size 8
The buggy address is located 0 bytes to the right of
 allocated 8-byte region [ffff888027b4f7e0, ffff888027b4f7e8)

The buggy address belongs to the physical page:
page: refcount:0 mapcount:0 mapping:0000000000000000 index:0xffff888027b4f680 pfn:0x27b4f
flags: 0xfff00000000200(workingset|node=0|zone=1|lastcpupid=0x7ff)
page_type: f5(slab)
raw: 00fff00000000200 ffff88813fe39500 ffffea0000abdd90 ffffea0000d70550
raw: ffff888027b4f680 000000080080007b 00000000f5000000 0000000000000000
page dumped because: kasan: bad access detected
page_owner tracks the page as allocated
page last allocated via order 0, migratetype Unmovable, gfp_mask 0xd2c00(GFP_NOIO|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC), pid 1, tgid 1 (swapper/0), ts 5607902614, free_ts 5601697774
 set_page_owner include/linux/page_owner.h:32 [inline]
 post_alloc_hook+0x153/0x170 mm/page_alloc.c:1889
 prep_new_page mm/page_alloc.c:1897 [inline]
 get_page_from_freelist+0x111d/0x3140 mm/page_alloc.c:3962
 __alloc_frozen_pages_noprof+0x27c/0x2ba0 mm/page_alloc.c:5250
 alloc_slab_page mm/slub.c:3292 [inline]
 allocate_slab mm/slub.c:3481 [inline]
 new_slab+0xa6/0x6b0 mm/slub.c:3539
 refill_objects+0x26b/0x400 mm/slub.c:7175
 refill_sheaf mm/slub.c:2812 [inline]
 __pcs_replace_empty_main+0x1ab/0x660 mm/slub.c:4615
 alloc_from_pcs mm/slub.c:4717 [inline]
 slab_alloc_node mm/slub.c:4851 [inline]
 __do_kmalloc_node mm/slub.c:5259 [inline]
 __kmalloc_node_track_caller_noprof+0x694/0x850 mm/slub.c:5368
 __kmemdup_nul mm/util.c:64 [inline]
 kstrdup+0x51/0xe0 mm/util.c:84
 kstrdup_const+0x63/0x80 mm/util.c:104
 __kernfs_new_node+0x9b/0x960 fs/kernfs/dir.c:633
 kernfs_new_node+0x11b/0x1a0 fs/kernfs/dir.c:718
 kernfs_create_link+0xcc/0x240 fs/kernfs/symlink.c:39
 sysfs_do_create_link_sd+0x90/0x140 fs/sysfs/symlink.c:44
 sysfs_do_create_link fs/sysfs/symlink.c:80 [inline]
 sysfs_create_link+0x61/0xc0 fs/sysfs/symlink.c:92
 device_add_class_symlinks drivers/base/core.c:3448 [inline]
 device_add+0x675/0x1950 drivers/base/core.c:3640
 __add_disk+0x518/0xe40 block/genhd.c:496
page last free pid 10 tgid 10 stack trace:
 reset_page_owner include/linux/page_owner.h:25 [inline]
 __free_pages_prepare mm/page_alloc.c:1433 [inline]
 __free_frozen_pages+0x7e1/0x10d0 mm/page_alloc.c:2978
 vfree.part.0+0x12b/0x9d0 mm/vmalloc.c:3479
 vfree mm/vmalloc.c:3456 [inline]
 delayed_vfree_work+0x8e/0xd0 mm/vmalloc.c:3398
 process_one_work+0xa23/0x19a0 kernel/workqueue.c:3276
 process_scheduled_works kernel/workqueue.c:3359 [inline]
 worker_thread+0x5ef/0xe50 kernel/workqueue.c:3440
 kthread+0x370/0x450 kernel/kthread.c:436
 ret_from_fork+0x754/0xd80 arch/x86/kernel/process.c:158
 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:245

Memory state around the buggy address:
 ffff888027b4f680: fa fc fc fc fa fc fc fc fa fc fc fc 05 fc fc fc
 ffff888027b4f700: 06 fc fc fc 05 fc fc fc 05 fc fc fc 05 fc fc fc
>ffff888027b4f780: 00 fc fc fc 05 fc fc fc 00 fc fc fc 00 fc fc fc
                                                          ^
 ffff888027b4f800: 06 fc fc fc 06 fc fc fc 06 fc fc fc 05 fc fc fc
 ffff888027b4f880: 05 fc fc fc 05 fc fc fc 05 fc fc fc 02 fc fc fc
==================================================================
block nbd3: shutting down sockets


---
This report is generated by a bot. It may contain errors.
See https://goo.gl/tpsmEJ for more information about syzbot.
syzbot engineers can be reached at syzkaller@googlegroups.com.

syzbot will keep track of this issue. See:
https://goo.gl/tpsmEJ#status for how to communicate with syzbot.

If the report is already addressed, let syzbot know by replying with:
#syz fix: exact-commit-title

If you want to overwrite report's subsystems, reply with:
#syz set subsystems: new-subsystem
(See the list of subsystem names on the web dashboard)

If the report is a duplicate of another one, reply with:
#syz dup: exact-subject-of-another-report

If you want to undo deduplication, reply with:
#syz undup

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [syzbot] [block?] KASAN: slab-out-of-bounds Read in blk_mq_free_rqs
  2026-04-23 17:45 [syzbot] [block?] KASAN: slab-out-of-bounds Read in blk_mq_free_rqs syzbot
@ 2026-08-06  8:23 ` syzbot
  0 siblings, 0 replies; 2+ messages in thread
From: syzbot @ 2026-08-06  8:23 UTC (permalink / raw)
  To: axboe, linux-block, linux-kernel, syzkaller-bugs

syzbot has found a reproducer for the following issue on:

HEAD commit:    0d8395707651 Merge tag 'soc-fixes-7.2-2' of git://git.kern..
git tree:       upstream
console output: https://syzkaller.appspot.com/x/log.txt?x=13aa729e580000
kernel config:  https://syzkaller.appspot.com/x/.config?x=cde12eeb298bab70
dashboard link: https://syzkaller.appspot.com/bug?extid=e90526cab23b9efcd03c
compiler:       Debian clang version 22.1.8 (++20260613092233+e80beda6e255-1~exp1~20260613092250.77), Debian LLD 22.1.8
C reproducer:   https://syzkaller.appspot.com/x/repro.c?x=16a58e49580000

IMPORTANT: if you fix the issue, please add the following tag to the commit:
Reported-by: syzbot+e90526cab23b9efcd03c@syzkaller.appspotmail.com

R10: 0000000000000000 R11: 0000000000000246 R12: 00007ffc11fd08a0
R13: 00007ffc11fd08c0 R14: 0000000000000007 R15: 00007ffc11fd08e0
 </TASK>
block nbd7: shutting down sockets
==================================================================
BUG: KASAN: slab-out-of-bounds in blk_mq_free_rqs+0xde/0x680 block/blk-mq.c:-1
Read of size 8 at addr ffff888026385588 by task syz-executor425/5940

CPU: 0 UID: 0 PID: 5940 Comm: syz-executor425 Not tainted syzkaller #0 PREEMPT_{RT,(full)} 
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 07/24/2026
Call Trace:
 <TASK>
 dump_stack_lvl+0xe8/0x150 lib/dump_stack.c:120
 print_address_description+0x55/0x1e0 mm/kasan/report.c:378
 print_report+0x58/0x70 mm/kasan/report.c:482
 kasan_report+0x117/0x150 mm/kasan/report.c:595
 blk_mq_free_rqs+0xde/0x680 block/blk-mq.c:-1
 blk_mq_free_map_and_rqs+0x40/0xf0 block/blk-mq.c:4148
 blk_mq_free_sched_tags block/blk-mq-sched.c:425 [inline]
 blk_mq_free_sched_res+0xeb/0x280 block/blk-mq-sched.c:436
 elevator_change_done+0x1d2/0x5c0 block/elevator.c:639
 elevator_change+0x34f/0x480 block/elevator.c:685
 elv_iosched_store+0x504/0x630 block/elevator.c:826
 queue_attr_store+0x207/0x2b0 block/blk-sysfs.c:906
 kernfs_fop_write_iter+0x3a5/0x540 fs/kernfs/file.c:345
 new_sync_write fs/read_write.c:595 [inline]
 vfs_write+0x61e/0xbb0 fs/read_write.c:687
 ksys_write+0x156/0x270 fs/read_write.c:739
 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline]
 do_syscall_64+0x15f/0x560 arch/x86/entry/syscall_64.c:94
 entry_SYSCALL_64_after_hwframe+0x77/0x7f
RIP: 0033:0x7f3427ac2437
Code: 48 89 fa 4c 89 df e8 88 15 00 00 8b 93 08 03 00 00 59 5e 48 83 f8 fc 74 1a 5b c3 0f 1f 84 00 00 00 00 00 48 8b 44 24 10 0f 05 <5b> c3 0f 1f 80 00 00 00 00 83 e2 39 83 fa 08 75 de e8 23 ff ff ff
RSP: 002b:00007ffc11fd0710 EFLAGS: 00000202 ORIG_RAX: 0000000000000001
RAX: ffffffffffffffda RBX: 0000555594bc4400 RCX: 00007f3427ac2437
RDX: 0000000000000004 RSI: 00007f3427afdc5b RDI: 0000000000000007
RBP: 0000000000000007 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000202 R12: 00007f3427afdc5b
R13: 00007ffc11fd08c0 R14: 0000000000000007 R15: 00007ffc11fd08e0
 </TASK>

Allocated by task 1:
 kasan_save_stack mm/kasan/common.c:57 [inline]
 kasan_save_track+0x3e/0x80 mm/kasan/common.c:78
 poison_kmalloc_redzone mm/kasan/common.c:398 [inline]
 __kasan_kmalloc+0x93/0xb0 mm/kasan/common.c:415
 kasan_kmalloc include/linux/kasan.h:263 [inline]
 __do_kmalloc_node mm/slub.c:5334 [inline]
 __kmalloc_node_noprof+0x584/0x7d0 mm/slub.c:5346
 _kmalloc_array_node_noprof include/linux/slab.h:1294 [inline]
 blk_mq_alloc_tag_set+0x533/0x1000 block/blk-mq.c:4894
 nbd_dev_add+0x30e/0xb60 drivers/block/nbd.c:1970
 nbd_init+0x15f/0x1e0 drivers/block/nbd.c:2729
 do_one_initcall+0x250/0x870 init/main.c:1347
 do_initcall_level+0x10a/0x1a0 init/main.c:1409
 do_initcalls+0x59/0xa0 init/main.c:1425
 kernel_init_freeable+0x29d/0x3e0 init/main.c:1658
 kernel_init+0x1d/0x1d0 init/main.c:1548
 ret_from_fork+0x514/0xb70 arch/x86/kernel/process.c:158
 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:245

The buggy address belongs to the object at ffff888026385580
 which belongs to the cache kmalloc-8 of size 8
The buggy address is located 0 bytes to the right of
 allocated 8-byte region [ffff888026385580, ffff888026385588)

The buggy address belongs to the physical page:
page: refcount:0 mapcount:0 mapping:0000000000000000 index:0xffff888026385f80 pfn:0x26385
flags: 0x80000000000200(workingset|node=0|zone=1)
page_type: f5(slab)
raw: 0080000000000200 ffff88801a017500 ffffea0000972d90 ffffea0000a02cd0
raw: ffff888026385f80 0000000800800075 00000000f5000000 0000000000000000
page dumped because: kasan: bad access detected
page_owner tracks the page as allocated
page last allocated via order 0, migratetype Unmovable, gfp_mask 0xd2c00(GFP_NOIO|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC), pid 1, tgid 1 (swapper/0), ts 7259242334, free_ts 0
 set_page_owner include/linux/page_owner.h:32 [inline]
 post_alloc_hook+0x1f9/0x250 mm/page_alloc.c:1859
 prep_new_page mm/page_alloc.c:1867 [inline]
 get_page_from_freelist+0x262a/0x26a0 mm/page_alloc.c:3946
 __alloc_frozen_pages_noprof+0x18d/0x380 mm/page_alloc.c:5304
 alloc_slab_page mm/slub.c:3266 [inline]
 allocate_slab+0x79/0x5e0 mm/slub.c:3380
 new_slab mm/slub.c:3426 [inline]
 refill_objects+0x2d8/0x350 mm/slub.c:7310
 refill_sheaf mm/slub.c:2804 [inline]
 __pcs_replace_empty_main+0x330/0x690 mm/slub.c:4675
 alloc_from_pcs mm/slub.c:4773 [inline]
 slab_alloc_node mm/slub.c:4905 [inline]
 __do_kmalloc_node mm/slub.c:5333 [inline]
 __kmalloc_node_track_caller_noprof+0x62d/0x7c0 mm/slub.c:5471
 __kmemdup_nul mm/util.c:64 [inline]
 kstrdup+0x42/0x100 mm/util.c:84
 kobject_set_name_vargs+0x61/0x110 lib/kobject.c:274
 device_create_groups_vargs drivers/base/core.c:4450 [inline]
 device_create+0x23d/0x300 drivers/base/core.c:4493
 bdi_register_va+0x9c/0x7d0 mm/backing-dev.c:1099
 bdi_register+0xe2/0x140 mm/backing-dev.c:1131
 __add_disk+0x7da/0xe30 block/genhd.c:529
 add_disk_fwnode+0x100/0x3a0 block/genhd.c:593
 add_disk include/linux/blkdev.h:800 [inline]
 nbd_dev_add+0x733/0xb60 drivers/block/nbd.c:2021
 nbd_init+0x15f/0x1e0 drivers/block/nbd.c:2729
page_owner free stack trace missing

Memory state around the buggy address:
 ffff888026385480: fa fc fc fc 07 fc fc fc 05 fc fc fc 05 fc fc fc
 ffff888026385500: 05 fc fc fc 00 fc fc fc fa fc fc fc 00 fc fc fc
>ffff888026385580: 00 fc fc fc 07 fc fc fc 07 fc fc fc 07 fc fc fc
                      ^
 ffff888026385600: fa fc fc fc fa fc fc fc fa fc fc fc fa fc fc fc
 ffff888026385680: fa fc fc fc 02 fc fc fc 05 fc fc fc 00 fc fc fc
==================================================================


---
If you want syzbot to run the reproducer, reply with:
#syz test: git://repo/address.git branch-or-commit-hash
If you attach or paste a git patch, syzbot will apply it before testing.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2026-08-06  8:23 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-04-23 17:45 [syzbot] [block?] KASAN: slab-out-of-bounds Read in blk_mq_free_rqs syzbot
2026-08-06  8:23 ` syzbot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox