loop7: detected capacity change from 0 to 32768 ================================================================== BUG: KASAN: slab-use-after-free in jfs_readdir+0x4362/0x4480 fs/jfs/jfs_dtree.c:2869 Read of size 8 at addr ffff88805794b8e8 by task syz.7.472/7943 CPU: 1 UID: 0 PID: 7943 Comm: syz.7.472 Not tainted 6.13.0-rc3-syzkaller-00209-g499551201b5f #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 09/13/2024 Call Trace: __dump_stack lib/dump_stack.c:94 [inline] dump_stack_lvl+0x116/0x1f0 lib/dump_stack.c:120 print_address_description mm/kasan/report.c:378 [inline] print_report+0xc3/0x620 mm/kasan/report.c:489 kasan_report+0xd9/0x110 mm/kasan/report.c:602 jfs_readdir+0x4362/0x4480 fs/jfs/jfs_dtree.c:2869 wrap_directory_iterator+0xa2/0xe0 fs/readdir.c:65 iterate_dir+0x532/0xb40 fs/readdir.c:108 __do_sys_getdents fs/readdir.c:322 [inline] __se_sys_getdents fs/readdir.c:308 [inline] __x64_sys_getdents+0x148/0x2c0 fs/readdir.c:308 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0xcd/0x250 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x77/0x7f RIP: 0033:0x7fedf9385d29 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:00007fedfa176038 EFLAGS: 00000246 ORIG_RAX: 000000000000004e RAX: ffffffffffffffda RBX: 00007fedf9575fa0 RCX: 00007fedf9385d29 RDX: 0000000000000058 RSI: 0000000000000000 RDI: 0000000000000007 RBP: 00007fedf9401aa8 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 0000000000000000 R14: 00007fedf9575fa0 R15: 00007ffefb1a90b8 Allocated by task 7943: kasan_save_stack+0x33/0x60 mm/kasan/common.c:47 kasan_save_track+0x14/0x30 mm/kasan/common.c:68 unpoison_slab_object mm/kasan/common.c:319 [inline] __kasan_slab_alloc+0x89/0x90 mm/kasan/common.c:345 kasan_slab_alloc include/linux/kasan.h:250 [inline] slab_post_alloc_hook mm/slub.c:4119 [inline] slab_alloc_node mm/slub.c:4168 [inline] kmem_cache_alloc_noprof+0x226/0x3d0 mm/slub.c:4175 mempool_alloc_noprof+0x179/0x390 mm/mempool.c:402 alloc_metapage fs/jfs/jfs_metapage.c:182 [inline] __get_metapage+0x789/0xfb0 fs/jfs/jfs_metapage.c:652 dtReadNext fs/jfs/jfs_dtree.c:3210 [inline] jfs_readdir+0x2fae/0x4480 fs/jfs/jfs_dtree.c:2862 wrap_directory_iterator+0xa2/0xe0 fs/readdir.c:65 iterate_dir+0x532/0xb40 fs/readdir.c:108 __do_sys_getdents fs/readdir.c:322 [inline] __se_sys_getdents fs/readdir.c:308 [inline] __x64_sys_getdents+0x148/0x2c0 fs/readdir.c:308 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0xcd/0x250 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x77/0x7f Freed by task 7943: kasan_save_stack+0x33/0x60 mm/kasan/common.c:47 kasan_save_track+0x14/0x30 mm/kasan/common.c:68 kasan_save_free_info+0x3b/0x60 mm/kasan/generic.c:582 poison_slab_object mm/kasan/common.c:247 [inline] __kasan_slab_free+0x51/0x70 mm/kasan/common.c:264 kasan_slab_free include/linux/kasan.h:233 [inline] slab_free_hook mm/slub.c:2353 [inline] slab_free mm/slub.c:4613 [inline] kmem_cache_free+0x152/0x4c0 mm/slub.c:4715 mempool_free+0xea/0x3b0 mm/mempool.c:548 free_metapage fs/jfs/jfs_metapage.c:197 [inline] drop_metapage fs/jfs/jfs_metapage.c:234 [inline] release_metapage+0x47d/0x880 fs/jfs/jfs_metapage.c:784 dtReadNext fs/jfs/jfs_dtree.c:3222 [inline] jfs_readdir+0x29a9/0x4480 fs/jfs/jfs_dtree.c:2862 wrap_directory_iterator+0xa2/0xe0 fs/readdir.c:65 iterate_dir+0x532/0xb40 fs/readdir.c:108 __do_sys_getdents fs/readdir.c:322 [inline] __se_sys_getdents fs/readdir.c:308 [inline] __x64_sys_getdents+0x148/0x2c0 fs/readdir.c:308 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0xcd/0x250 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x77/0x7f The buggy address belongs to the object at ffff88805794b8b8 which belongs to the cache jfs_mp of size 184 The buggy address is located 48 bytes inside of freed 184-byte region [ffff88805794b8b8, ffff88805794b970) The buggy address belongs to the physical page: page: refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x5794b flags: 0xfff00000000000(node=0|zone=1|lastcpupid=0x7ff) page_type: f5(slab) raw: 00fff00000000000 ffff88801f37e140 dead000000000122 0000000000000000 raw: 0000000000000000 0000000080100010 00000001f5000000 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 7943, tgid 7942 (syz.7.472), ts 229703131782, free_ts 227848455678 set_page_owner include/linux/page_owner.h:32 [inline] post_alloc_hook+0x2d1/0x350 mm/page_alloc.c:1556 prep_new_page mm/page_alloc.c:1564 [inline] get_page_from_freelist+0xfce/0x2f80 mm/page_alloc.c:3474 __alloc_pages_noprof+0x223/0x25b0 mm/page_alloc.c:4751 alloc_pages_mpol_noprof+0x2c9/0x610 mm/mempolicy.c:2269 alloc_slab_page mm/slub.c:2423 [inline] allocate_slab mm/slub.c:2589 [inline] new_slab+0x2c9/0x410 mm/slub.c:2642 ___slab_alloc+0xd7d/0x17a0 mm/slub.c:3830 __slab_alloc.constprop.0+0x56/0xb0 mm/slub.c:3920 __slab_alloc_node mm/slub.c:3995 [inline] slab_alloc_node mm/slub.c:4156 [inline] kmem_cache_alloc_noprof+0xfa/0x3d0 mm/slub.c:4175 mempool_alloc_noprof+0x179/0x390 mm/mempool.c:402 alloc_metapage fs/jfs/jfs_metapage.c:182 [inline] __get_metapage+0x789/0xfb0 fs/jfs/jfs_metapage.c:652 diSync+0xec/0x840 fs/jfs/jfs_imap.c:216 diNewIAG fs/jfs/jfs_imap.c:2610 [inline] diAllocExt fs/jfs/jfs_imap.c:1905 [inline] diAllocAG+0x11b2/0x2340 fs/jfs/jfs_imap.c:1669 diAlloc+0x856/0x1a70 fs/jfs/jfs_imap.c:1590 ialloc+0x84/0x9e0 fs/jfs/jfs_inode.c:56 jfs_mkdir+0x244/0xb40 fs/jfs/namei.c:225 vfs_mkdir+0x580/0x860 fs/namei.c:4311 page last free pid 7511 tgid 7511 stack trace: reset_page_owner include/linux/page_owner.h:25 [inline] free_pages_prepare mm/page_alloc.c:1127 [inline] free_unref_page+0x661/0x1080 mm/page_alloc.c:2657 __put_partials+0x14c/0x170 mm/slub.c:3157 qlink_free mm/kasan/quarantine.c:163 [inline] qlist_free_all+0x4e/0x120 mm/kasan/quarantine.c:179 kasan_quarantine_reduce+0x195/0x1e0 mm/kasan/quarantine.c:286 __kasan_slab_alloc+0x69/0x90 mm/kasan/common.c:329 kasan_slab_alloc include/linux/kasan.h:250 [inline] slab_post_alloc_hook mm/slub.c:4119 [inline] slab_alloc_node mm/slub.c:4168 [inline] kmem_cache_alloc_noprof+0x226/0x3d0 mm/slub.c:4175 getname_flags.part.0+0x4c/0x550 fs/namei.c:139 getname_flags+0x93/0xf0 include/linux/audit.h:322 user_path_at+0x24/0x60 fs/namei.c:3069 ksys_umount fs/namespace.c:2033 [inline] __do_sys_umount fs/namespace.c:2041 [inline] __se_sys_umount fs/namespace.c:2039 [inline] __x64_sys_umount+0x10b/0x1a0 fs/namespace.c:2039 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0xcd/0x250 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x77/0x7f Memory state around the buggy address: ffff88805794b780: fc fc fc fc fc fc fc fc fa fb fb fb fb fb fb fb ffff88805794b800: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fc >ffff88805794b880: fc fc fc fc fc fc fc fa fb fb fb fb fb fb fb fb ^ ffff88805794b900: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fc fc ffff88805794b980: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ==================================================================