loop0: detected capacity change from 0 to 32768 ================================================================== BUG: KASAN: slab-use-after-free in drop_metapage fs/jfs/jfs_metapage.c:223 [inline] BUG: KASAN: slab-use-after-free in release_metapage+0xcde/0xdc0 fs/jfs/jfs_metapage.c:786 Read of size 8 at addr ffff88804e7c54c8 by task syz-executor.0/5707 CPU: 1 PID: 5707 Comm: syz-executor.0 Not tainted 6.8.0-rc1-syzkaller-00029-g615d30064886 #0 Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.2-debian-1.16.2-1 04/01/2014 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:377 [inline] print_report+0xc4/0x620 mm/kasan/report.c:488 kasan_report+0xda/0x110 mm/kasan/report.c:601 drop_metapage fs/jfs/jfs_metapage.c:223 [inline] release_metapage+0xcde/0xdc0 fs/jfs/jfs_metapage.c:786 write_metapage fs/jfs/jfs_metapage.h:75 [inline] flush_metapage fs/jfs/jfs_metapage.h:81 [inline] ea_put fs/jfs/xattr.c:614 [inline] __jfs_setxattr+0xd08/0x1060 fs/jfs/xattr.c:783 __jfs_xattr_set+0xc6/0x150 fs/jfs/xattr.c:917 __vfs_setxattr+0x173/0x1d0 fs/xattr.c:201 __vfs_setxattr_noperm+0x127/0x5e0 fs/xattr.c:235 __vfs_setxattr_locked+0x17e/0x250 fs/xattr.c:296 vfs_setxattr+0x146/0x350 fs/xattr.c:322 do_setxattr+0x142/0x170 fs/xattr.c:630 setxattr+0x159/0x170 fs/xattr.c:653 path_setxattr+0x175/0x1d0 fs/xattr.c:672 __do_sys_lsetxattr fs/xattr.c:695 [inline] __se_sys_lsetxattr fs/xattr.c:691 [inline] __ia32_sys_lsetxattr+0xbd/0x150 fs/xattr.c:691 do_syscall_32_irqs_on arch/x86/entry/common.c:165 [inline] __do_fast_syscall_32+0x79/0x110 arch/x86/entry/common.c:321 do_fast_syscall_32+0x33/0x70 arch/x86/entry/common.c:346 entry_SYSENTER_compat_after_hwframe+0x70/0x7a RIP: 0023:0xf7f02579 Code: b8 01 10 06 03 74 b4 01 10 07 03 74 b0 01 10 08 03 74 d8 01 00 00 00 00 00 00 00 00 00 00 00 00 00 51 52 55 89 e5 0f 34 cd 80 <5d> 5a 59 c3 90 90 90 90 8d b4 26 00 00 00 00 8d b4 26 00 00 00 00 RSP: 002b:00000000f7efd5ac EFLAGS: 00000292 ORIG_RAX: 00000000000000e3 RAX: ffffffffffffffda RBX: 0000000020000040 RCX: 0000000020000080 RDX: 0000000020000200 RSI: 0000000000000037 RDI: 0000000000000000 RBP: 0000000000000000 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000292 R12: 0000000000000000 R13: 0000000000000000 R14: 0000000000000000 R15: 0000000000000000 Allocated by task 5707: kasan_save_stack+0x33/0x50 mm/kasan/common.c:47 kasan_save_track+0x14/0x30 mm/kasan/common.c:68 unpoison_slab_object mm/kasan/common.c:314 [inline] __kasan_slab_alloc+0x81/0x90 mm/kasan/common.c:340 kasan_slab_alloc include/linux/kasan.h:201 [inline] slab_post_alloc_hook mm/slub.c:3813 [inline] slab_alloc_node mm/slub.c:3860 [inline] kmem_cache_alloc+0x136/0x320 mm/slub.c:3867 mempool_alloc+0x176/0x390 mm/mempool.c:408 alloc_metapage fs/jfs/jfs_metapage.c:176 [inline] __get_metapage+0x5ee/0x1170 fs/jfs/jfs_metapage.c:651 ea_get+0xda0/0x12c0 fs/jfs/xattr.c:526 __jfs_setxattr+0x1ed/0x1060 fs/jfs/xattr.c:718 __jfs_xattr_set+0xc6/0x150 fs/jfs/xattr.c:917 __vfs_setxattr+0x173/0x1d0 fs/xattr.c:201 __vfs_setxattr_noperm+0x127/0x5e0 fs/xattr.c:235 __vfs_setxattr_locked+0x17e/0x250 fs/xattr.c:296 vfs_setxattr+0x146/0x350 fs/xattr.c:322 do_setxattr+0x142/0x170 fs/xattr.c:630 setxattr+0x159/0x170 fs/xattr.c:653 path_setxattr+0x175/0x1d0 fs/xattr.c:672 __do_sys_lsetxattr fs/xattr.c:695 [inline] __se_sys_lsetxattr fs/xattr.c:691 [inline] __ia32_sys_lsetxattr+0xbd/0x150 fs/xattr.c:691 do_syscall_32_irqs_on arch/x86/entry/common.c:165 [inline] __do_fast_syscall_32+0x79/0x110 arch/x86/entry/common.c:321 do_fast_syscall_32+0x33/0x70 arch/x86/entry/common.c:346 entry_SYSENTER_compat_after_hwframe+0x70/0x7a Freed by task 109: kasan_save_stack+0x33/0x50 mm/kasan/common.c:47 kasan_save_track+0x14/0x30 mm/kasan/common.c:68 kasan_save_free_info+0x3f/0x60 mm/kasan/generic.c:640 poison_slab_object mm/kasan/common.c:241 [inline] __kasan_slab_free+0x121/0x1b0 mm/kasan/common.c:257 kasan_slab_free include/linux/kasan.h:184 [inline] slab_free_hook mm/slub.c:2121 [inline] slab_free mm/slub.c:4299 [inline] kmem_cache_free+0x129/0x350 mm/slub.c:4363 mempool_free+0xe7/0x3a0 mm/mempool.c:554 free_metapage fs/jfs/jfs_metapage.c:191 [inline] metapage_release_folio+0x2d2/0x4e0 fs/jfs/jfs_metapage.c:551 filemap_release_folio+0x1f1/0x270 mm/filemap.c:4088 shrink_folio_list+0x292c/0x3ea0 mm/vmscan.c:1369 evict_folios+0x6e7/0x1b90 mm/vmscan.c:4521 try_to_shrink_lruvec+0x638/0xa10 mm/vmscan.c:4726 shrink_one+0x3f4/0x7b0 mm/vmscan.c:4765 shrink_many mm/vmscan.c:4828 [inline] lru_gen_shrink_node mm/vmscan.c:4929 [inline] shrink_node+0x2149/0x3740 mm/vmscan.c:5888 kswapd_shrink_node mm/vmscan.c:6693 [inline] balance_pgdat+0x9d2/0x1a90 mm/vmscan.c:6883 kswapd+0x5be/0xbf0 mm/vmscan.c:7143 kthread+0x2c6/0x3a0 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:242 The buggy address belongs to the object at ffff88804e7c54a0 which belongs to the cache jfs_mp of size 184 The buggy address is located 40 bytes inside of freed 184-byte region [ffff88804e7c54a0, ffff88804e7c5558) The buggy address belongs to the physical page: page:ffffea000139f100 refcount:1 mapcount:0 mapping:0000000000000000 index:0xffff88804e7c4318 pfn:0x4e7c4 head:ffffea000139f100 order:1 entire_mapcount:0 nr_pages_mapped:0 pincount:0 flags: 0x4fff00000000840(slab|head|node=1|zone=1|lastcpupid=0x7ff) page_type: 0xffffffff() raw: 04fff00000000840 ffff8880173e7900 dead000000000122 0000000000000000 raw: ffff88804e7c4318 00000000801f0018 00000001ffffffff 0000000000000000 page dumped because: kasan: bad access detected page_owner tracks the page as allocated page last allocated via order 1, migratetype Unmovable, gfp_mask 0x1d2800(GFP_NOWAIT|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC|__GFP_HARDWALL), pid 5599, tgid 5598 (syz-executor.0), ts 202304574583, free_ts 202235818021 set_page_owner include/linux/page_owner.h:31 [inline] post_alloc_hook+0x2d0/0x350 mm/page_alloc.c:1533 prep_new_page mm/page_alloc.c:1540 [inline] get_page_from_freelist+0xa28/0x3780 mm/page_alloc.c:3311 __alloc_pages+0x22f/0x2440 mm/page_alloc.c:4567 __alloc_pages_node include/linux/gfp.h:238 [inline] alloc_pages_node include/linux/gfp.h:261 [inline] alloc_slab_page mm/slub.c:2190 [inline] allocate_slab mm/slub.c:2354 [inline] new_slab+0xcc/0x3a0 mm/slub.c:2407 ___slab_alloc+0x4af/0x19a0 mm/slub.c:3540 __slab_alloc.constprop.0+0x56/0xa0 mm/slub.c:3625 __slab_alloc_node mm/slub.c:3678 [inline] slab_alloc_node mm/slub.c:3850 [inline] kmem_cache_alloc+0x2e9/0x320 mm/slub.c:3867 mempool_alloc+0x176/0x390 mm/mempool.c:408 alloc_metapage fs/jfs/jfs_metapage.c:176 [inline] __get_metapage+0x5ee/0x1170 fs/jfs/jfs_metapage.c:651 ea_get+0xda0/0x12c0 fs/jfs/xattr.c:526 __jfs_setxattr+0x1ed/0x1060 fs/jfs/xattr.c:718 __jfs_xattr_set+0xc6/0x150 fs/jfs/xattr.c:917 __vfs_setxattr+0x173/0x1d0 fs/xattr.c:201 __vfs_setxattr_noperm+0x127/0x5e0 fs/xattr.c:235 __vfs_setxattr_locked+0x17e/0x250 fs/xattr.c:296 vfs_setxattr+0x146/0x350 fs/xattr.c:322 page last free pid 5599 tgid 5598 stack trace: create_dummy_stack mm/page_owner.c:69 [inline] register_dummy_stack+0x8a/0xd0 mm/page_owner.c:75 init_page_owner+0x48/0xa70 mm/page_owner.c:93 invoke_init_callbacks mm/page_ext.c:135 [inline] page_ext_init+0x66a/0xaa0 mm/page_ext.c:480 mm_core_init+0x683/0x730 mm/mm_init.c:2788 Memory state around the buggy address: ffff88804e7c5380: fc fc fc 00 00 00 00 00 00 00 00 00 00 00 00 00 ffff88804e7c5400: 00 00 00 00 00 00 00 00 00 00 fc fc fc fc fc fc >ffff88804e7c5480: fc fc fc fc fa fb fb fb fb fb fb fb fb fb fb fb ^ ffff88804e7c5500: fb fb fb fb fb fb fb fb fb fb fb fc fc fc fc fc ffff88804e7c5580: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ================================================================== ---------------- Code disassembly (best guess), 2 bytes skipped: 0: 10 06 adc %al,(%rsi) 2: 03 74 b4 01 add 0x1(%rsp,%rsi,4),%esi 6: 10 07 adc %al,(%rdi) 8: 03 74 b0 01 add 0x1(%rax,%rsi,4),%esi c: 10 08 adc %cl,(%rax) e: 03 74 d8 01 add 0x1(%rax,%rbx,8),%esi 1e: 00 51 52 add %dl,0x52(%rcx) 21: 55 push %rbp 22: 89 e5 mov %esp,%ebp 24: 0f 34 sysenter 26: cd 80 int $0x80 * 28: 5d pop %rbp <-- trapping instruction 29: 5a pop %rdx 2a: 59 pop %rcx 2b: c3 ret 2c: 90 nop 2d: 90 nop 2e: 90 nop 2f: 90 nop 30: 8d b4 26 00 00 00 00 lea 0x0(%rsi,%riz,1),%esi 37: 8d b4 26 00 00 00 00 lea 0x0(%rsi,%riz,1),%esi