loop2: detected capacity change from 0 to 32768 ================================================================== BUG: KASAN: use-after-free in diWrite+0x1132/0x1e30 fs/jfs/jfs_imap.c:753 Write of size 32 at addr ffff8880603c40c0 by task syz.2.234/7690 CPU: 1 UID: 0 PID: 7690 Comm: syz.2.234 Not tainted 6.14.0-rc3-syzkaller-00012-g2408a807bfc3 #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 12/27/2024 Call Trace: __dump_stack lib/dump_stack.c:94 [inline] dump_stack_lvl+0x241/0x360 lib/dump_stack.c:120 print_address_description mm/kasan/report.c:378 [inline] print_report+0x169/0x550 mm/kasan/report.c:489 kasan_report+0x143/0x180 mm/kasan/report.c:602 kasan_check_range+0x282/0x290 mm/kasan/generic.c:189 __asan_memcpy+0x40/0x70 mm/kasan/shadow.c:106 diWrite+0x1132/0x1e30 fs/jfs/jfs_imap.c:753 txCommit+0xa1a/0x6b90 fs/jfs/jfs_txnmgr.c:1255 add_missing_indices+0x8b3/0xbf0 fs/jfs/jfs_dtree.c:2663 jfs_readdir+0x20ad/0x3cb0 fs/jfs/jfs_dtree.c:3019 wrap_directory_iterator+0x91/0xd0 fs/readdir.c:65 iterate_dir+0x5a9/0x760 fs/readdir.c:108 __do_sys_getdents64 fs/readdir.c:403 [inline] __se_sys_getdents64+0x1e2/0x4b0 fs/readdir.c:389 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0xf3/0x230 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x77/0x7f RIP: 0033:0x7fda7c18cde9 Code: ff ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 40 00 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 c7 c1 a8 ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007fda7cff9038 EFLAGS: 00000246 ORIG_RAX: 00000000000000d9 RAX: ffffffffffffffda RBX: 00007fda7c3a5fa0 RCX: 00007fda7c18cde9 RDX: 00000000000000ef RSI: 0000400000000540 RDI: 0000000000000005 RBP: 00007fda7c20e2a0 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 0000000000000000 R14: 00007fda7c3a5fa0 R15: 00007ffdfd33dfc8 The buggy address belongs to the physical page: page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x26 pfn:0x603c4 flags: 0xfff00000000000(node=0|zone=1|lastcpupid=0x7ff) page_type: f0(buddy) raw: 00fff00000000000 ffffea0000d9aec8 ffffea000094cb48 0000000000000000 raw: 0000000000000026 0000000000000000 00000000f0000000 0000000000000000 page dumped because: kasan: bad access detected page_owner tracks the page as freed page last allocated via order 0, migratetype Unmovable, gfp_mask 0x152c40(GFP_NOFS|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_HARDWALL), pid 5843, tgid 5843 (udevd), ts 160013470249, free_ts 160847380472 set_page_owner include/linux/page_owner.h:32 [inline] post_alloc_hook+0x1f4/0x240 mm/page_alloc.c:1551 prep_new_page mm/page_alloc.c:1559 [inline] get_page_from_freelist+0x3651/0x37a0 mm/page_alloc.c:3477 __alloc_frozen_pages_noprof+0x292/0x710 mm/page_alloc.c:4739 alloc_pages_mpol+0x311/0x660 mm/mempolicy.c:2270 alloc_frozen_pages_noprof mm/mempolicy.c:2341 [inline] alloc_pages_noprof+0x121/0x190 mm/mempolicy.c:2361 folio_alloc_noprof+0x1e/0x30 mm/mempolicy.c:2371 filemap_alloc_folio_noprof+0xe1/0x540 mm/filemap.c:1019 ractl_alloc_folio mm/readahead.c:187 [inline] page_cache_ra_unbounded+0x36b/0x820 mm/readahead.c:271 do_page_cache_ra mm/readahead.c:328 [inline] force_page_cache_ra mm/readahead.c:357 [inline] page_cache_sync_ra+0x3e2/0xb00 mm/readahead.c:585 filemap_get_pages+0x59a/0x1fb0 mm/filemap.c:2580 filemap_read+0x464/0x1260 mm/filemap.c:2691 blkdev_read_iter+0x31f/0x460 block/fops.c:796 new_sync_read fs/read_write.c:484 [inline] vfs_read+0x975/0xb40 fs/read_write.c:565 ksys_read+0x18f/0x2b0 fs/read_write.c:708 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0xf3/0x230 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x77/0x7f page last free pid 5819 tgid 5819 stack trace: reset_page_owner include/linux/page_owner.h:25 [inline] free_pages_prepare mm/page_alloc.c:1127 [inline] free_unref_folios+0xe2f/0x18a0 mm/page_alloc.c:2707 folios_put_refs+0x76c/0x860 mm/swap.c:994 folio_batch_release include/linux/pagevec.h:101 [inline] mapping_try_invalidate+0x3f7/0x550 mm/truncate.c:501 generic_shutdown_super+0x139/0x2d0 fs/super.c:642 kill_block_super+0x44/0x90 fs/super.c:1710 xfs_kill_sb+0x15/0x50 fs/xfs/xfs_super.c:2111 deactivate_locked_super+0xc4/0x130 fs/super.c:473 cleanup_mnt+0x41f/0x4b0 fs/namespace.c:1413 task_work_run+0x24f/0x310 kernel/task_work.c:227 resume_user_mode_work include/linux/resume_user_mode.h:50 [inline] exit_to_user_mode_loop kernel/entry/common.c:114 [inline] exit_to_user_mode_prepare include/linux/entry-common.h:329 [inline] __syscall_exit_to_user_mode_work kernel/entry/common.c:207 [inline] syscall_exit_to_user_mode+0x13f/0x340 kernel/entry/common.c:218 do_syscall_64+0x100/0x230 arch/x86/entry/common.c:89 entry_SYSCALL_64_after_hwframe+0x77/0x7f Memory state around the buggy address: ffff8880603c3f80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ffff8880603c4000: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff >ffff8880603c4080: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ^ ffff8880603c4100: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ffff8880603c4180: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ==================================================================