================================================================== 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 ffff88801dab7218 by task syz-executor.3/22055 CPU: 1 PID: 22055 Comm: syz-executor.3 Not tainted 6.10.0-rc1-syzkaller-00013-g2bfcfd584ff5 #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+0x116/0x1f0 lib/dump_stack.c:114 print_address_description mm/kasan/report.c:377 [inline] print_report+0xc3/0x620 mm/kasan/report.c:488 kasan_report+0xd9/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+0xcf5/0x1070 fs/jfs/xattr.c:783 jfs_initxattrs+0x1ba/0x2a0 fs/jfs/xattr.c:1016 security_inode_init_security+0x21c/0x380 security/security.c:1744 jfs_init_security+0x86/0xc0 fs/jfs/xattr.c:1028 jfs_mkdir+0x41a/0xb30 fs/jfs/namei.c:240 vfs_mkdir+0x57d/0x860 fs/namei.c:4131 do_mkdirat+0x301/0x3a0 fs/namei.c:4154 __do_sys_mkdirat fs/namei.c:4169 [inline] __se_sys_mkdirat fs/namei.c:4167 [inline] __x64_sys_mkdirat+0x114/0x170 fs/namei.c:4167 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0xcd/0x250 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x77/0x7f RIP: 0033:0x7f064187b9e7 Code: 73 01 c3 48 c7 c1 b0 ff ff ff f7 d8 64 89 01 48 83 c8 ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 44 00 00 b8 02 01 00 00 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 c7 c1 b0 ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007f0642629ef8 EFLAGS: 00000246 ORIG_RAX: 0000000000000102 RAX: ffffffffffffffda RBX: 00007f0642629f80 RCX: 00007f064187b9e7 RDX: 00000000000001ff RSI: 0000000020000140 RDI: 00000000ffffff9c RBP: 0000000020000180 R08: 0000000020000000 R09: 0000000000000000 R10: 0000000020000180 R11: 0000000000000246 R12: 0000000020000140 R13: 00007f0642629f40 R14: 0000000000000000 R15: 0000000020000400 Allocated by task 22055: kasan_save_stack+0x33/0x60 mm/kasan/common.c:47 kasan_save_track+0x14/0x30 mm/kasan/common.c:68 unpoison_slab_object mm/kasan/common.c:312 [inline] __kasan_slab_alloc+0x89/0x90 mm/kasan/common.c:338 kasan_slab_alloc include/linux/kasan.h:201 [inline] slab_post_alloc_hook mm/slub.c:3940 [inline] slab_alloc_node mm/slub.c:4000 [inline] kmem_cache_alloc_noprof+0x121/0x2f0 mm/slub.c:4007 mempool_alloc_noprof+0x176/0x390 mm/mempool.c:402 alloc_metapage fs/jfs/jfs_metapage.c:176 [inline] __get_metapage+0x5f2/0x1170 fs/jfs/jfs_metapage.c:651 ea_get+0xda4/0x12c0 fs/jfs/xattr.c:526 __jfs_setxattr+0x1ed/0x1070 fs/jfs/xattr.c:718 jfs_initxattrs+0x1ba/0x2a0 fs/jfs/xattr.c:1016 security_inode_init_security+0x21c/0x380 security/security.c:1744 jfs_init_security+0x86/0xc0 fs/jfs/xattr.c:1028 jfs_mkdir+0x41a/0xb30 fs/jfs/namei.c:240 vfs_mkdir+0x57d/0x860 fs/namei.c:4131 do_mkdirat+0x301/0x3a0 fs/namei.c:4154 __do_sys_mkdirat fs/namei.c:4169 [inline] __se_sys_mkdirat fs/namei.c:4167 [inline] __x64_sys_mkdirat+0x114/0x170 fs/namei.c:4167 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0xcd/0x250 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x77/0x7f Freed by task 112: kasan_save_stack+0x33/0x60 mm/kasan/common.c:47 kasan_save_track+0x14/0x30 mm/kasan/common.c:68 kasan_save_free_info+0x3b/0x60 mm/kasan/generic.c:579 poison_slab_object+0xf7/0x160 mm/kasan/common.c:240 __kasan_slab_free+0x32/0x50 mm/kasan/common.c:256 kasan_slab_free include/linux/kasan.h:184 [inline] slab_free_hook mm/slub.c:2195 [inline] slab_free mm/slub.c:4436 [inline] kmem_cache_free+0x12f/0x3a0 mm/slub.c:4511 mempool_free+0xe7/0x3b0 mm/mempool.c:548 free_metapage fs/jfs/jfs_metapage.c:191 [inline] metapage_release_folio+0x2d2/0x4e0 fs/jfs/jfs_metapage.c:551 filemap_release_folio+0x1ed/0x280 mm/filemap.c:4173 shrink_folio_list+0x254a/0x4150 mm/vmscan.c:1394 evict_folios+0x6e6/0x1bf0 mm/vmscan.c:4553 try_to_shrink_lruvec+0x618/0x9b0 mm/vmscan.c:4749 shrink_one+0x3f8/0x7c0 mm/vmscan.c:4788 shrink_many mm/vmscan.c:4851 [inline] lru_gen_shrink_node mm/vmscan.c:4951 [inline] shrink_node+0x22bd/0x39b0 mm/vmscan.c:5910 kswapd_shrink_node mm/vmscan.c:6720 [inline] balance_pgdat+0x9a0/0x18f0 mm/vmscan.c:6911 kswapd+0x5ea/0xbf0 mm/vmscan.c:7180 kthread+0x2c1/0x3a0 kernel/kthread.c:389 ret_from_fork+0x45/0x80 arch/x86/kernel/process.c:147 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:244 The buggy address belongs to the object at ffff88801dab71f0 which belongs to the cache jfs_mp of size 184 The buggy address is located 40 bytes inside of freed 184-byte region [ffff88801dab71f0, ffff88801dab72a8) The buggy address belongs to the physical page: page: refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x1dab7 flags: 0xfff00000000000(node=0|zone=1|lastcpupid=0x7ff) page_type: 0xffffefff(slab) raw: 00fff00000000000 ffff888019299540 ffffea000120df40 0000000000000002 raw: 0000000000000000 0000000080100010 00000001ffffefff 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 0x1d2800(GFP_NOWAIT|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC|__GFP_HARDWALL), pid 11314, tgid 11313 (syz-executor.3), ts 276175208879, free_ts 275985263690 set_page_owner include/linux/page_owner.h:32 [inline] post_alloc_hook+0x2d1/0x350 mm/page_alloc.c:1468 prep_new_page mm/page_alloc.c:1476 [inline] get_page_from_freelist+0x136a/0x2df0 mm/page_alloc.c:3402 __alloc_pages_noprof+0x22b/0x2460 mm/page_alloc.c:4660 __alloc_pages_node_noprof include/linux/gfp.h:269 [inline] alloc_pages_node_noprof include/linux/gfp.h:296 [inline] alloc_slab_page+0x56/0x110 mm/slub.c:2264 allocate_slab mm/slub.c:2427 [inline] new_slab+0x84/0x260 mm/slub.c:2480 ___slab_alloc+0xdac/0x1870 mm/slub.c:3666 __slab_alloc.constprop.0+0x56/0xb0 mm/slub.c:3756 __slab_alloc_node mm/slub.c:3809 [inline] slab_alloc_node mm/slub.c:3988 [inline] kmem_cache_alloc_noprof+0x2a7/0x2f0 mm/slub.c:4007 mempool_alloc_noprof+0x176/0x390 mm/mempool.c:402 alloc_metapage fs/jfs/jfs_metapage.c:176 [inline] __get_metapage+0x5f2/0x1170 fs/jfs/jfs_metapage.c:651 diRead+0x650/0xb00 fs/jfs/jfs_imap.c:364 jfs_iget+0x88/0x4d0 fs/jfs/inode.c:35 jfs_fill_super+0x6c8/0xd20 fs/jfs/super.c:580 mount_bdev+0x1e3/0x2d0 fs/super.c:1659 legacy_get_tree+0x109/0x220 fs/fs_context.c:662 vfs_get_tree+0x8f/0x380 fs/super.c:1780 page last free pid 11314 tgid 11313 stack trace: reset_page_owner include/linux/page_owner.h:25 [inline] free_pages_prepare mm/page_alloc.c:1088 [inline] free_unref_page+0x64a/0xe40 mm/page_alloc.c:2565 __folio_put+0x239/0x360 mm/swap.c:129 folio_put include/linux/mm.h:1508 [inline] free_page_and_swap_cache+0x249/0x2c0 mm/swap_state.c:305 __tlb_remove_table arch/x86/include/asm/tlb.h:34 [inline] __tlb_remove_table_free mm/mmu_gather.c:227 [inline] tlb_remove_table_rcu+0x89/0xe0 mm/mmu_gather.c:282 rcu_do_batch kernel/rcu/tree.c:2535 [inline] rcu_core+0x828/0x16b0 kernel/rcu/tree.c:2809 handle_softirqs+0x216/0x8f0 kernel/softirq.c:554 __do_softirq kernel/softirq.c:588 [inline] invoke_softirq kernel/softirq.c:428 [inline] __irq_exit_rcu kernel/softirq.c:637 [inline] irq_exit_rcu+0xbb/0x120 kernel/softirq.c:649 instr_sysvec_apic_timer_interrupt arch/x86/kernel/apic/apic.c:1043 [inline] sysvec_apic_timer_interrupt+0x48/0xb0 arch/x86/kernel/apic/apic.c:1043 asm_sysvec_apic_timer_interrupt+0x1a/0x20 arch/x86/include/asm/idtentry.h:702 Memory state around the buggy address: ffff88801dab7100: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff88801dab7180: fb fb fb fb fb fb fc fc fc fc fc fc fc fc fa fb >ffff88801dab7200: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff88801dab7280: fb fb fb fb fb fc fc fc fc fc fc fc fc fa fb fb ffff88801dab7300: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ==================================================================