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: 2d06h, last: 20h15m
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 1 25d 25d 0/3 upstream: reported on 2026/08/26 06:41
linux-6.1 KASAN: use-after-free Read in r1buf_pool_free 19 syz, C 5 34d 45d 0/3 upstream: reported C repro on 2026/08/06 01:36

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

CPU: 1 PID: 19723 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 19089:
 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_run+0x104/0x8a0 drivers/md/raid1.c:3118
 md_run+0x10b3/0x2210 drivers/md/md.c:6030
 do_md_run+0x34/0x410 drivers/md/md.c:6162
 array_state_store+0x696/0x980 drivers/md/md.c:-1
 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 19725:
 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 ffff888025a61ac0
 which belongs to the cache kmalloc-16 of size 16
The buggy address is located 8 bytes inside of
 freed 16-byte region [ffff888025a61ac0, ffff888025a61ad0)

The buggy address belongs to the physical page:
page:ffffea0000969840 refcount:1 mapcount:0 mapping:0000000000000000 index:0xffff888025a61c00 pfn:0x25a61
flags: 0xfff00000000800(slab|node=0|zone=1|lastcpupid=0x7ff)
page_type: 0xffffffff()
raw: 00fff00000000800 ffff888017c413c0 ffff888017c40288 ffffea00008ff790
raw: ffff888025a61c00 0000000000800078 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 0x112cc0(GFP_USER|__GFP_NOWARN|__GFP_NORETRY), pid 13668, tgid 13668 (syz-executor), ts 1188130521671, free_ts 1188099195441
 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_node include/linux/slab.h:620 [inline]
 kvmalloc_node+0x70/0x180 mm/util.c:617
 xt_jumpstack_alloc net/netfilter/x_tables.c:1377 [inline]
 xt_replace_table+0x185/0x750 net/netfilter/x_tables.c:1416
 __do_replace+0x169/0x9b0 net/ipv6/netfilter/ip6_tables.c:1079
 do_replace net/ipv6/netfilter/ip6_tables.c:1156 [inline]
 do_ip6t_set_ctl+0xb41/0xe10 net/ipv6/netfilter/ip6_tables.c:1641
 nf_setsockopt+0x263/0x280 net/netfilter/nf_sockopt.c:101
 do_sock_setsockopt+0x175/0x1a0 net/socket.c:2322
 __sys_setsockopt net/socket.c:2345 [inline]
 __do_sys_setsockopt net/socket.c:2354 [inline]
 __se_sys_setsockopt net/socket.c:2351 [inline]
 __x64_sys_setsockopt+0x182/0x200 net/socket.c:2351
 do_syscall_x64 arch/x86/entry/common.c:46 [inline]
 do_syscall_64+0x55/0xb0 arch/x86/entry/common.c:76
page last free stack trace:
 reset_page_owner include/linux/page_owner.h:24 [inline]
 free_pages_prepare mm/page_alloc.c:1182 [inline]
 free_unref_page_prepare+0x7d7/0x8f0 mm/page_alloc.c:2366
 free_unref_page+0x32/0x2e0 mm/page_alloc.c:2459
 tlb_batch_list_free mm/mmu_gather.c:115 [inline]
 tlb_finish_mmu+0x13e/0x220 mm/mmu_gather.c:428
 exit_mmap+0x428/0xb90 mm/mmap.c:3315
 __mmput+0x118/0x3a0 kernel/fork.c:1362
 exit_mm+0x23f/0x340 kernel/exit.c:576
 do_exit+0x909/0x2530 kernel/exit.c:877
 do_group_exit+0x22d/0x2f0 kernel/exit.c:1032
 get_signal+0x12a6/0x1390 kernel/signal.c:2915
 arch_do_signal_or_restart+0xc2/0x7b0 arch/x86/kernel/signal.c:310
 exit_to_user_mode_loop+0x70/0x110 kernel/entry/common.c:177
 exit_to_user_mode_prepare+0xee/0x180 kernel/entry/common.c:213
 __syscall_exit_to_user_mode_work kernel/entry/common.c:294 [inline]
 syscall_exit_to_user_mode+0x1a/0x50 kernel/entry/common.c:305
 do_syscall_64+0x61/0xb0 arch/x86/entry/common.c:82
 entry_SYSCALL_64_after_hwframe+0x68/0xd2

Memory state around the buggy address:
 ffff888025a61980: fa fb fc fc fa fb fc fc 00 00 fc fc fa fb fc fc
 ffff888025a61a00: fa fb fc fc fa fb fc fc fa fb fc fc fa fb fc fc
>ffff888025a61a80: 00 05 fc fc fa fb fc fc fa fb fc fc 00 00 fc fc
                                              ^
 ffff888025a61b00: fa fb fc fc 00 03 fc fc fa fb fc fc 00 03 fc fc
 ffff888025a61b80: fa fb fc fc 00 00 fc fc fa fb fc fc fa fb fc fc
==================================================================

Crashes (4):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
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.