ERROR: (device loop3): dbAdjCtl: the maximum free buddy is not the old root
ERROR: (device loop3): remounting filesystem as read-only
==================================================================
BUG: KASAN: slab-use-after-free in jfs_readdir+0x10a5/0x33f0
Read of size 8 at addr ffff888109783cc8 by task syz.3.377/13170

CPU: 0 UID: 0 PID: 13170 Comm: syz.3.377 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+0xe8/0x150
 print_address_description+0x55/0x1e0
 print_report+0x58/0x70
 kasan_report+0x117/0x150
 jfs_readdir+0x10a5/0x33f0
 wrap_directory_iterator+0x96/0xe0
 iterate_dir+0x2e2/0x4d0
 __se_sys_getdents64+0xf1/0x280
 do_syscall_64+0x174/0x580
 entry_SYSCALL_64_after_hwframe+0x77/0x7f
RIP: 0033:0x7fbf1099ce59
Code: ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 44 00 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 e8 ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007fbf0ebf6028 EFLAGS: 00000246 ORIG_RAX: 00000000000000d9
RAX: ffffffffffffffda RBX: 00007fbf10c15fa0 RCX: 00007fbf1099ce59
RDX: 0000000000000022 RSI: 0000000000000000 RDI: 0000000000000009
RBP: 00007fbf10a32e6f R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000
R13: 00007fbf10c16038 R14: 00007fbf10c15fa0 R15: 00007ffe05fa17a8
 </TASK>

Allocated by task 13170:
 kasan_save_track+0x3e/0x80
 __kasan_slab_alloc+0x6c/0x80
 kmem_cache_alloc_noprof+0x2a0/0x5f0
 mempool_alloc_noprof+0x1bf/0x300
 __get_metapage+0x4ed/0xdf0
 dtSearch+0x56c/0x2010
 jfs_symlink+0x843/0xfb0
 vfs_symlink+0x18b/0x330
 filename_symlinkat+0x1cd/0x410
 __se_sys_symlink+0x4d/0x2b0
 do_syscall_64+0x174/0x580
 entry_SYSCALL_64_after_hwframe+0x77/0x7f

Freed by task 13170:
 kasan_save_track+0x3e/0x80
 kasan_save_free_info+0x40/0x50
 __kasan_slab_free+0x5c/0x80
 kmem_cache_free+0x182/0x650
 mempool_free+0xec/0x130
 release_metapage+0x7f5/0xa60
 jfs_readdir+0xe32/0x33f0
 wrap_directory_iterator+0x96/0xe0
 iterate_dir+0x2e2/0x4d0
 __se_sys_getdents64+0xf1/0x280
 do_syscall_64+0x174/0x580
 entry_SYSCALL_64_after_hwframe+0x77/0x7f

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

The buggy address belongs to the physical page:
page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x109783
flags: 0x17ff00000000000(node=0|zone=2|lastcpupid=0x7ff)
page_type: f5(slab)
raw: 017ff00000000000 ffff888160705c80 dead000000000122 0000000000000000
raw: 0000000000000000 0000000800100010 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 5621, tgid 5621 (syz-executor), ts 70167634502, free_ts 70084880090
 post_alloc_hook+0x1f9/0x250
 get_page_from_freelist+0x21fa/0x2270
 __alloc_frozen_pages_noprof+0x18d/0x380
 allocate_slab+0x79/0x5e0
 refill_objects+0x2d5/0x350
 __pcs_replace_empty_main+0x2bf/0x6b0
 kmem_cache_alloc_noprof+0x382/0x5f0
 mempool_alloc_noprof+0x1bf/0x300
 __get_metapage+0x4ed/0xdf0
 diSync+0xc4/0x8d0
 diUnmount+0xc8/0x130
 jfs_umount+0x174/0x3b0
 jfs_put_super+0x8c/0x190
 generic_shutdown_super+0x13d/0x2d0
 kill_block_super+0x44/0x90
 deactivate_locked_super+0xbc/0x130
page last free pid 5765 tgid 5764 stack trace:
 __free_frozen_pages+0xc1e/0xd10
 rcu_core+0x78b/0x10a0
 handle_softirqs+0x225/0x840
 __irq_exit_rcu+0xca/0x220
 irq_exit_rcu+0x9/0x30
 sysvec_apic_timer_interrupt+0xa6/0xc0
 asm_sysvec_apic_timer_interrupt+0x1a/0x20

Memory state around the buggy address:
 ffff888109783b80: fc fc fc fc 00 00 00 00 00 00 00 00 00 00 00 00
 ffff888109783c00: 00 00 00 00 00 00 00 00 00 00 00 fc fc fc fc fc
>ffff888109783c80: fc fc fc fa fb fb fb fb fb fb fb fb fb fb fb fb
                                              ^
 ffff888109783d00: fb fb fb fb fb fb fb fb fb fb fc fc fc fc fc fc
 ffff888109783d80: fc fc fa fb fb fb fb fb fb fb fb fb fb fb fb fb
==================================================================
