[v6.1] KASAN: use-after-free Read in r1buf_pool_free

0 views
Skip to first unread message

syzbot

unread,
Aug 5, 2026, 9:36:37 PM (11 days ago) Aug 5
to syzkaller...@googlegroups.com
Hello,

syzbot found the following issue on:

HEAD commit: fb28aa725e05 Linux 6.1.180
git tree: linux-6.1.y
console output: https://syzkaller.appspot.com/x/log.txt?x=14cf0132580000
kernel config: https://syzkaller.appspot.com/x/.config?x=872c04466179833f
dashboard link: https://syzkaller.appspot.com/bug?extid=281d1de0554287d3affb
compiler: Debian clang version 22.1.8 (++20260613092233+e80beda6e255-1~exp1~20260613092250.77), Debian LLD 22.1.8
userspace arch: arm64

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

Downloadable assets:
disk image: https://storage.googleapis.com/syzbot-assets/d420eb944682/disk-fb28aa72.raw.xz
vmlinux: https://storage.googleapis.com/syzbot-assets/affae450ab23/vmlinux-fb28aa72.xz
kernel image: https://storage.googleapis.com/syzbot-assets/b9e6919ed519/Image-fb28aa72.gz.xz

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

md: recovery of RAID array md0
md: md0: recovery done.
==================================================================
BUG: KASAN: use-after-free in r1buf_pool_free+0x130/0x134 drivers/md/raid1.c:228
Read of size 4 at addr ffff0000f72b9b08 by task md0_resync/8552

CPU: 0 PID: 8552 Comm: md0_resync Not tainted syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 07/02/2026
Call trace:
dump_backtrace+0x1c4/0x1f0 arch/arm64/kernel/stacktrace.c:158
show_stack+0x2c/0x3c arch/arm64/kernel/stacktrace.c:165
__dump_stack+0x30/0x40 lib/dump_stack.c:88
dump_stack_lvl+0xf4/0x15c lib/dump_stack.c:106
print_address_description+0x88/0x218 mm/kasan/report.c:316
print_report+0x50/0x68 mm/kasan/report.c:420
kasan_report+0xa8/0xfc mm/kasan/report.c:524
__asan_report_load4_noabort+0x2c/0x38 mm/kasan/report_generic.c:350
r1buf_pool_free+0x130/0x134 drivers/md/raid1.c:228
mempool_exit+0x190/0x290 mm/mempool.c:174
close_sync drivers/md/raid1.c:1713 [inline]
raid1_sync_request+0x328/0x26e4 drivers/md/raid1.c:2696
md_do_sync+0x2e18/0x36ec drivers/md/md.c:9158
md_thread+0x1e0/0x3cc drivers/md/md.c:8000
kthread+0x254/0x2e0 kernel/kthread.c:376
ret_from_fork+0x10/0x20 arch/arm64/kernel/entry.S:850

Allocated by task 8400:
kasan_save_stack mm/kasan/common.c:46 [inline]
kasan_set_track+0x4c/0x80 mm/kasan/common.c:53
kasan_save_alloc_info+0x24/0x30 mm/kasan/generic.c:505
____kasan_kmalloc mm/kasan/common.c:375 [inline]
__kasan_kmalloc+0xa0/0xb8 mm/kasan/common.c:384
kasan_kmalloc include/linux/kasan.h:211 [inline]
kmalloc_trace+0x7c/0x94 mm/slab_common.c:1031
kmalloc include/linux/slab.h:563 [inline]
raid1_reshape+0x590/0x102c drivers/md/raid1.c:3289
chunk_size_store+0x1ec/0x358 drivers/md/md.c:4290
md_attr_store+0x168/0x234 drivers/md/md.c:5626
sysfs_kf_write+0x1f8/0x274 fs/sysfs/file.c:140
kernfs_fop_write_iter+0x390/0x4b4 fs/kernfs/file.c:352
call_write_iter include/linux/fs.h:2265 [inline]
new_sync_write fs/read_write.c:491 [inline]
vfs_write+0x3c8/0x7c8 fs/read_write.c:584
ksys_write+0x12c/0x228 fs/read_write.c:637
__do_sys_write fs/read_write.c:649 [inline]
__se_sys_write fs/read_write.c:646 [inline]
__arm64_sys_write+0x7c/0x90 fs/read_write.c:646
__invoke_syscall arch/arm64/kernel/syscall.c:38 [inline]
invoke_syscall+0x98/0x290 arch/arm64/kernel/syscall.c:52
el0_svc_common+0x13c/0x258 arch/arm64/kernel/syscall.c:140
do_el0_svc+0x5c/0x134 arch/arm64/kernel/syscall.c:204
el0_svc+0x58/0x128 arch/arm64/kernel/entry-common.c:637
el0t_64_sync_handler+0x84/0xf0 arch/arm64/kernel/entry-common.c:655
el0t_64_sync+0x18c/0x190 arch/arm64/kernel/entry.S:585

Freed by task 8550:
kasan_save_stack mm/kasan/common.c:46 [inline]
kasan_set_track+0x4c/0x80 mm/kasan/common.c:53
kasan_save_free_info+0x38/0x5c mm/kasan/generic.c:516
____kasan_slab_free+0x148/0x1b0 mm/kasan/common.c:237
__kasan_slab_free+0x18/0x28 mm/kasan/common.c:245
kasan_slab_free include/linux/kasan.h:177 [inline]
slab_free_hook mm/slub.c:1729 [inline]
slab_free_freelist_hook+0x16c/0x1e8 mm/slub.c:1755
slab_free mm/slub.c:3687 [inline]
__kmem_cache_free+0xbc/0x21c mm/slub.c:3700
kfree+0xd0/0x1a8 mm/slab_common.c:988
raid1_reshape+0xc74/0x102c drivers/md/raid1.c:3332
chunk_size_store+0x1ec/0x358 drivers/md/md.c:4290
md_attr_store+0x168/0x234 drivers/md/md.c:5626
sysfs_kf_write+0x1f8/0x274 fs/sysfs/file.c:140
kernfs_fop_write_iter+0x390/0x4b4 fs/kernfs/file.c:352
call_write_iter include/linux/fs.h:2265 [inline]
new_sync_write fs/read_write.c:491 [inline]
vfs_write+0x3c8/0x7c8 fs/read_write.c:584
ksys_write+0x12c/0x228 fs/read_write.c:637
__do_sys_write fs/read_write.c:649 [inline]
__se_sys_write fs/read_write.c:646 [inline]
__arm64_sys_write+0x7c/0x90 fs/read_write.c:646
__invoke_syscall arch/arm64/kernel/syscall.c:38 [inline]
invoke_syscall+0x98/0x290 arch/arm64/kernel/syscall.c:52
el0_svc_common+0x13c/0x258 arch/arm64/kernel/syscall.c:140
do_el0_svc+0x5c/0x134 arch/arm64/kernel/syscall.c:204
el0_svc+0x58/0x128 arch/arm64/kernel/entry-common.c:637
el0t_64_sync_handler+0x84/0xf0 arch/arm64/kernel/entry-common.c:655
el0t_64_sync+0x18c/0x190 arch/arm64/kernel/entry.S:585

Last potentially related work creation:
kasan_save_stack+0x40/0x70 mm/kasan/common.c:46
__kasan_record_aux_stack+0xc0/0xdc mm/kasan/generic.c:486
kasan_record_aux_stack_noalloc+0x14/0x20 mm/kasan/generic.c:496
kvfree_call_rcu+0xb4/0x6f0 kernel/rcu/tree.c:3405
cfg80211_update_known_bss+0x11c/0x7fc net/wireless/scan.c:-1
cfg80211_bss_update+0x150/0x1ccc net/wireless/scan.c:1847
cfg80211_inform_single_bss_frame_data net/wireless/scan.c:2509 [inline]
cfg80211_inform_bss_frame_data+0x890/0x10f8 net/wireless/scan.c:2542
ieee80211_bss_info_update+0x640/0xa7c net/mac80211/scan.c:190
ieee80211_rx_bss_info net/mac80211/ibss.c:1120 [inline]
ieee80211_rx_mgmt_probe_beacon net/mac80211/ibss.c:1609 [inline]
ieee80211_ibss_rx_queued_mgmt+0x143c/0x2608 net/mac80211/ibss.c:1638
ieee80211_iface_process_skb net/mac80211/iface.c:1679 [inline]
ieee80211_iface_work+0x5a8/0xa4c net/mac80211/iface.c:1733
cfg80211_wiphy_work+0x1e0/0x220 net/wireless/core.c:433
process_one_work+0x7e4/0x13bc kernel/workqueue.c:2292
worker_thread+0x8cc/0xfe8 kernel/workqueue.c:2439
kthread+0x254/0x2e0 kernel/kthread.c:376
ret_from_fork+0x10/0x20 arch/arm64/kernel/entry.S:850

The buggy address belongs to the object at ffff0000f72b9b00
which belongs to the cache kmalloc-128 of size 128
The buggy address is located 8 bytes inside of
128-byte region [ffff0000f72b9b00, ffff0000f72b9b80)

The buggy address belongs to the physical page:
page:00000000b2c3e01f refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x1372b9
flags: 0x5ffc00000000200(slab|node=0|zone=2|lastcpupid=0x7ff)
raw: 05ffc00000000200 fffffc00038e04c0 dead000000000002 ffff0000c0002300
raw: 0000000000000000 0000000000100010 00000001ffffffff 0000000000000000
page dumped because: kasan: bad access detected

Memory state around the buggy address:
ffff0000f72b9a00: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
ffff0000f72b9a80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
>ffff0000f72b9b00: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
^
ffff0000f72b9b80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
ffff0000f72b9c00: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
==================================================================
Unable to handle kernel paging request at virtual address dfff800000000008
KASAN: null-ptr-deref in range [0x0000000000000040-0x0000000000000047]
Mem abort info:
ESR = 0x0000000096000006
EC = 0x25: DABT (current EL), IL = 32 bits
SET = 0, FnV = 0
EA = 0, S1PTW = 0
FSC = 0x06: level 2 translation fault
Data abort info:
ISV = 0, ISS = 0x00000006
CM = 0, WnR = 0
[dfff800000000008] address between user and kernel address ranges
Internal error: Oops: 0000000096000006 [#1] PREEMPT SMP
Modules linked in:
CPU: 1 PID: 8552 Comm: md0_resync Tainted: G B syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 07/02/2026
pstate: 02400005 (nzcv daif +PAN -UAO +TCO -DIT -SSBS BTYPE=--)
pc : get_resync_pages drivers/md/raid1-10.c:90 [inline]
pc : r1buf_pool_free+0x90/0x134 drivers/md/raid1.c:229
lr : r1buf_pool_free+0x84/0x134 drivers/md/raid1.c:229
sp : ffff800021867500
x29: ffff800021867500 x28: 1fffe0001ea99a4b x27: 1fffe0001ea99a4e
x26: ffff80000ea38468 x25: 1fffe0001ea91b30 x24: 0000000000002165
x23: ffff0000f547ce58 x22: dfff800000000000 x21: 0000000000000040
x20: ffff0000f548d980 x19: ffff0000f547ce00 x18: 1fffe00033e7697e
x17: 0000000000000000 x16: ffff800011b90080 x15: 0000000000000000
x14: 0000000000000001 x13: 1ffff00002ff016c x12: 0000000000000000
x11: ff0080000ea384c8 x10: 0000000000000000 x9 : ffff80001c5fab10
x8 : 0000000000000008 x7 : 0000000000000001 x6 : 0000000000000001
x5 : ffff800021866ed8 x4 : ffff800015464e80 x3 : ffff80000ea384ec
x2 : 0000000000000000 x1 : 0000000000000008 x0 : 0000000000000000
Call trace:
get_resync_pages drivers/md/raid1-10.c:90 [inline]
r1buf_pool_free+0x90/0x134 drivers/md/raid1.c:229
mempool_exit+0x190/0x290 mm/mempool.c:174
close_sync drivers/md/raid1.c:1713 [inline]
raid1_sync_request+0x328/0x26e4 drivers/md/raid1.c:2696
md_do_sync+0x2e18/0x36ec drivers/md/md.c:9158
md_thread+0x1e0/0x3cc drivers/md/md.c:8000
kthread+0x254/0x2e0 kernel/kthread.c:376
ret_from_fork+0x10/0x20 arch/arm64/kernel/entry.S:850
Code: 967af112 f9400288 91010115 d343fea8 (38766908)
---[ end trace 0000000000000000 ]---
----------------
Code disassembly (best guess):
0: 967af112 bl 0xfffffffff9ebc448
4: f9400288 ldr x8, [x20]
8: 91010115 add x21, x8, #0x40
c: d343fea8 lsr x8, x21, #3
* 10: 38766908 ldrb w8, [x8, x22] <-- trapping instruction


---
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 syzk...@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

syzbot

unread,
Aug 6, 2026, 6:11:39 AM (11 days ago) Aug 6
to syzkaller...@googlegroups.com
syzbot has found a reproducer for the following issue on:

HEAD commit: fb28aa725e05 Linux 6.1.180
git tree: linux-6.1.y
console output: https://syzkaller.appspot.com/x/log.txt?x=13938e49580000
kernel config: https://syzkaller.appspot.com/x/.config?x=872c04466179833f
dashboard link: https://syzkaller.appspot.com/bug?extid=281d1de0554287d3affb
compiler: Debian clang version 22.1.8 (++20260613092233+e80beda6e255-1~exp1~20260613092250.77), Debian LLD 22.1.8
userspace arch: arm64
syz repro: https://syzkaller.appspot.com/x/repro.syz?x=104e729e580000
C reproducer: https://syzkaller.appspot.com/x/repro.c?x=1357bcc6580000
md: md0: recovery done.
==================================================================
BUG: KASAN: use-after-free in r1buf_pool_free+0x130/0x134 drivers/md/raid1.c:228
Read of size 4 at addr ffff0000c3827c08 by task md0_resync/4533

CPU: 1 PID: 4533 Comm: md0_resync Not tainted syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 07/02/2026
Call trace:
dump_backtrace+0x1c4/0x1f0 arch/arm64/kernel/stacktrace.c:158
show_stack+0x2c/0x3c arch/arm64/kernel/stacktrace.c:165
__dump_stack+0x30/0x40 lib/dump_stack.c:88
dump_stack_lvl+0xf4/0x15c lib/dump_stack.c:106
print_address_description+0x88/0x218 mm/kasan/report.c:316
print_report+0x50/0x68 mm/kasan/report.c:420
kasan_report+0xa8/0xfc mm/kasan/report.c:524
__asan_report_load4_noabort+0x2c/0x38 mm/kasan/report_generic.c:350
r1buf_pool_free+0x130/0x134 drivers/md/raid1.c:228
mempool_exit+0x190/0x290 mm/mempool.c:174
close_sync drivers/md/raid1.c:1713 [inline]
raid1_sync_request+0x328/0x26e4 drivers/md/raid1.c:2696
md_do_sync+0x2e18/0x36ec drivers/md/md.c:9158
md_thread+0x1e0/0x3cc drivers/md/md.c:8000
kthread+0x254/0x2e0 kernel/kthread.c:376
ret_from_fork+0x10/0x20 arch/arm64/kernel/entry.S:850

Allocated by task 4529:
Freed by task 4534:
kernfs_unlink_open_file+0x370/0x41c fs/kernfs/file.c:653
kernfs_fop_release+0x128/0x194 fs/kernfs/file.c:825
__fput+0x1b4/0x7b0 fs/file_table.c:320
____fput+0x20/0x30 fs/file_table.c:348
task_work_run+0x1f4/0x280 kernel/task_work.c:203
resume_user_mode_work include/linux/resume_user_mode.h:49 [inline]
do_notify_resume+0x20f8/0x2c84 arch/arm64/kernel/signal.c:1151
prepare_exit_to_user_mode arch/arm64/kernel/entry-common.c:137 [inline]
exit_to_user_mode arch/arm64/kernel/entry-common.c:142 [inline]
el0_svc+0x98/0x128 arch/arm64/kernel/entry-common.c:638
el0t_64_sync_handler+0x84/0xf0 arch/arm64/kernel/entry-common.c:655
el0t_64_sync+0x18c/0x190 arch/arm64/kernel/entry.S:585

The buggy address belongs to the object at ffff0000c3827c00
which belongs to the cache kmalloc-128 of size 128
The buggy address is located 8 bytes inside of
128-byte region [ffff0000c3827c00, ffff0000c3827c80)

The buggy address belongs to the physical page:
page:0000000024334aca refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x103827
flags: 0x5ffc00000000200(slab|node=0|zone=2|lastcpupid=0x7ff)
raw: 05ffc00000000200 fffffc0003103640 dead000000000004 ffff0000c0002300
raw: 0000000000000000 0000000000100010 00000001ffffffff 0000000000000000
page dumped because: kasan: bad access detected

Memory state around the buggy address:
ffff0000c3827b00: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
ffff0000c3827b80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
>ffff0000c3827c00: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
^
ffff0000c3827c80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
ffff0000c3827d00: 00 00 00 00 00 00 00 00 00 00 00 00 fc fc fc fc
==================================================================
Unable to handle kernel paging request at virtual address dfff800000000008
KASAN: null-ptr-deref in range [0x0000000000000040-0x0000000000000047]
Mem abort info:
ESR = 0x0000000096000006
EC = 0x25: DABT (current EL), IL = 32 bits
SET = 0, FnV = 0
EA = 0, S1PTW = 0
FSC = 0x06: level 2 translation fault
Data abort info:
ISV = 0, ISS = 0x00000006
CM = 0, WnR = 0
[dfff800000000008] address between user and kernel address ranges
Internal error: Oops: 0000000096000006 [#1] PREEMPT SMP
Modules linked in:
CPU: 1 PID: 4533 Comm: md0_resync Tainted: G B syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 07/02/2026
pstate: 02400005 (nzcv daif +PAN -UAO +TCO -DIT -SSBS BTYPE=--)
pc : get_resync_pages drivers/md/raid1-10.c:90 [inline]
pc : r1buf_pool_free+0x90/0x134 drivers/md/raid1.c:229
lr : r1buf_pool_free+0x84/0x134 drivers/md/raid1.c:229
sp : ffff800021707500
x29: ffff800021707500 x28: 1fffe0001bedc44b x27: 1fffe0001bedc44e
x26: ffff80000ea38468 x25: 1fffe0001a43f080 x24: 00000000000011b5
x23: ffff0000d21ef658 x22: dfff800000000000 x21: 0000000000000040
x20: ffff0000d21f8400 x19: ffff0000d21ef600 x18: 1fffe00033e7697e
x17: 0000000000000000 x16: ffff800008043b30 x15: 0000000000000000
x14: 0000000000000001 x13: 1ffff00002ff016c x12: 0000000000000000
x11: ff0080000ea384c8 x10: 0000000000000000 x9 : ffff80001c5fab10
x8 : 0000000000000008 x7 : 0000000000000001 x6 : 0000000000000001
x5 : ffff800021706ed8 x4 : ffff800015464e80 x3 : ffff80000ea384ec
x2 : 0000000000000000 x1 : 0000000000000008 x0 : 0000000000000000
Call trace:
get_resync_pages drivers/md/raid1-10.c:90 [inline]
r1buf_pool_free+0x90/0x134 drivers/md/raid1.c:229
mempool_exit+0x190/0x290 mm/mempool.c:174
close_sync drivers/md/raid1.c:1713 [inline]
raid1_sync_request+0x328/0x26e4 drivers/md/raid1.c:2696
md_do_sync+0x2e18/0x36ec drivers/md/md.c:9158
md_thread+0x1e0/0x3cc drivers/md/md.c:8000
kthread+0x254/0x2e0 kernel/kthread.c:376
ret_from_fork+0x10/0x20 arch/arm64/kernel/entry.S:850
Code: 967af112 f9400288 91010115 d343fea8 (38766908)
---[ end trace 0000000000000000 ]---
----------------
Code disassembly (best guess):
0: 967af112 bl 0xfffffffff9ebc448
4: f9400288 ldr x8, [x20]
8: 91010115 add x21, x8, #0x40
c: d343fea8 lsr x8, x21, #3
* 10: 38766908 ldrb w8, [x8, x22] <-- trapping instruction


---
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.
Reply all
Reply to author
Forward
0 new messages