KASAN: slab-use-after-free Read in r1buf_pool_free

Status: upstream: reported on 2026/09/18 14:50
Reported-by: syzbot+14fa7733f008935ed47b@syzkaller.appspotmail.com
First crash: 31d, last: 21d
▶ ▼ Similar bugs (2)
Kernel Title Rank 🛈 Repro Cause bisect Fix bisect Count Last Reported Patched Status
linux-5.15 KASAN: use-after-free Read in r1buf_pool_free 19 2 23d 54d 0/3 upstream: reported on 2026/08/26 06:41
linux-6.1 KASAN: use-after-free Read in r1buf_pool_free origin:lts-only 19 syz, C error 6 27d 74d 0/3 upstream: reported C repro on 2026/08/06 01:36

Sample crash report:
md: recovery of RAID array md0
md: md0: recovery done.
==================================================================
BUG: KASAN: slab-use-after-free in r1buf_pool_free+0x124/0x130 drivers/md/raid1.c:228
Read of size 4 at addr ffff888023725108 by task md0_resync/7648

CPU: 1 PID: 7648 Comm: md0_resync Not tainted syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 07/24/2026
Call Trace:
 <TASK>
 dump_stack_lvl+0x18c/0x250 lib/dump_stack.c:106
 print_address_description mm/kasan/report.c:364 [inline]
 print_report+0xa8/0x210 mm/kasan/report.c:468
 kasan_report+0x117/0x150 mm/kasan/report.c:581
 r1buf_pool_free+0x124/0x130 drivers/md/raid1.c:228
 mempool_exit+0xd0/0x1a0 mm/mempool.c:180
 close_sync drivers/md/raid1.c:1698 [inline]
 raid1_sync_request+0x3fa/0x3060 drivers/md/raid1.c:2682
 md_do_sync+0x3ae9/0x45d0 drivers/md/md.c:9175
 md_thread+0x27b/0x460 drivers/md/md.c:8017
 kthread+0x2fa/0x390 kernel/kthread.c:388
 ret_from_fork+0x48/0x80 arch/x86/kernel/process.c:152
 ret_from_fork_asm+0x11/0x20 arch/x86/entry/entry_64.S:293
 </TASK>

Allocated by task 7354:
 kasan_save_stack mm/kasan/common.c:46 [inline]
 kasan_set_track+0x4e/0x70 mm/kasan/common.c:53
 ____kasan_kmalloc mm/kasan/common.c:375 [inline]
 __kasan_kmalloc+0x8f/0xa0 mm/kasan/common.c:384
 kmalloc include/linux/slab.h:600 [inline]
 kzalloc include/linux/slab.h:721 [inline]
 setup_conf+0x2e4/0xe70 drivers/md/raid1.c:2995
 raid1_takeover+0xf9/0x1e0 drivers/md/raid1.c:3358
 level_store+0x6b1/0x1a90 drivers/md/md.c:4028
 md_attr_store+0x196/0x380 drivers/md/md.c:5637
 kernfs_fop_write_iter+0x3a4/0x520 fs/kernfs/file.c:352
 call_write_iter include/linux/fs.h:2018 [inline]
 new_sync_write fs/read_write.c:491 [inline]
 vfs_write+0x474/0x9a0 fs/read_write.c:584
 ksys_write+0x151/0x260 fs/read_write.c:637
 do_syscall_x64 arch/x86/entry/common.c:46 [inline]
 do_syscall_64+0x55/0xb0 arch/x86/entry/common.c:76
 entry_SYSCALL_64_after_hwframe+0x68/0xd2

Freed by task 7647:
 kasan_save_stack mm/kasan/common.c:46 [inline]
 kasan_set_track+0x4e/0x70 mm/kasan/common.c:53
 kasan_save_free_info+0x28/0x40 mm/kasan/generic.c:522
 ____kasan_slab_free+0x126/0x1f0 mm/kasan/common.c:237
 kasan_slab_free include/linux/kasan.h:164 [inline]
 slab_free_hook mm/slub.c:1811 [inline]
 slab_free_freelist_hook+0x130/0x1a0 mm/slub.c:1837
 slab_free mm/slub.c:3830 [inline]
 __kmem_cache_free+0xba/0x1f0 mm/slub.c:3843
 raid1_reshape+0x1133/0x15e0 drivers/md/raid1.c:3319
 chunk_size_store+0x2a5/0x430 drivers/md/md.c:4284
 md_attr_store+0x196/0x380 drivers/md/md.c:5637
 kernfs_fop_write_iter+0x3a4/0x520 fs/kernfs/file.c:352
 call_write_iter include/linux/fs.h:2018 [inline]
 new_sync_write fs/read_write.c:491 [inline]
 vfs_write+0x474/0x9a0 fs/read_write.c:584
 ksys_write+0x151/0x260 fs/read_write.c:637
 do_syscall_x64 arch/x86/entry/common.c:46 [inline]
 do_syscall_64+0x55/0xb0 arch/x86/entry/common.c:76
 entry_SYSCALL_64_after_hwframe+0x68/0xd2

The buggy address belongs to the object at ffff888023725100
 which belongs to the cache kmalloc-16 of size 16
The buggy address is located 8 bytes inside of
 freed 16-byte region [ffff888023725100, ffff888023725110)

The buggy address belongs to the physical page:
page:ffffea00008dc940 refcount:1 mapcount:0 mapping:0000000000000000 index:0xffff888023725e00 pfn:0x23725
flags: 0xfff00000000800(slab|node=0|zone=1|lastcpupid=0x7ff)
page_type: 0xffffffff()
raw: 00fff00000000800 ffff888017c413c0 ffffea0000ae7240 dead000000000002
raw: ffff888023725e00 0000000080800074 00000001ffffffff 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 0x12c00(GFP_NOIO|__GFP_NOWARN|__GFP_NORETRY), pid 59, tgid 59 (kworker/u4:4), ts 9023109863, free_ts 0
 set_page_owner include/linux/page_owner.h:31 [inline]
 post_alloc_hook+0x1c1/0x200 mm/page_alloc.c:1582
 prep_new_page mm/page_alloc.c:1589 [inline]
 get_page_from_freelist+0x2181/0x22a0 mm/page_alloc.c:3221
 __alloc_pages+0x1f0/0x460 mm/page_alloc.c:4501
 __alloc_pages_node include/linux/gfp.h:237 [inline]
 alloc_slab_page+0x4f/0x180 mm/slub.c:1883
 allocate_slab mm/slub.c:2028 [inline]
 new_slab+0x87/0x2d0 mm/slub.c:2081
 ___slab_alloc+0xc5c/0x12f0 mm/slub.c:3253
 __slab_alloc mm/slub.c:3339 [inline]
 __slab_alloc_node mm/slub.c:3392 [inline]
 slab_alloc_node mm/slub.c:3485 [inline]
 __kmem_cache_alloc_node+0x11f/0x250 mm/slub.c:3534
 __do_kmalloc_node mm/slab_common.c:1006 [inline]
 __kmalloc_node+0xa6/0x240 mm/slab_common.c:1014
 kmalloc_array_node include/linux/slab.h:698 [inline]
 blk_mq_alloc_hctx block/blk-mq.c:3903 [inline]
 blk_mq_alloc_and_init_hctx+0x471/0xd40 block/blk-mq.c:4375
 blk_mq_realloc_hw_ctxs+0x193/0xb80 block/blk-mq.c:4408
 blk_mq_init_allocated_queue+0x42e/0x1600 block/blk-mq.c:4473
 blk_mq_init_queue_data block/blk-mq.c:4271 [inline]
 blk_mq_init_queue+0x76/0xe0 block/blk-mq.c:4281
 scsi_alloc_sdev+0x70d/0xab0 drivers/scsi/scsi_scan.c:335
 scsi_probe_and_add_lun+0x1bb/0x45f0 drivers/scsi/scsi_scan.c:1186
 __scsi_scan_target+0x1ee/0x1090 drivers/scsi/scsi_scan.c:1724
 scsi_scan_channel drivers/scsi/scsi_scan.c:1812 [inline]
 scsi_scan_host_selected+0x378/0x6a0 drivers/scsi/scsi_scan.c:1841
page_owner free stack trace missing

Memory state around the buggy address:
 ffff888023725000: 00 00 fc fc 00 00 fc fc 00 03 fc fc 00 04 fc fc
 ffff888023725080: 00 00 fc fc fb fb fc fc fb fb fc fc 00 02 fc fc
>ffff888023725100: fa fb fc fc fa fb fc fc fa fb fc fc 00 00 fc fc
                      ^
 ffff888023725180: 00 00 fc fc 00 00 fc fc 00 00 fc fc 00 00 fc fc
 ffff888023725200: 00 00 fc fc 00 02 fc fc 00 02 fc fc 00 02 fc fc
==================================================================

Crashes (6):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2026/09/28 01:10 linux-6.6.y 79643295eba1 a3c7249d .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-6-kasan KASAN: slab-use-after-free Read in r1buf_pool_free
2026/09/23 07:59 linux-6.6.y 79643295eba1 5207b90e .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-6-kasan KASAN: slab-use-after-free Read in r1buf_pool_free
2026/09/20 00:56 linux-6.6.y 79643295eba1 853b104b .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-6-kasan KASAN: slab-use-after-free Read in r1buf_pool_free
2026/09/18 14:50 linux-6.6.y 79643295eba1 853b104b .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-6-kasan KASAN: slab-use-after-free Read in r1buf_pool_free
2026/09/18 14:50 linux-6.6.y 79643295eba1 853b104b .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-6-kasan KASAN: slab-use-after-free Read in r1buf_pool_free
2026/09/18 14:49 linux-6.6.y 79643295eba1 853b104b .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-6-kasan KASAN: slab-use-after-free Read in r1buf_pool_free
* Struck through repros no longer work on HEAD.