================================================================== BUG: KASAN: slab-use-after-free in jfs_readdir+0x118f/0x3ae0 fs/jfs/jfs_dtree.c:2881 Read of size 8 at addr ffff888063114510 by task syz.2.58/6415 CPU: 1 UID: 0 PID: 6415 Comm: syz.2.58 Tainted: G W 6.16.0-syzkaller-06699-ge8d780dcd957 #0 PREEMPT_{RT,(full)} Tainted: [W]=WARN Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 07/12/2025 Call Trace: dump_stack_lvl+0x189/0x250 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 jfs_readdir+0x118f/0x3ae0 fs/jfs/jfs_dtree.c:2881 wrap_directory_iterator+0x99/0xe0 fs/readdir.c:65 iterate_dir+0x5bb/0x780 fs/readdir.c:108 __do_sys_getdents64 fs/readdir.c:410 [inline] __se_sys_getdents64+0xe4/0x260 fs/readdir.c:396 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline] do_syscall_64+0xfa/0x3b0 arch/x86/entry/syscall_64.c:94 entry_SYSCALL_64_after_hwframe+0x77/0x7f RIP: 0033:0x7f426734e9a9 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:00007f4265174038 EFLAGS: 00000246 ORIG_RAX: 00000000000000d9 RAX: ffffffffffffffda RBX: 00007f4267576160 RCX: 00007f426734e9a9 RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000000000008 RBP: 00007f42673d0d69 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 0000000000000000 R14: 00007f4267576160 R15: 00007ffc46776ca8 Allocated by task 6412: kasan_save_stack mm/kasan/common.c:47 [inline] kasan_save_track+0x3e/0x80 mm/kasan/common.c:68 unpoison_slab_object mm/kasan/common.c:319 [inline] __kasan_slab_alloc+0x6c/0x80 mm/kasan/common.c:345 kasan_slab_alloc include/linux/kasan.h:250 [inline] slab_post_alloc_hook mm/slub.c:4179 [inline] slab_alloc_node mm/slub.c:4228 [inline] kmem_cache_alloc_noprof+0x143/0x310 mm/slub.c:4235 mempool_alloc_noprof+0x19d/0x4e0 mm/mempool.c:402 alloc_metapage fs/jfs/jfs_metapage.c:264 [inline] __get_metapage+0x509/0xde0 fs/jfs/jfs_metapage.c:758 dtSplitRoot+0x202/0x16c0 fs/jfs/jfs_dtree.c:1910 dtSplitUp fs/jfs/jfs_dtree.c:993 [inline] dtInsert+0xef8/0x5f40 fs/jfs/jfs_dtree.c:871 jfs_rename+0x7bc/0x1610 fs/jfs/namei.c:1225 vfs_rename+0xbda/0xf00 fs/namei.c:5129 do_renameat2+0x6ce/0xa80 fs/namei.c:5278 __do_sys_rename fs/namei.c:5325 [inline] __se_sys_rename fs/namei.c:5323 [inline] __x64_sys_rename+0x82/0x90 fs/namei.c:5323 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline] do_syscall_64+0xfa/0x3b0 arch/x86/entry/syscall_64.c:94 entry_SYSCALL_64_after_hwframe+0x77/0x7f Freed by task 6415: kasan_save_stack mm/kasan/common.c:47 [inline] kasan_save_track+0x3e/0x80 mm/kasan/common.c:68 kasan_save_free_info+0x46/0x50 mm/kasan/generic.c:576 poison_slab_object mm/kasan/common.c:247 [inline] __kasan_slab_free+0x62/0x70 mm/kasan/common.c:264 kasan_slab_free include/linux/kasan.h:233 [inline] slab_free_hook mm/slub.c:2416 [inline] slab_free mm/slub.c:4679 [inline] kmem_cache_free+0x195/0x510 mm/slub.c:4781 free_metapage fs/jfs/jfs_metapage.c:279 [inline] drop_metapage fs/jfs/jfs_metapage.c:316 [inline] release_metapage+0x84c/0xab0 fs/jfs/jfs_metapage.c:890 dtReadNext fs/jfs/jfs_dtree.c:3202 [inline] jfs_readdir+0xece/0x3ae0 fs/jfs/jfs_dtree.c:2874 wrap_directory_iterator+0x99/0xe0 fs/readdir.c:65 iterate_dir+0x5bb/0x780 fs/readdir.c:108 __do_sys_getdents64 fs/readdir.c:410 [inline] __se_sys_getdents64+0xe4/0x260 fs/readdir.c:396 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline] do_syscall_64+0xfa/0x3b0 arch/x86/entry/syscall_64.c:94 entry_SYSCALL_64_after_hwframe+0x77/0x7f The buggy address belongs to the object at ffff8880631144e0 which belongs to the cache jfs_mp of size 248 The buggy address is located 48 bytes inside of freed 248-byte region [ffff8880631144e0, ffff8880631145d8) The buggy address belongs to the physical page: page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x63114 flags: 0x80000000000000(node=0|zone=1) page_type: f5(slab) raw: 0080000000000000 ffff88801e3a63c0 dead000000000122 0000000000000000 raw: 0000000000000000 00000000800d000d 00000000f5000000 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 0xd2800(GFP_NOWAIT|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC), pid 6385, tgid 6384 (syz.2.58), ts 148001403068, free_ts 144286461168 set_page_owner include/linux/page_owner.h:32 [inline] post_alloc_hook+0x240/0x2a0 mm/page_alloc.c:1704 prep_new_page mm/page_alloc.c:1712 [inline] get_page_from_freelist+0x2119/0x21b0 mm/page_alloc.c:3669 __alloc_frozen_pages_noprof+0x181/0x370 mm/page_alloc.c:4959 alloc_pages_mpol+0xd1/0x380 mm/mempolicy.c:2419 alloc_slab_page mm/slub.c:2486 [inline] allocate_slab+0x8a/0x370 mm/slub.c:2654 new_slab mm/slub.c:2708 [inline] ___slab_alloc+0x8d1/0xdd0 mm/slub.c:3890 __slab_alloc mm/slub.c:3980 [inline] __slab_alloc_node mm/slub.c:4055 [inline] slab_alloc_node mm/slub.c:4216 [inline] kmem_cache_alloc_noprof+0xe6/0x310 mm/slub.c:4235 mempool_alloc_noprof+0x19d/0x4e0 mm/mempool.c:402 alloc_metapage fs/jfs/jfs_metapage.c:264 [inline] __get_metapage+0x509/0xde0 fs/jfs/jfs_metapage.c:758 diMount+0xc5/0xd90 fs/jfs/jfs_imap.c:111 jfs_mount+0x426/0x870 fs/jfs/jfs_mount.c:176 jfs_fill_super+0x6bc/0xd80 fs/jfs/super.c:523 get_tree_bdev_flags+0x40b/0x4d0 fs/super.c:1692 vfs_get_tree+0x8f/0x2b0 fs/super.c:1815 do_new_mount+0x2a2/0x9e0 fs/namespace.c:3805 do_mount fs/namespace.c:4133 [inline] __do_sys_mount fs/namespace.c:4344 [inline] __se_sys_mount+0x317/0x410 fs/namespace.c:4321 page last free pid 28 tgid 28 stack trace: reset_page_owner include/linux/page_owner.h:25 [inline] free_pages_prepare mm/page_alloc.c:1248 [inline] __free_frozen_pages+0xbe5/0xdf0 mm/page_alloc.c:2706 pagetable_free include/linux/mm.h:2886 [inline] pagetable_dtor_free include/linux/mm.h:2984 [inline] __tlb_remove_table+0x2d2/0x3b0 include/asm-generic/tlb.h:220 __tlb_remove_table_free mm/mmu_gather.c:227 [inline] tlb_remove_table_rcu+0x85/0x100 mm/mmu_gather.c:290 rcu_do_batch kernel/rcu/tree.c:2605 [inline] rcu_core kernel/rcu/tree.c:2861 [inline] rcu_cpu_kthread+0xc09/0x1b20 kernel/rcu/tree.c:2949 smpboot_thread_fn+0x53f/0xa60 kernel/smpboot.c:160 kthread+0x70e/0x8a0 kernel/kthread.c:464 ret_from_fork+0x3fc/0x770 arch/x86/kernel/process.c:148 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:245 Memory state around the buggy address: ffff888063114400: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff888063114480: fb fb fb fb fc fc fc fc fc fc fc fc fa fb fb fb >ffff888063114500: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff888063114580: fb fb fb fb fb fb fb fb fb fb fb fc fc fc fc fc ffff888063114600: fc fc fc 00 00 00 00 00 00 00 00 00 00 00 00 00 ==================================================================