================================================================== 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 ffff88804731c238 by task syz-executor.3/5317 CPU: 0 PID: 5317 Comm: syz-executor.3 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:0xf7fcd579 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:00000000f7fc85ac EFLAGS: 00000292 ORIG_RAX: 00000000000000e3 RAX: ffffffffffffffda RBX: 0000000020000080 RCX: 00000000200000c0 RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000000000000 RBP: 0000000000000000 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000292 R12: 0000000000000000 R13: 0000000000000000 R14: 0000000000000000 R15: 0000000000000000 Allocated by task 5317: 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 4646: 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 shrink_zones mm/vmscan.c:6141 [inline] do_try_to_free_pages+0x36c/0x1940 mm/vmscan.c:6203 try_to_free_pages+0x2a6/0x630 mm/vmscan.c:6438 __perform_reclaim mm/page_alloc.c:3768 [inline] __alloc_pages_direct_reclaim mm/page_alloc.c:3790 [inline] __alloc_pages_slowpath mm/page_alloc.c:4195 [inline] __alloc_pages+0xb0f/0x2440 mm/page_alloc.c:4580 alloc_pages_mpol+0x258/0x5f0 mm/mempolicy.c:2133 folio_alloc+0x1e/0xe0 mm/mempolicy.c:2211 filemap_alloc_folio+0x3bb/0x490 mm/filemap.c:975 page_cache_ra_unbounded+0x1ac/0x5f0 mm/readahead.c:247 do_page_cache_ra mm/readahead.c:299 [inline] page_cache_ra_order+0x7d7/0xaa0 mm/readahead.c:544 do_sync_mmap_readahead mm/filemap.c:3153 [inline] filemap_fault+0x16a8/0x3570 mm/filemap.c:3245 __do_fault+0x107/0x490 mm/memory.c:4376 do_read_fault mm/memory.c:4738 [inline] do_fault mm/memory.c:4868 [inline] do_pte_missing mm/memory.c:3745 [inline] handle_pte_fault mm/memory.c:5144 [inline] __handle_mm_fault+0x32a9/0x4900 mm/memory.c:5285 handle_mm_fault+0x47a/0xa10 mm/memory.c:5450 do_user_addr_fault+0x30b/0x1030 arch/x86/mm/fault.c:1364 handle_page_fault arch/x86/mm/fault.c:1507 [inline] exc_page_fault+0x5d/0xc0 arch/x86/mm/fault.c:1563 asm_exc_page_fault+0x26/0x30 arch/x86/include/asm/idtentry.h:570 The buggy address belongs to the object at ffff88804731c210 which belongs to the cache jfs_mp of size 184 The buggy address is located 40 bytes inside of freed 184-byte region [ffff88804731c210, ffff88804731c2c8) The buggy address belongs to the physical page: page:ffffea00011cc700 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x4731c head:ffffea00011cc700 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 ffff8880195d3680 dead000000000122 0000000000000000 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 0xd2800(GFP_NOWAIT|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC), pid 5317, tgid 5316 (syz-executor.3), ts 208304471272, free_ts 206991553764 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_slowpath mm/page_alloc.c:4101 [inline] __alloc_pages+0x68e/0x2440 mm/page_alloc.c:4580 __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 diRead+0x650/0xb00 fs/jfs/jfs_imap.c:364 jfs_iget+0x84/0x4c0 fs/jfs/inode.c:35 jfs_lookup+0x2a4/0x370 fs/jfs/namei.c:1469 __lookup_slow+0x24d/0x450 fs/namei.c:1693 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 page last free pid 5218 tgid 5218 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+0x33/0x3c0 mm/page_alloc.c:2486 qlink_free mm/kasan/quarantine.c:160 [inline] qlist_free_all+0x58/0x150 mm/kasan/quarantine.c:176 kasan_quarantine_reduce+0x18e/0x1d0 mm/kasan/quarantine.c:283 __kasan_slab_alloc+0x65/0x90 mm/kasan/common.c:324 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 vma_lock_alloc kernel/fork.c:439 [inline] vm_area_dup+0x53/0x2f0 kernel/fork.c:492 dup_mmap kernel/fork.c:695 [inline] dup_mm kernel/fork.c:1685 [inline] copy_mm kernel/fork.c:1734 [inline] copy_process+0x5629/0x97b0 kernel/fork.c:2496 kernel_clone+0xfd/0x930 kernel/fork.c:2901 __do_compat_sys_ia32_clone+0xb7/0xf0 arch/x86/kernel/sys_ia32.c:254 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 Memory state around the buggy address: ffff88804731c100: fc 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ffff88804731c180: 00 00 00 00 00 00 00 00 fc fc fc fc fc fc fc fc >ffff88804731c200: fc fc fa fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff88804731c280: fb fb fb fb fb fb fb fb fb fc fc fc fc fc fc fc ffff88804731c300: 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