[<prev] [next>] [day] [month] [year] [list]
Message-ID: <695e0473.050a0220.1c677c.0356.GAE@google.com>
Date: Tue, 06 Jan 2026 23:00:03 -0800
From: syzbot <syzbot+b4444e3c972a7a124187@...kaller.appspotmail.com>
To: chao@...nel.org, linux-kernel@...r.kernel.org,
syzkaller-bugs@...glegroups.com
Subject: Re: [syzbot] [f2fs?] KASAN: use-after-free Read in f2fs_write_end_io (2)
Hello,
syzbot has tested the proposed patch but the reproducer is still triggering an issue:
KASAN: slab-use-after-free Read in f2fs_write_end_io
==================================================================
BUG: KASAN: slab-use-after-free in instrument_atomic_read include/linux/instrumented.h:68 [inline]
BUG: KASAN: slab-use-after-free in atomic_read include/linux/atomic/atomic-instrumented.h:32 [inline]
BUG: KASAN: slab-use-after-free in get_pages fs/f2fs/f2fs.h:2718 [inline]
BUG: KASAN: slab-use-after-free in f2fs_write_end_io+0x9b9/0xb60 fs/f2fs/data.c:364
Read of size 4 at addr ffff888012609170 by task kworker/u4:12/1826
CPU: 0 UID: 0 PID: 1826 Comm: kworker/u4:12 Not tainted syzkaller #0 PREEMPT(full)
Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2~bpo12+1 04/01/2014
Workqueue: loop0 loop_workfn
Call Trace:
<TASK>
dump_stack_lvl+0xe8/0x150 lib/dump_stack.c:120
print_address_description mm/kasan/report.c:378 [inline]
print_report+0xca/0x240 mm/kasan/report.c:482
kasan_report+0x118/0x150 mm/kasan/report.c:595
check_region_inline mm/kasan/generic.c:-1 [inline]
kasan_check_range+0x2b0/0x2c0 mm/kasan/generic.c:200
instrument_atomic_read include/linux/instrumented.h:68 [inline]
atomic_read include/linux/atomic/atomic-instrumented.h:32 [inline]
get_pages fs/f2fs/f2fs.h:2718 [inline]
f2fs_write_end_io+0x9b9/0xb60 fs/f2fs/data.c:364
blk_update_request+0x57e/0xe60 block/blk-mq.c:1007
blk_mq_end_request+0x3e/0x70 block/blk-mq.c:1169
lo_rw_aio_complete drivers/block/loop.c:337 [inline]
lo_rw_aio+0xcd1/0xef0 drivers/block/loop.c:410
do_req_filebacked drivers/block/loop.c:-1 [inline]
loop_handle_cmd drivers/block/loop.c:1926 [inline]
loop_process_work+0x8fe/0x10b0 drivers/block/loop.c:1961
process_one_work kernel/workqueue.c:3257 [inline]
process_scheduled_works+0xad1/0x1770 kernel/workqueue.c:3340
worker_thread+0x8a0/0xda0 kernel/workqueue.c:3421
kthread+0x711/0x8a0 kernel/kthread.c:463
ret_from_fork+0x510/0xa50 arch/x86/kernel/process.c:158
ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:246
</TASK>
Allocated by task 5909:
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]
__kmalloc_cache_noprof+0x3e2/0x700 mm/slub.c:5776
kmalloc_noprof include/linux/slab.h:957 [inline]
kzalloc_noprof include/linux/slab.h:1094 [inline]
f2fs_fill_super+0x8c/0x6ec0 fs/f2fs/super.c:4895
get_tree_bdev_flags+0x40e/0x4d0 fs/super.c:1691
vfs_get_tree+0x92/0x2a0 fs/super.c:1751
fc_mount fs/namespace.c:1199 [inline]
do_new_mount_fc fs/namespace.c:3636 [inline]
do_new_mount+0x302/0xa10 fs/namespace.c:3712
do_mount fs/namespace.c:4035 [inline]
__do_sys_mount fs/namespace.c:4224 [inline]
__se_sys_mount+0x313/0x410 fs/namespace.c:4201
do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline]
do_syscall_64+0xec/0xf80 arch/x86/entry/syscall_64.c:94
entry_SYSCALL_64_after_hwframe+0x77/0x7f
Freed by task 5909:
kasan_save_stack mm/kasan/common.c:57 [inline]
kasan_save_track+0x3e/0x80 mm/kasan/common.c:78
kasan_save_free_info+0x46/0x50 mm/kasan/generic.c:584
poison_slab_object mm/kasan/common.c:253 [inline]
__kasan_slab_free+0x5c/0x80 mm/kasan/common.c:285
kasan_slab_free include/linux/kasan.h:235 [inline]
slab_free_hook mm/slub.c:2540 [inline]
slab_free mm/slub.c:6670 [inline]
kfree+0x1c0/0x660 mm/slub.c:6878
kill_f2fs_super+0x5bb/0x6c0 fs/f2fs/super.c:5460
deactivate_locked_super+0xbc/0x130 fs/super.c:474
cleanup_mnt+0x425/0x4c0 fs/namespace.c:1318
task_work_run+0x1d4/0x260 kernel/task_work.c:233
exit_task_work include/linux/task_work.h:40 [inline]
do_exit+0x694/0x22f0 kernel/exit.c:971
do_group_exit+0x21c/0x2d0 kernel/exit.c:1112
get_signal+0x1285/0x1340 kernel/signal.c:3034
arch_do_signal_or_restart+0x9a/0x7a0 arch/x86/kernel/signal.c:337
__exit_to_user_mode_loop kernel/entry/common.c:41 [inline]
exit_to_user_mode_loop+0x87/0x4e0 kernel/entry/common.c:75
__exit_to_user_mode_prepare include/linux/irq-entry-common.h:226 [inline]
syscall_exit_to_user_mode_prepare include/linux/irq-entry-common.h:256 [inline]
syscall_exit_to_user_mode_work include/linux/entry-common.h:159 [inline]
syscall_exit_to_user_mode include/linux/entry-common.h:194 [inline]
do_syscall_64+0x2c1/0xf80 arch/x86/entry/syscall_64.c:100
entry_SYSCALL_64_after_hwframe+0x77/0x7f
Last potentially related work creation:
kasan_save_stack+0x3e/0x60 mm/kasan/common.c:57
kasan_record_aux_stack+0xbd/0xd0 mm/kasan/generic.c:556
insert_work+0x3d/0x330 kernel/workqueue.c:2180
__queue_work+0xcd0/0xf90 kernel/workqueue.c:2335
queue_work_on+0x106/0x1c0 kernel/workqueue.c:2386
queue_work include/linux/workqueue.h:669 [inline]
schedule_work include/linux/workqueue.h:730 [inline]
f2fs_handle_critical_error+0x255/0x540 fs/f2fs/super.c:4624
f2fs_write_end_io+0x886/0xb60 fs/f2fs/data.c:351
__submit_merged_bio+0x256/0x660 fs/f2fs/data.c:540
__f2fs_submit_merged_write fs/f2fs/data.c:635 [inline]
__submit_merged_write_cond+0x471/0x530 fs/f2fs/data.c:657
f2fs_sync_node_pages+0x1479/0x15e0 fs/f2fs/node.c:2166
block_operations fs/f2fs/checkpoint.c:1276 [inline]
f2fs_write_checkpoint+0xdd5/0x2430 fs/f2fs/checkpoint.c:1678
kill_f2fs_super+0x2d2/0x6c0 fs/f2fs/super.c:5448
deactivate_locked_super+0xbc/0x130 fs/super.c:474
cleanup_mnt+0x425/0x4c0 fs/namespace.c:1318
task_work_run+0x1d4/0x260 kernel/task_work.c:233
exit_task_work include/linux/task_work.h:40 [inline]
do_exit+0x694/0x22f0 kernel/exit.c:971
do_group_exit+0x21c/0x2d0 kernel/exit.c:1112
get_signal+0x1285/0x1340 kernel/signal.c:3034
arch_do_signal_or_restart+0x9a/0x7a0 arch/x86/kernel/signal.c:337
__exit_to_user_mode_loop kernel/entry/common.c:41 [inline]
exit_to_user_mode_loop+0x87/0x4e0 kernel/entry/common.c:75
__exit_to_user_mode_prepare include/linux/irq-entry-common.h:226 [inline]
syscall_exit_to_user_mode_prepare include/linux/irq-entry-common.h:256 [inline]
syscall_exit_to_user_mode_work include/linux/entry-common.h:159 [inline]
syscall_exit_to_user_mode include/linux/entry-common.h:194 [inline]
do_syscall_64+0x2c1/0xf80 arch/x86/entry/syscall_64.c:100
entry_SYSCALL_64_after_hwframe+0x77/0x7f
Second to last potentially related work creation:
kasan_save_stack+0x3e/0x60 mm/kasan/common.c:57
kasan_record_aux_stack+0xbd/0xd0 mm/kasan/generic.c:556
insert_work+0x3d/0x330 kernel/workqueue.c:2180
__queue_work+0xcd0/0xf90 kernel/workqueue.c:2335
queue_work_on+0x106/0x1c0 kernel/workqueue.c:2386
sanity_check_node_footer fs/f2fs/node.c:1536 [inline]
__get_node_folio+0xcaf/0x14f0 fs/f2fs/node.c:1581
do_read_inode fs/f2fs/inode.c:425 [inline]
f2fs_iget+0x77c/0x5640 fs/f2fs/inode.c:596
f2fs_nfs_get_inode+0x76/0x110 fs/f2fs/super.c:3723
generic_fh_to_dentry+0x9f/0xf0 fs/libfs.c:1498
exportfs_decode_fh_raw+0x178/0x6e0 fs/exportfs/expfs.c:456
do_handle_to_path+0xa4/0x1a0 fs/fhandle.c:276
handle_to_path fs/fhandle.c:400 [inline]
do_handle_open+0x6a1/0x930 fs/fhandle.c:424
do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline]
do_syscall_64+0xec/0xf80 arch/x86/entry/syscall_64.c:94
entry_SYSCALL_64_after_hwframe+0x77/0x7f
The buggy address belongs to the object at ffff888012608000
which belongs to the cache kmalloc-8k of size 8192
The buggy address is located 4464 bytes inside of
freed 8192-byte region [ffff888012608000, ffff88801260a000)
The buggy address belongs to the physical page:
page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x12608
head: order:3 mapcount:0 entire_mapcount:0 nr_pages_mapped:0 pincount:0
anon flags: 0xfff00000000040(head|node=0|zone=1|lastcpupid=0x7ff)
page_type: f5(slab)
raw: 00fff00000000040 ffff88801a442280 0000000000000000 dead000000000001
raw: 0000000000000000 0000000000020002 00000000f5000000 0000000000000000
head: 00fff00000000040 ffff88801a442280 0000000000000000 dead000000000001
head: 0000000000000000 0000000000020002 00000000f5000000 0000000000000000
head: 00fff00000000003 ffffea0000498201 00000000ffffffff 00000000ffffffff
head: ffffffffffffffff 0000000000000000 00000000ffffffff 0000000000000008
page dumped because: kasan: bad access detected
page_owner tracks the page as allocated
page last allocated via order 3, migratetype Unmovable, gfp_mask 0x528c0(GFP_NOWAIT|__GFP_IO|__GFP_FS|__GFP_NORETRY|__GFP_COMP), pid 5641, tgid 5641 (syz-executor), ts 138685806163, free_ts 108015343563
set_page_owner include/linux/page_owner.h:32 [inline]
post_alloc_hook+0x234/0x290 mm/page_alloc.c:1857
prep_new_page mm/page_alloc.c:1865 [inline]
get_page_from_freelist+0x24e0/0x2580 mm/page_alloc.c:3915
__alloc_frozen_pages_noprof+0x181/0x370 mm/page_alloc.c:5210
alloc_pages_mpol+0x232/0x4a0 mm/mempolicy.c:2486
alloc_slab_page mm/slub.c:3075 [inline]
allocate_slab+0x86/0x3b0 mm/slub.c:3248
new_slab mm/slub.c:3302 [inline]
___slab_alloc+0xe53/0x1820 mm/slub.c:4656
__slab_alloc+0x65/0x100 mm/slub.c:4779
__slab_alloc_node mm/slub.c:4855 [inline]
slab_alloc_node mm/slub.c:5251 [inline]
__do_kmalloc_node mm/slub.c:5656 [inline]
__kvmalloc_node_noprof+0x6b6/0x920 mm/slub.c:7136
kvmalloc_array_node_noprof include/linux/slab.h:1122 [inline]
__ptr_ring_init_queue_alloc_noprof include/linux/ptr_ring.h:481 [inline]
ptr_ring_init_noprof include/linux/ptr_ring.h:499 [inline]
skb_array_init_noprof include/linux/skb_array.h:182 [inline]
pfifo_fast_init+0x112/0x6c0 net/sched/sch_generic.c:870
qdisc_create_dflt+0x13b/0x4c0 net/sched/sch_generic.c:1015
mq_init+0x2dc/0x660 net/sched/sch_mq.c:90
qdisc_create_dflt+0x13b/0x4c0 net/sched/sch_generic.c:1015
attach_default_qdiscs net/sched/sch_generic.c:1197 [inline]
dev_activate+0x1ce/0x1150 net/sched/sch_generic.c:1251
__dev_open+0x647/0x800 net/core/dev.c:1692
__dev_change_flags+0x1f7/0x680 net/core/dev.c:9736
netif_change_flags+0x88/0x1a0 net/core/dev.c:9799
page last free pid 43 tgid 43 stack trace:
reset_page_owner include/linux/page_owner.h:25 [inline]
free_pages_prepare mm/page_alloc.c:1406 [inline]
__free_pages_ok+0xa83/0xbe0 mm/page_alloc.c:1582
wg_destruct+0x25f/0x310 drivers/net/wireguard/device.c:264
netdev_run_todo+0xcd5/0xea0 net/core/dev.c:11693
default_device_exit_batch+0x969/0x9e0 net/core/dev.c:13039
ops_exit_list net/core/net_namespace.c:205 [inline]
ops_undo_list+0x525/0x990 net/core/net_namespace.c:252
cleanup_net+0x4d8/0x7a0 net/core/net_namespace.c:696
process_one_work kernel/workqueue.c:3257 [inline]
process_scheduled_works+0xad1/0x1770 kernel/workqueue.c:3340
worker_thread+0x8a0/0xda0 kernel/workqueue.c:3421
kthread+0x711/0x8a0 kernel/kthread.c:463
ret_from_fork+0x510/0xa50 arch/x86/kernel/process.c:158
ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:246
Memory state around the buggy address:
ffff888012609000: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
ffff888012609080: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
>ffff888012609100: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
^
ffff888012609180: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
ffff888012609200: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
==================================================================
Tested on:
commit: ef6e5789 f2fs: fix use-after-free in f2fs_write_end_io
git tree: https://git.kernel.org/pub/scm/linux/kernel/git/chao/linux.git bugfix/syzbot
console output: https://syzkaller.appspot.com/x/log.txt?x=117fc922580000
kernel config: https://syzkaller.appspot.com/x/.config?x=513255d80ab78f2b
dashboard link: https://syzkaller.appspot.com/bug?extid=b4444e3c972a7a124187
compiler: Debian clang version 20.1.8 (++20250708063551+0c9f909b7976-1~exp1~20250708183702.136), Debian LLD 20.1.8
Note: no patches were applied.
Powered by blists - more mailing lists