XFS (loop3): log I/O error -5
==================================================================
BUG: KASAN: use-after-free in instrument_atomic_write include/linux/instrumented.h:86 [inline]
BUG: KASAN: use-after-free in set_bit include/asm-generic/bitops/instrumented-atomic.h:28 [inline]
BUG: KASAN: use-after-free in xfs_trans_committed_bulk+0x158/0x7f0 fs/xfs/xfs_trans.c:757
Write of size 8 at addr ffff8880726dee58 by task kworker/1:1H/150
CPU: 1 PID: 150 Comm: kworker/1:1H Not tainted 5.15.102-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 03/02/2023
Workqueue: xfs-log/loop3 xlog_ioend_work
Call Trace:
__dump_stack lib/dump_stack.c:88 [inline]
dump_stack_lvl+0x1e3/0x2cb lib/dump_stack.c:106
print_address_description+0x63/0x3b0 mm/kasan/report.c:248
__kasan_report mm/kasan/report.c:434 [inline]
kasan_report+0x16b/0x1c0 mm/kasan/report.c:451
kasan_check_range+0x27e/0x290 mm/kasan/generic.c:189
instrument_atomic_write include/linux/instrumented.h:86 [inline]
set_bit include/asm-generic/bitops/instrumented-atomic.h:28 [inline]
xfs_trans_committed_bulk+0x158/0x7f0 fs/xfs/xfs_trans.c:757
xlog_cil_committed+0x28d/0xe50 fs/xfs/xfs_log_cil.c:631
xlog_cil_process_committed+0x155/0x1a0 fs/xfs/xfs_log_cil.c:659
xlog_state_shutdown_callbacks+0x2b6/0x3a0 fs/xfs/xfs_log.c:516
xlog_force_shutdown+0x1e7/0x200 fs/xfs/xfs_log.c:3896
xfs_do_force_shutdown+0x11d/0x520 fs/xfs/xfs_fsops.c:529
xlog_ioend_work+0xc2/0x120 fs/xfs/xfs_log.c:1364
process_one_work+0x90d/0x1270 kernel/workqueue.c:2306
worker_thread+0xaca/0x1280 kernel/workqueue.c:2453
kthread+0x3f6/0x4f0 kernel/kthread.c:319
ret_from_fork+0x1f/0x30 :298
Allocated by task 7421:
kasan_save_stack mm/kasan/common.c:38 [inline]
kasan_set_track mm/kasan/common.c:46 [inline]
set_alloc_info mm/kasan/common.c:434 [inline]
__kasan_slab_alloc+0x8e/0xc0 mm/kasan/common.c:467
kasan_slab_alloc include/linux/kasan.h:254 [inline]
slab_post_alloc_hook+0x53/0x380 mm/slab.h:519
slab_alloc_node mm/slub.c:3220 [inline]
slab_alloc mm/slub.c:3228 [inline]
kmem_cache_alloc+0xf3/0x2e0 mm/slub.c:3233
kmem_cache_zalloc include/linux/slab.h:711 [inline]
xfs_buf_item_init+0x68/0x4e0 fs/xfs/xfs_buf_item.c:807
_xfs_trans_bjoin+0x44/0x100 fs/xfs/xfs_trans_buf.c:75
xfs_trans_get_buf_map+0x424/0x9b0 fs/xfs/xfs_trans_buf.c:162
xfs_trans_get_buf fs/xfs/xfs_trans.h:187 [inline]
xfs_dquot_disk_alloc+0x7a2/0xc40 fs/xfs/xfs_dquot.c:341
xfs_qm_dqread_alloc fs/xfs/xfs_dquot.c:647 [inline]
xfs_qm_dqread+0x2ca/0x940 fs/xfs/xfs_dquot.c:692
xfs_qm_dqget+0x26f/0x4e0 fs/xfs/xfs_dquot.c:897
xfs_qm_quotacheck_dqadjust+0xe6/0x630 fs/xfs/xfs_qm.c:1085
xfs_qm_dqusage_adjust+0x44f/0x670 fs/xfs/xfs_qm.c:1190
xfs_iwalk_ag_recs+0x53b/0x8f0 fs/xfs/xfs_iwalk.c:220
xfs_iwalk_run_callbacks+0x211/0x420 fs/xfs/xfs_iwalk.c:376
xfs_iwalk_ag+0xad2/0xbd0 fs/xfs/xfs_iwalk.c:482
xfs_iwalk_ag_work+0xf7/0x1a0 fs/xfs/xfs_iwalk.c:624
xfs_pwork_work+0x78/0x180 fs/xfs/xfs_pwork.c:47
process_one_work+0x90d/0x1270 kernel/workqueue.c:2306
worker_thread+0xaca/0x1280 kernel/workqueue.c:2453
kthread+0x3f6/0x4f0 kernel/kthread.c:319
ret_from_fork+0x1f/0x30 :298
Freed by task 8496:
kasan_save_stack mm/kasan/common.c:38 [inline]
kasan_set_track+0x4b/0x80 mm/kasan/common.c:46
kasan_set_free_info+0x1f/0x40 mm/kasan/generic.c:360
____kasan_slab_free+0xd8/0x120 mm/kasan/common.c:366
kasan_slab_free include/linux/kasan.h:230 [inline]
slab_free_hook mm/slub.c:1705 [inline]
slab_free_freelist_hook+0xdd/0x160 mm/slub.c:1731
slab_free mm/slub.c:3499 [inline]
kmem_cache_free+0x91/0x260 mm/slub.c:3515
xfs_buf_ioend+0x3dc/0x7e0 fs/xfs/xfs_buf.c:1286
__xfs_buf_submit+0x1e6/0x860 fs/xfs/xfs_buf.c:1598
xfs_buf_delwri_submit_buffers+0x6e5/0x9d0 fs/xfs/xfs_buf.c:2136
xfs_buf_delwri_submit+0xb6/0x260 fs/xfs/xfs_buf.c:2182
xfs_qm_quotacheck+0x3df/0x640 fs/xfs/xfs_qm.c:1351
xfs_qm_mount_quotas+0x328/0x610 fs/xfs/xfs_qm.c:1441
xfs_mountfs+0x162b/0x1ca0 fs/xfs/xfs_mount.c:904
xfs_fs_fill_super+0x100c/0x1240 fs/xfs/xfs_super.c:1658
get_tree_bdev+0x3fe/0x620 fs/super.c:1294
vfs_get_tree+0x88/0x270 fs/super.c:1499
do_new_mount+0x28b/0xad0 fs/namespace.c:2994
do_mount fs/namespace.c:3337 [inline]
__do_sys_mount fs/namespace.c:3545 [inline]
__se_sys_mount+0x2d5/0x3c0 fs/namespace.c:3522
do_syscall_x64 arch/x86/entry/common.c:50 [inline]
do_syscall_64+0x3d/0xb0 arch/x86/entry/common.c:80
entry_SYSCALL_64_after_hwframe+0x61/0xcb
The buggy address belongs to the object at ffff8880726dee18
which belongs to the cache xfs_buf_item of size 264
The buggy address is located 64 bytes inside of
264-byte region [ffff8880726dee18, ffff8880726def20)
The buggy address belongs to the page:
page:ffffea0001c9b780 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x726de
flags: 0xfff00000000200(slab|node=0|zone=1|lastcpupid=0x7ff)
raw: 00fff00000000200 ffffea0001c828c0 0000000500000005 ffff888146a69dc0
raw: 0000000000000000 00000000800c000c 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 0x112c40(GFP_NOFS|__GFP_NOWARN|__GFP_NORETRY|__GFP_HARDWALL), pid 9, ts 206143412708, free_ts 205857611573
prep_new_page mm/page_alloc.c:2426 [inline]
get_page_from_freelist+0x32dd/0x3470 mm/page_alloc.c:4159
__alloc_pages+0x272/0x790 mm/page_alloc.c:5421
alloc_slab_page mm/slub.c:1775 [inline]
allocate_slab mm/slub.c:1912 [inline]
new_slab+0xbb/0x4b0 mm/slub.c:1975
___slab_alloc+0x6f6/0xe10 mm/slub.c:3008
__slab_alloc mm/slub.c:3095 [inline]
slab_alloc_node mm/slub.c:3186 [inline]
slab_alloc mm/slub.c:3228 [inline]
kmem_cache_alloc+0x1e1/0x2e0 mm/slub.c:3233
kmem_cache_zalloc include/linux/slab.h:711 [inline]
xfs_buf_item_init+0x68/0x4e0 fs/xfs/xfs_buf_item.c:807
_xfs_trans_bjoin+0x44/0x100 fs/xfs/xfs_trans_buf.c:75
xfs_trans_read_buf_map+0x339/0xc30 fs/xfs/xfs_trans_buf.c:310
xfs_trans_read_buf fs/xfs/xfs_trans.h:210 [inline]
xfs_alloc_read_agfl+0x224/0x3e0 fs/xfs/libxfs/xfs_alloc.c:699
xfs_alloc_fix_freelist+0xd6e/0x1b80 fs/xfs/libxfs/xfs_alloc.c:2643
xfs_free_extent_fix_freelist+0x194/0x2c0 fs/xfs/libxfs/xfs_alloc.c:3314
xfs_rmap_finish_one+0x361/0x9a0 fs/xfs/libxfs/xfs_rmap.c:2403
xfs_trans_log_finish_rmap_update fs/xfs/xfs_rmap_item.c:322 [inline]
xfs_rmap_update_finish_item+0x11e/0x1f0 fs/xfs/xfs_rmap_item.c:427
xfs_defer_finish_one fs/xfs/libxfs/xfs_defer.c:421 [inline]
xfs_defer_finish_noroll+0x1126/0x2140 fs/xfs/libxfs/xfs_defer.c:494
__xfs_trans_commit+0x3f9/0xe80 fs/xfs/xfs_trans.c:852
xfs_bmapi_convert_delalloc+0xe5e/0x1180 fs/xfs/libxfs/xfs_bmap.c:4663
page last free stack trace:
reset_page_owner include/linux/page_owner.h:24 [inline]
free_pages_prepare mm/page_alloc.c:1340 [inline]
free_pcp_prepare mm/page_alloc.c:1391 [inline]
free_unref_page_prepare+0xcb7/0xd70 mm/page_alloc.c:3317
free_unref_page_list+0x1f7/0x970 mm/page_alloc.c:3433
release_pages+0x1bb9/0x1f40 mm/swap.c:963
tlb_batch_pages_flush mm/mmu_gather.c:49 [inline]
tlb_flush_mmu_free mm/mmu_gather.c:240 [inline]
tlb_flush_mmu mm/mmu_gather.c:247 [inline]
tlb_finish_mmu+0x177/0x320 mm/mmu_gather.c:338
exit_mmap+0x3cd/0x670 mm/mmap.c:3188
__mmput+0x112/0x3b0 kernel/fork.c:1118
exit_mm+0x688/0x7f0 kernel/exit.c:548
do_exit+0x626/0x2480 kernel/exit.c:859
do_group_exit+0x144/0x310 kernel/exit.c:994
get_signal+0xc66/0x14e0 kernel/signal.c:2889
arch_do_signal_or_restart+0xc3/0x1890 arch/x86/kernel/signal.c:865
handle_signal_work kernel/entry/common.c:148 [inline]
exit_to_user_mode_loop+0x97/0x130 kernel/entry/common.c:172
exit_to_user_mode_prepare+0xb1/0x140 kernel/entry/common.c:207
__syscall_exit_to_user_mode_work kernel/entry/common.c:289 [inline]
syscall_exit_to_user_mode+0x5d/0x2b0 kernel/entry/common.c:300
do_syscall_64+0x49/0xb0 arch/x86/entry/common.c:86
entry_SYSCALL_64_after_hwframe+0x61/0xcb
Memory state around the buggy address:
ffff8880726ded00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
ffff8880726ded80: fb fb fb fb fb fb fb fb fb fb fb fc fc fc fc fc
>ffff8880726dee00: fc fc fc fa fb fb fb fb fb fb fb fb fb fb fb fb
^
ffff8880726dee80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
ffff8880726def00: fb fb fb fb fc fc fc fc fc fc fc fc fc fc fc fc
==================================================================