loop5: detected capacity change from 0 to 32768 ================================================================== BUG: KASAN: slab-use-after-free in jfs_readdir+0x4151/0x4320 fs/jfs/jfs_dtree.c:2887 Read of size 1 at addr ffff8880833d2788 by task syz-executor.5/14330 CPU: 1 PID: 14330 Comm: syz-executor.5 Not tainted 6.6.0-rc5-syzkaller-00055-g1c8b86a3799f #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 09/06/2023 Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0xd9/0x1b0 lib/dump_stack.c:106 print_address_description mm/kasan/report.c:364 [inline] print_report+0xc4/0x620 mm/kasan/report.c:475 kasan_report+0xda/0x110 mm/kasan/report.c:588 jfs_readdir+0x4151/0x4320 fs/jfs/jfs_dtree.c:2887 wrap_directory_iterator+0xa5/0xe0 fs/readdir.c:67 iterate_dir+0x1e5/0x5f0 fs/readdir.c:106 __do_sys_getdents64 fs/readdir.c:405 [inline] __se_sys_getdents64 fs/readdir.c:390 [inline] __x64_sys_getdents64+0x14f/0x2e0 fs/readdir.c:390 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x38/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x63/0xcd RIP: 0033:0x7f41fd47cae9 Code: 28 00 00 00 75 05 48 83 c4 28 c3 e8 e1 20 00 00 90 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 b0 ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007f41fe27c0c8 EFLAGS: 00000246 ORIG_RAX: 00000000000000d9 RAX: ffffffffffffffda RBX: 00007f41fd59bf80 RCX: 00007f41fd47cae9 RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000000000004 RBP: 00007f41fd4c847a R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 000000000000000b R14: 00007f41fd59bf80 R15: 00007ffe7a29dac8 Allocated by task 6003: kasan_save_stack+0x33/0x50 mm/kasan/common.c:45 kasan_set_track+0x25/0x30 mm/kasan/common.c:52 __kasan_slab_alloc+0x81/0x90 mm/kasan/common.c:328 kasan_slab_alloc include/linux/kasan.h:188 [inline] slab_post_alloc_hook mm/slab.h:762 [inline] slab_alloc_node mm/slab.c:3237 [inline] slab_alloc mm/slab.c:3246 [inline] __kmem_cache_alloc_lru mm/slab.c:3423 [inline] kmem_cache_alloc_lru+0x202/0x6d0 mm/slab.c:3439 __d_alloc+0x32/0xac0 fs/dcache.c:1768 d_alloc+0x4e/0x220 fs/dcache.c:1848 d_alloc_parallel+0xe9/0x12d0 fs/dcache.c:2637 __lookup_slow+0x194/0x450 fs/namei.c:1678 lookup_slow fs/namei.c:1710 [inline] walk_component+0x349/0x5a0 fs/namei.c:2001 lookup_last fs/namei.c:2458 [inline] path_lookupat+0x17f/0x770 fs/namei.c:2482 filename_lookup+0x1e7/0x5b0 fs/namei.c:2511 vfs_statx+0x160/0x430 fs/stat.c:240 vfs_fstatat+0xb3/0x140 fs/stat.c:295 __do_sys_newfstatat+0x98/0x110 fs/stat.c:459 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x38/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x63/0xcd Freed by task 5091: kasan_save_stack+0x33/0x50 mm/kasan/common.c:45 kasan_set_track+0x25/0x30 mm/kasan/common.c:52 kasan_save_free_info+0x28/0x40 mm/kasan/generic.c:522 ____kasan_slab_free mm/kasan/common.c:236 [inline] ____kasan_slab_free+0x138/0x190 mm/kasan/common.c:200 kasan_slab_free include/linux/kasan.h:164 [inline] __cache_free mm/slab.c:3370 [inline] __do_kmem_cache_free mm/slab.c:3557 [inline] kmem_cache_free+0x104/0x380 mm/slab.c:3582 rcu_do_batch kernel/rcu/tree.c:2139 [inline] rcu_core+0x805/0x1bb0 kernel/rcu/tree.c:2403 __do_softirq+0x218/0x965 kernel/softirq.c:553 Last potentially related work creation: kasan_save_stack+0x33/0x50 mm/kasan/common.c:45 __kasan_record_aux_stack+0x78/0x80 mm/kasan/generic.c:492 __call_rcu_common.constprop.0+0x9a/0x790 kernel/rcu/tree.c:2653 dentry_free+0x135/0x160 fs/dcache.c:369 __dentry_kill+0x4c1/0x640 fs/dcache.c:621 dentry_kill fs/dcache.c:745 [inline] dput+0x6de/0xf80 fs/dcache.c:913 handle_mounts fs/namei.c:1554 [inline] step_into+0x1192/0x2230 fs/namei.c:1839 walk_component+0xfc/0x5a0 fs/namei.c:2007 lookup_last fs/namei.c:2458 [inline] path_lookupat+0x17f/0x770 fs/namei.c:2482 filename_lookup+0x1e7/0x5b0 fs/namei.c:2511 vfs_statx+0x160/0x430 fs/stat.c:240 vfs_fstatat+0xb3/0x140 fs/stat.c:295 __do_sys_newfstatat+0x98/0x110 fs/stat.c:459 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x38/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x63/0xcd Second to last potentially related work creation: kasan_save_stack+0x33/0x50 mm/kasan/common.c:45 __kasan_record_aux_stack+0x78/0x80 mm/kasan/generic.c:492 __call_rcu_common.constprop.0+0x9a/0x790 kernel/rcu/tree.c:2653 dentry_free+0xc2/0x160 fs/dcache.c:377 __dentry_kill+0x4c1/0x640 fs/dcache.c:621 dentry_kill fs/dcache.c:745 [inline] dput+0x6de/0xf80 fs/dcache.c:913 do_unlinkat+0x3e9/0x6d0 fs/namei.c:4401 __do_sys_unlink fs/namei.c:4446 [inline] __se_sys_unlink fs/namei.c:4444 [inline] __x64_sys_unlink+0xc8/0x110 fs/namei.c:4444 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x38/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x63/0xcd The buggy address belongs to the object at ffff8880833d26a0 which belongs to the cache dentry of size 312 The buggy address is located 232 bytes inside of freed 312-byte region [ffff8880833d26a0, ffff8880833d27d8) The buggy address belongs to the physical page: page:ffffea00020cf480 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x833d2 memcg:ffff888078e24a01 flags: 0xfff00000000800(slab|node=0|zone=1|lastcpupid=0x7ff) page_type: 0xa() raw: 00fff00000000800 ffff888140064000 ffffea000262a690 ffffea0001c8b6d0 raw: 0000000000000000 ffff8880833d20c0 000000010000000a ffff888078e24a01 page dumped because: kasan: bad access detected page_owner tracks the page as allocated page last allocated via order 0, migratetype Reclaimable, gfp_mask 0x3420d0(__GFP_IO|__GFP_FS|__GFP_NOWARN|__GFP_COMP|__GFP_HARDWALL|__GFP_THISNODE|__GFP_RECLAIMABLE), pid 5182, tgid 5182 (udevd), ts 860151029831, free_ts 454174809672 set_page_owner include/linux/page_owner.h:31 [inline] post_alloc_hook+0x2cf/0x340 mm/page_alloc.c:1536 prep_new_page mm/page_alloc.c:1543 [inline] get_page_from_freelist+0xee0/0x2f20 mm/page_alloc.c:3170 __alloc_pages+0x1d0/0x4a0 mm/page_alloc.c:4426 __alloc_pages_node include/linux/gfp.h:237 [inline] kmem_getpages mm/slab.c:1356 [inline] cache_grow_begin+0x99/0x3a0 mm/slab.c:2550 cache_alloc_refill+0x294/0x3a0 mm/slab.c:2923 ____cache_alloc mm/slab.c:2999 [inline] ____cache_alloc mm/slab.c:2982 [inline] __do_cache_alloc mm/slab.c:3182 [inline] slab_alloc_node mm/slab.c:3230 [inline] slab_alloc mm/slab.c:3246 [inline] __kmem_cache_alloc_lru mm/slab.c:3423 [inline] kmem_cache_alloc_lru+0x566/0x6d0 mm/slab.c:3439 __d_alloc+0x32/0xac0 fs/dcache.c:1768 d_alloc+0x4e/0x220 fs/dcache.c:1848 lookup_one_qstr_excl+0xc7/0x180 fs/namei.c:1604 do_unlinkat+0x294/0x6d0 fs/namei.c:4384 __do_sys_unlink fs/namei.c:4446 [inline] __se_sys_unlink fs/namei.c:4444 [inline] __x64_sys_unlink+0xc8/0x110 fs/namei.c:4444 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x38/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x63/0xcd page last free stack trace: reset_page_owner include/linux/page_owner.h:24 [inline] free_pages_prepare mm/page_alloc.c:1136 [inline] free_unref_page_prepare+0x476/0xa40 mm/page_alloc.c:2312 free_unref_page+0x33/0x3b0 mm/page_alloc.c:2405 slab_destroy mm/slab.c:1608 [inline] drain_freelist.isra.0+0xdc/0x130 mm/slab.c:2197 cache_reap+0x1da/0x330 mm/slab.c:3851 process_one_work+0x884/0x15c0 kernel/workqueue.c:2630 process_scheduled_works kernel/workqueue.c:2703 [inline] worker_thread+0x8b9/0x1290 kernel/workqueue.c:2784 kthread+0x33c/0x440 kernel/kthread.c:388 ret_from_fork+0x45/0x80 arch/x86/kernel/process.c:147 ret_from_fork_asm+0x11/0x20 arch/x86/entry/entry_64.S:304 Memory state around the buggy address: ffff8880833d2680: fc fc fc fc fa fb fb fb fb fb fb fb fb fb fb fb ffff8880833d2700: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb >ffff8880833d2780: fb fb fb fb fb fb fb fb fb fb fb fc fc fc fc fc ^ ffff8880833d2800: fc fc fc 00 00 00 00 00 00 00 00 00 00 00 00 00 ffff8880833d2880: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ==================================================================