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 ffff888073be2448 by task syz-executor.0/18026 CPU: 3 PID: 18026 Comm: syz-executor.0 Not tainted 6.7.0-syzkaller-12377-g9d1694dc91ce #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_write+0x608/0xd00 fs/jfs/xattr.c:280 ea_put fs/jfs/xattr.c:610 [inline] __jfs_setxattr+0xf35/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:0xf7f72579 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:00000000f7f6d5ac EFLAGS: 00000292 ORIG_RAX: 00000000000000e3 RAX: ffffffffffffffda RBX: 0000000020000000 RCX: 0000000020000040 RDX: 0000000020004440 RSI: 0000000000000fe3 RDI: 0000000000000000 RBP: 0000000000000000 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000292 R12: 0000000000000000 R13: 0000000000000000 R14: 0000000000000000 R15: 0000000000000000 Allocated by task 18026: 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_write+0x728/0xd00 fs/jfs/xattr.c:256 ea_put fs/jfs/xattr.c:610 [inline] __jfs_setxattr+0xf35/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 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:4086 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 ffff888073be2420 which belongs to the cache jfs_mp of size 184 The buggy address is located 40 bytes inside of freed 184-byte region [ffff888073be2420, ffff888073be24d8) The buggy address belongs to the physical page: page:ffffea0001cef880 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x73be2 head:ffffea0001cef880 order:1 entire_mapcount:0 nr_pages_mapped:0 pincount:0 anon flags: 0x4fff00000000840(slab|head|node=1|zone=1|lastcpupid=0x7ff) page_type: 0xffffffff() raw: 04fff00000000840 ffff888017bbc140 0000000000000000 0000000000000001 raw: 0000000000000000 00000000801f001f 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 12331, tgid 12330 (syz-executor.0), ts 414332822776, free_ts 412591314556 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 diMount+0xe6/0x8d0 fs/jfs/jfs_imap.c:111 jfs_mount+0x68f/0x890 fs/jfs/jfs_mount.c:151 jfs_fill_super+0x5a3/0xd20 fs/jfs/super.c:556 mount_bdev+0x1df/0x2d0 fs/super.c:1663 legacy_get_tree+0x109/0x220 fs/fs_context.c:662 vfs_get_tree+0x8c/0x370 fs/super.c:1784 do_new_mount fs/namespace.c:3352 [inline] path_mount+0x14e6/0x1f20 fs/namespace.c:3679 page last free pid 5208 tgid 5208 stack trace: reset_page_owner include/linux/page_owner.h:24 [inline] free_pages_prepare mm/page_alloc.c:1140 [inline] free_unref_page_prepare+0x51f/0xb10 mm/page_alloc.c:2346 free_unref_page_list+0xe6/0xb40 mm/page_alloc.c:2532 release_pages+0x32a/0x14f0 mm/swap.c:1042 __folio_batch_release+0x77/0xe0 mm/swap.c:1062 folio_batch_release include/linux/pagevec.h:83 [inline] truncate_inode_pages_range+0x33e/0xf00 mm/truncate.c:362 evict+0x533/0x6b0 fs/inode.c:667 iput_final fs/inode.c:1739 [inline] iput.part.0+0x560/0x7b0 fs/inode.c:1765 iput+0x5c/0x80 fs/inode.c:1755 dentry_unlink_inode+0x292/0x430 fs/dcache.c:400 __dentry_kill+0x1ca/0x5f0 fs/dcache.c:603 shrink_kill fs/dcache.c:1048 [inline] shrink_dentry_list+0x140/0x5d0 fs/dcache.c:1075 shrink_dcache_parent+0xe2/0x530 fs/dcache.c:1509 do_one_tree fs/dcache.c:1538 [inline] shrink_dcache_for_umount+0x79/0x390 fs/dcache.c:1555 generic_shutdown_super+0x76/0x3d0 fs/super.c:624 kill_anon_super fs/super.c:1230 [inline] kill_litter_super+0x70/0xa0 fs/super.c:1240 deactivate_locked_super+0xbc/0x1a0 fs/super.c:477 Memory state around the buggy address: ffff888073be2300: fc fc fc fb fb fb fb fb fb fb fb fb fb fb fb fb ffff888073be2380: fb fb fb fb fb fb fb fb fb fb fc fc fc fc fc fc >ffff888073be2400: fc fc fc fc fa fb fb fb fb fb fb fb fb fb fb fb ^ ffff888073be2480: fb fb fb fb fb fb fb fb fb fb fb fc fc fc fc fc ffff888073be2500: fc fc fc fc fc fa fb fb fb fb fb fb fb fb fb fb ================================================================== ---------------- 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