BUG: KASAN: slab-use-after-free in jfs_readdir+0x118c/0x3ae0
Read of size 8 at addr ffff88811eabe6f8 by task syz.7.414/7851

CPU: 1 UID: 0 PID: 7851 Comm: syz.7.414 Not tainted syzkaller #0 PREEMPT(full) 
Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.2-debian-1.16.2-1 04/01/2014
Call Trace:
 <TASK>
 dump_stack_lvl+0x189/0x250
 print_report+0xca/0x240
 kasan_report+0x118/0x150
 jfs_readdir+0x118c/0x3ae0
 wrap_directory_iterator+0x96/0xe0
 iterate_dir+0x399/0x570
 __se_sys_getdents64+0xe4/0x260
 do_syscall_64+0xfa/0x3b0
 entry_SYSCALL_64_after_hwframe+0x77/0x7f
RIP: 0033:0x7fb97e98eba9
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:00007fb97f7ea038 EFLAGS: 00000246 ORIG_RAX: 00000000000000d9
RAX: ffffffffffffffda RBX: 00007fb97ebd6180 RCX: 00007fb97e98eba9
RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000000000009
RBP: 00007fb97ea11e19 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000
R13: 00007fb97ebd6218 R14: 00007fb97ebd6180 R15: 00007ffe0cc24eb8
 </TASK>

Allocated by task 7822:
 kasan_save_track+0x3e/0x80
 __kasan_slab_alloc+0x6c/0x80
 kmem_cache_alloc_noprof+0x1c1/0x3c0
 mempool_alloc_noprof+0x1a7/0x510
 __get_metapage+0x509/0xde0
 dtSplitRoot+0x202/0x16c0
 dtInsert+0xef8/0x5f40
 jfs_mknod+0x640/0x960
 vfs_mknod+0x37f/0x3c0
 do_mknodat+0x385/0x4d0
 __x64_sys_mknodat+0xa7/0xc0
 do_syscall_64+0xfa/0x3b0
 entry_SYSCALL_64_after_hwframe+0x77/0x7f

Freed by task 7851:
 kasan_save_track+0x3e/0x80
 kasan_save_free_info+0x46/0x50
 __kasan_slab_free+0x5b/0x80
 kmem_cache_free+0x18f/0x400
 release_metapage+0x859/0xac0
 jfs_readdir+0xecb/0x3ae0
 wrap_directory_iterator+0x96/0xe0
 iterate_dir+0x399/0x570
 __se_sys_getdents64+0xe4/0x260
 do_syscall_64+0xfa/0x3b0
 entry_SYSCALL_64_after_hwframe+0x77/0x7f

The buggy address belongs to the object at ffff88811eabe6c8
 which belongs to the cache jfs_mp of size 184
The buggy address is located 48 bytes inside of
 freed 184-byte region [ffff88811eabe6c8, ffff88811eabe780)

The buggy address belongs to the physical page:
page: refcount:0 mapcount:0 mapping:0000000000000000 index:0xffff88811eabe000 pfn:0x11eabe
flags: 0x57ff00000000000(node=1|zone=2|lastcpupid=0x7ff)
page_type: f5(slab)
raw: 057ff00000000000 ffff8881058038c0 dead000000000122 0000000000000000
raw: ffff88811eabe000 000000008010000d 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 7203, tgid 7203 (syz-executor), ts 124831343358, free_ts 124831178335
 post_alloc_hook+0x240/0x2a0
 get_page_from_freelist+0x21e4/0x22c0
 __alloc_frozen_pages_noprof+0x181/0x370
 alloc_pages_mpol+0x232/0x4a0
 allocate_slab+0x8a/0x370
 ___slab_alloc+0xbeb/0x1420
 kmem_cache_alloc_noprof+0x283/0x3c0
 mempool_alloc_noprof+0x1a7/0x510
 __get_metapage+0x509/0xde0
 diWriteSpecial+0x1b4/0x460
 diSync+0x69d/0x8d0
 diUnmount+0xc8/0x130
 jfs_umount+0x1d7/0x3c0
 jfs_put_super+0x8c/0x190
 generic_shutdown_super+0x135/0x2c0
 kill_block_super+0x44/0x90
page last free pid 7203 tgid 7203 stack trace:
 free_unref_folios+0xdbd/0x1520
 folios_put_refs+0x559/0x640
 truncate_inode_pages_range+0x346/0xda0
 diUnmount+0xf7/0x130
 jfs_umount+0x191/0x3c0
 jfs_put_super+0x8c/0x190
 generic_shutdown_super+0x135/0x2c0
 kill_block_super+0x44/0x90
 deactivate_locked_super+0xbc/0x130
 cleanup_mnt+0x425/0x4c0
 task_work_run+0x1d4/0x260
 exit_to_user_mode_loop+0xec/0x110
 do_syscall_64+0x2bd/0x3b0
 entry_SYSCALL_64_after_hwframe+0x77/0x7f

Memory state around the buggy address:
 ffff88811eabe580: 00 00 fc fc fc fc fc fc fc fc 00 00 00 00 00 00
 ffff88811eabe600: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
>ffff88811eabe680: 00 fc fc fc fc fc fc fc fc fa fb fb fb fb fb fb
                                                                ^
 ffff88811eabe700: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
 ffff88811eabe780: fc fc fc fc fc fc fc fc 00 00 00 00 00 00 00 00
==================================================================
