[v6.1] KASAN: use-after-free Read in iomap_finish_ioend (3)

2 views
Skip to first unread message

syzbot

unread,
Aug 21, 2025, 7:08:34 AM8/21/25
to syzkaller...@googlegroups.com
Hello,

syzbot found the following issue on:

HEAD commit: 0bc96de781b4 Linux 6.1.148
git tree: linux-6.1.y
console output: https://syzkaller.appspot.com/x/log.txt?x=109e96f0580000
kernel config: https://syzkaller.appspot.com/x/.config?x=483f799cd9933afc
dashboard link: https://syzkaller.appspot.com/bug?extid=9a16186a4c68bae92185
compiler: Debian clang version 20.1.7 (++20250616065708+6146a88f6049-1~exp1~20250616065826.132), Debian LLD 20.1.7
userspace arch: arm64

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

Downloadable assets:
disk image: https://storage.googleapis.com/syzbot-assets/cd15350f801a/disk-0bc96de7.raw.xz
vmlinux: https://storage.googleapis.com/syzbot-assets/789a5d74139d/vmlinux-0bc96de7.xz
kernel image: https://storage.googleapis.com/syzbot-assets/a1ef0a7e815a/Image-0bc96de7.gz.xz

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

==================================================================
BUG: KASAN: use-after-free in iomap_finish_ioend+0x9a0/0xa74 fs/iomap/buffered-io.c:1331
Read of size 8 at addr ffff0000f55d2110 by task kworker/1:3/4381

CPU: 1 PID: 4381 Comm: kworker/1:3 Not tainted 6.1.148-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 06/30/2025
Workqueue: xfs-conv/loop0 xfs_end_io
Call trace:
dump_backtrace+0x1c8/0x1f4 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+0xf8/0x160 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/0x100 mm/kasan/report.c:524
__asan_report_load8_noabort+0x2c/0x38 mm/kasan/report_generic.c:351
iomap_finish_ioend+0x9a0/0xa74 fs/iomap/buffered-io.c:1331
iomap_finish_ioends+0x11c/0x29c fs/iomap/buffered-io.c:1355
xfs_end_ioend+0x2bc/0x3c8 fs/xfs/xfs_aops.c:134
xfs_end_io+0x1fc/0x27c fs/xfs/xfs_aops.c:171
process_one_work+0x7f4/0x13a8 kernel/workqueue.c:2292
worker_thread+0x8c8/0xfbc kernel/workqueue.c:2439
kthread+0x250/0x2d8 kernel/kthread.c:376
ret_from_fork+0x10/0x20 arch/arm64/kernel/entry.S:849

Allocated by task 5111:
kasan_save_stack mm/kasan/common.c:45 [inline]
kasan_set_track+0x4c/0x80 mm/kasan/common.c:52
kasan_save_alloc_info+0x28/0x34 mm/kasan/generic.c:505
__kasan_slab_alloc+0x70/0x88 mm/kasan/common.c:328
kasan_slab_alloc include/linux/kasan.h:201 [inline]
slab_post_alloc_hook+0x74/0x43c mm/slab.h:737
slab_alloc_node mm/slub.c:3398 [inline]
slab_alloc mm/slub.c:3406 [inline]
__kmem_cache_alloc_lru mm/slub.c:3413 [inline]
kmem_cache_alloc_lru+0x1b0/0x298 mm/slub.c:3429
alloc_inode_sb include/linux/fs.h:3245 [inline]
xfs_inode_alloc+0x84/0x628 fs/xfs/xfs_icache.c:81
xfs_iget_cache_miss fs/xfs/xfs_icache.c:611 [inline]
xfs_iget+0x9c4/0x2f60 fs/xfs/xfs_icache.c:777
xfs_lookup+0x254/0x4b0 fs/xfs/xfs_inode.c:669
xfs_vn_lookup+0xf4/0x1a8 fs/xfs/xfs_iops.c:305
lookup_open fs/namei.c:3460 [inline]
open_last_lookups fs/namei.c:3550 [inline]
path_openat+0xfa4/0x2680 fs/namei.c:3780
do_filp_open+0x174/0x344 fs/namei.c:3810
do_sys_openat2+0x128/0x3d8 fs/open.c:1318
do_sys_open fs/open.c:1334 [inline]
__do_sys_openat fs/open.c:1350 [inline]
__se_sys_openat fs/open.c:1345 [inline]
__arm64_sys_openat+0x120/0x154 fs/open.c:1345
__invoke_syscall arch/arm64/kernel/syscall.c:38 [inline]
invoke_syscall+0x98/0x2bc arch/arm64/kernel/syscall.c:52
el0_svc_common+0x138/0x258 arch/arm64/kernel/syscall.c:140
do_el0_svc+0x58/0x13c arch/arm64/kernel/syscall.c:204
el0_svc+0x58/0x138 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 15:
kasan_save_stack mm/kasan/common.c:45 [inline]
kasan_set_track+0x4c/0x80 mm/kasan/common.c:52
kasan_save_free_info+0x3c/0x60 mm/kasan/generic.c:516
____kasan_slab_free+0x148/0x1b0 mm/kasan/common.c:236
__kasan_slab_free+0x18/0x28 mm/kasan/common.c:244
kasan_slab_free include/linux/kasan.h:177 [inline]
slab_free_hook mm/slub.c:1724 [inline]
slab_free_freelist_hook+0x16c/0x1ec mm/slub.c:1750
slab_free mm/slub.c:3661 [inline]
kmem_cache_free+0x11c/0x324 mm/slub.c:3683
xfs_inode_free_callback+0x198/0x1bc fs/xfs/xfs_icache.c:149
rcu_do_batch kernel/rcu/tree.c:2297 [inline]
rcu_core+0x81c/0x18ac kernel/rcu/tree.c:2557
rcu_core_si+0x10/0x1c kernel/rcu/tree.c:2574
handle_softirqs+0x318/0xc6c kernel/softirq.c:596
run_ksoftirqd+0x7c/0x2a0 kernel/softirq.c:963
smpboot_thread_fn+0x4b0/0x964 kernel/smpboot.c:164
kthread+0x250/0x2d8 kernel/kthread.c:376
ret_from_fork+0x10/0x20 arch/arm64/kernel/entry.S:849

Last potentially related work creation:
kasan_save_stack+0x40/0x70 mm/kasan/common.c:45
__kasan_record_aux_stack+0xc0/0xdc mm/kasan/generic.c:486
kasan_record_aux_stack_noalloc+0x14/0x20 mm/kasan/generic.c:496
call_rcu+0x100/0x954 kernel/rcu/tree.c:2849
__xfs_inode_free+0x194/0x240 fs/xfs/xfs_icache.c:161
xfs_reclaim_inode fs/xfs/xfs_icache.c:979 [inline]
xfs_icwalk_process_inode fs/xfs/xfs_icache.c:1660 [inline]
xfs_icwalk_ag+0xe94/0x1530 fs/xfs/xfs_icache.c:1742
xfs_icwalk fs/xfs/xfs_icache.c:1791 [inline]
xfs_reclaim_inodes+0x154/0x23c fs/xfs/xfs_icache.c:1012
xfs_unmount_flush_inodes+0xb8/0xf4 fs/xfs/xfs_mount.c:594
xfs_unmountfs+0xc0/0x248 fs/xfs/xfs_mount.c:1071
xfs_fs_put_super+0x78/0x260 fs/xfs/xfs_super.c:1118
generic_shutdown_super+0x130/0x324 fs/super.c:501
kill_block_super+0x70/0xdc fs/super.c:1470
deactivate_locked_super+0xac/0x124 fs/super.c:332
deactivate_super+0xe8/0x108 fs/super.c:363
cleanup_mnt+0x37c/0x404 fs/namespace.c:1182
__cleanup_mnt+0x20/0x30 fs/namespace.c:1189
task_work_run+0x1ec/0x270 kernel/task_work.c:203
resume_user_mode_work include/linux/resume_user_mode.h:49 [inline]
do_notify_resume+0x1f70/0x2b0c arch/arm64/kernel/signal.c:1137
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/0x138 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

Second to last potentially related work creation:
kasan_save_stack+0x40/0x70 mm/kasan/common.c:45
__kasan_record_aux_stack+0xc0/0xdc mm/kasan/generic.c:486
kasan_record_aux_stack_noalloc+0x14/0x20 mm/kasan/generic.c:496
insert_work+0x64/0x37c kernel/workqueue.c:1361
__queue_work+0xcbc/0x123c kernel/workqueue.c:1520
queue_work_on+0xc0/0x16c kernel/workqueue.c:1548
queue_work include/linux/workqueue.h:512 [inline]
xfs_end_bio+0xe0/0x1d8 fs/xfs/xfs_aops.c:186
bio_endio+0x770/0x7b4 block/bio.c:1554
iomap_submit_ioend fs/iomap/buffered-io.c:1470 [inline]
iomap_writepages+0x198/0x1f4 fs/iomap/buffered-io.c:1802
xfs_vm_writepages+0x130/0x194 fs/xfs/xfs_aops.c:477
do_writepages+0x2c0/0x4fc mm/page-writeback.c:2491
__writeback_single_inode+0x164/0x157c fs/fs-writeback.c:1612
writeback_sb_inodes+0x824/0x1404 fs/fs-writeback.c:1903
wb_writeback+0x400/0xfb0 fs/fs-writeback.c:2077
wb_do_writeback fs/fs-writeback.c:2220 [inline]
wb_workfn+0x34c/0xd98 fs/fs-writeback.c:2260
process_one_work+0x7f4/0x13a8 kernel/workqueue.c:2292
worker_thread+0x8c8/0xfbc kernel/workqueue.c:2439
kthread+0x250/0x2d8 kernel/kthread.c:376
ret_from_fork+0x10/0x20 arch/arm64/kernel/entry.S:849

The buggy address belongs to the object at ffff0000f55d1f00
which belongs to the cache xfs_inode of size 1808
The buggy address is located 528 bytes inside of
1808-byte region [ffff0000f55d1f00, ffff0000f55d2610)

The buggy address belongs to the physical page:
page:000000008723e54f refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x1355d0
head:000000008723e54f order:3 compound_mapcount:0 compound_pincount:0
memcg:ffff0000d46cb801
flags: 0x5ffc00000010200(slab|head|node=0|zone=2|lastcpupid=0x7ff)
raw: 05ffc00000010200 0000000000000000 dead000000000122 ffff0000c6fded80
raw: 0000000000000000 0000000080100010 00000001ffffffff ffff0000d46cb801
page dumped because: kasan: bad access detected

Memory state around the buggy address:
ffff0000f55d2000: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
ffff0000f55d2080: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
>ffff0000f55d2100: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
^
ffff0000f55d2180: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
ffff0000f55d2200: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
==================================================================
loop0: writeback error on inode 38, offset 0, sector 22


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