blkno = 8ed2c, nblocks = 1 ERROR: (device loop0): dbUpdatePMap: blocks are outside the map ERROR: (device loop0): remounting filesystem as read-only JFS: metapage_get_blocks failed ERROR: (device loop0): release_metapage: metapage_write_one() failed ERROR: (device loop0): remounting filesystem as read-only ================================================================== BUG: KASAN: slab-use-after-free in drop_metapage fs/jfs/jfs_metapage.c:229 [inline] BUG: KASAN: slab-use-after-free in release_metapage+0x760/0xac0 fs/jfs/jfs_metapage.c:784 Read of size 8 at addr ffff888035376cc0 by task jfsCommit/106 CPU: 0 UID: 0 PID: 106 Comm: jfsCommit Not tainted 6.15.0-rc5-syzkaller-00032-g0d8d44db295c #0 PREEMPT(full) Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2~bpo12+1 04/01/2014 Call Trace: dump_stack_lvl+0x189/0x250 lib/dump_stack.c:120 print_address_description mm/kasan/report.c:408 [inline] print_report+0xb4/0x290 mm/kasan/report.c:521 kasan_report+0x118/0x150 mm/kasan/report.c:634 drop_metapage fs/jfs/jfs_metapage.c:229 [inline] release_metapage+0x760/0xac0 fs/jfs/jfs_metapage.c:784 txUnlock+0x524/0xdf0 fs/jfs/jfs_txnmgr.c:947 txLazyCommit fs/jfs/jfs_txnmgr.c:2682 [inline] jfs_lazycommit+0x584/0xa90 fs/jfs/jfs_txnmgr.c:2733 kthread+0x70e/0x8a0 kernel/kthread.c:464 ret_from_fork+0x4b/0x80 arch/x86/kernel/process.c:153 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:245 Allocated by task 5311: kasan_save_stack mm/kasan/common.c:47 [inline] kasan_save_track+0x3e/0x80 mm/kasan/common.c:68 unpoison_slab_object mm/kasan/common.c:319 [inline] __kasan_slab_alloc+0x6c/0x80 mm/kasan/common.c:345 kasan_slab_alloc include/linux/kasan.h:250 [inline] slab_post_alloc_hook mm/slub.c:4147 [inline] slab_alloc_node mm/slub.c:4196 [inline] kmem_cache_alloc_noprof+0x1c1/0x3c0 mm/slub.c:4203 mempool_alloc_noprof+0x1a4/0x510 mm/mempool.c:402 alloc_metapage fs/jfs/jfs_metapage.c:182 [inline] __get_metapage+0x50f/0xdc0 fs/jfs/jfs_metapage.c:652 dtSplitRoot+0x202/0x16c0 fs/jfs/jfs_dtree.c:1910 dtSplitUp fs/jfs/jfs_dtree.c:993 [inline] dtInsert+0xef8/0x5f40 fs/jfs/jfs_dtree.c:871 jfs_rename+0x7bc/0x1610 fs/jfs/namei.c:1225 vfs_rename+0xb99/0xec0 fs/namei.c:5121 do_renameat2+0x878/0xc50 fs/namei.c:5270 __do_sys_rename fs/namei.c:5317 [inline] __se_sys_rename fs/namei.c:5315 [inline] __x64_sys_rename+0x82/0x90 fs/namei.c:5315 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline] do_syscall_64+0xf6/0x210 arch/x86/entry/syscall_64.c:94 entry_SYSCALL_64_after_hwframe+0x77/0x7f Freed by task 5311: kasan_save_stack mm/kasan/common.c:47 [inline] kasan_save_track+0x3e/0x80 mm/kasan/common.c:68 kasan_save_free_info+0x46/0x50 mm/kasan/generic.c:576 poison_slab_object mm/kasan/common.c:247 [inline] __kasan_slab_free+0x62/0x70 mm/kasan/common.c:264 kasan_slab_free include/linux/kasan.h:233 [inline] slab_free_hook mm/slub.c:2380 [inline] slab_free mm/slub.c:4642 [inline] kmem_cache_free+0x192/0x3f0 mm/slub.c:4744 free_metapage fs/jfs/jfs_metapage.c:197 [inline] metapage_release_folio+0x40e/0x540 fs/jfs/jfs_metapage.c:552 folio_invalidate mm/truncate.c:140 [inline] truncate_cleanup_folio+0x2d5/0x430 mm/truncate.c:160 truncate_inode_pages_range+0x233/0xda0 mm/truncate.c:375 jfs_reconfigure+0x5ac/0xa00 fs/jfs/super.c:406 reconfigure_super+0x224/0x890 fs/super.c:1083 do_remount fs/namespace.c:3368 [inline] path_mount+0xd18/0xfe0 fs/namespace.c:4203 do_mount fs/namespace.c:4224 [inline] __do_sys_mount fs/namespace.c:4435 [inline] __se_sys_mount+0x317/0x410 fs/namespace.c:4412 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline] do_syscall_64+0xf6/0x210 arch/x86/entry/syscall_64.c:94 entry_SYSCALL_64_after_hwframe+0x77/0x7f The buggy address belongs to the object at ffff888035376c98 which belongs to the cache jfs_mp of size 184 The buggy address is located 40 bytes inside of freed 184-byte region [ffff888035376c98, ffff888035376d50) The buggy address belongs to the physical page: page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x35376 flags: 0x4fff00000000000(node=1|zone=1|lastcpupid=0x7ff) page_type: f5(slab) raw: 04fff00000000000 ffff888033564b40 dead000000000122 0000000000000000 raw: 0000000000000000 0000000000100010 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 5311, tgid 5310 (syz.0.0), ts 68083470780, free_ts 67926116647 set_page_owner include/linux/page_owner.h:32 [inline] post_alloc_hook+0x1d8/0x230 mm/page_alloc.c:1718 prep_new_page mm/page_alloc.c:1726 [inline] get_page_from_freelist+0x21ce/0x22b0 mm/page_alloc.c:3688 __alloc_frozen_pages_noprof+0x181/0x370 mm/page_alloc.c:4970 alloc_pages_mpol+0x232/0x4a0 mm/mempolicy.c:2301 alloc_slab_page mm/slub.c:2450 [inline] allocate_slab+0x8a/0x3b0 mm/slub.c:2618 new_slab mm/slub.c:2672 [inline] ___slab_alloc+0xbfc/0x1480 mm/slub.c:3858 __slab_alloc mm/slub.c:3948 [inline] __slab_alloc_node mm/slub.c:4023 [inline] slab_alloc_node mm/slub.c:4184 [inline] kmem_cache_alloc_noprof+0x283/0x3c0 mm/slub.c:4203 mempool_alloc_noprof+0x1a4/0x510 mm/mempool.c:402 alloc_metapage fs/jfs/jfs_metapage.c:182 [inline] __get_metapage+0x50f/0xdc0 fs/jfs/jfs_metapage.c:652 diReadSpecial+0x25b/0x710 fs/jfs/jfs_imap.c:447 jfs_mount+0x73/0x870 fs/jfs/jfs_mount.c:87 jfs_fill_super+0x6bc/0xd90 fs/jfs/super.c:523 get_tree_bdev_flags+0x40b/0x4d0 fs/super.c:1636 vfs_get_tree+0x8f/0x2b0 fs/super.c:1759 do_new_mount+0x24a/0xa40 fs/namespace.c:3884 do_mount fs/namespace.c:4224 [inline] __do_sys_mount fs/namespace.c:4435 [inline] __se_sys_mount+0x317/0x410 fs/namespace.c:4412 page last free pid 5311 tgid 5310 stack trace: reset_page_owner include/linux/page_owner.h:25 [inline] free_pages_prepare mm/page_alloc.c:1262 [inline] __free_frozen_pages+0xb0e/0xcd0 mm/page_alloc.c:2725 __slab_free+0x326/0x400 mm/slub.c:4553 qlink_free mm/kasan/quarantine.c:163 [inline] qlist_free_all+0x9a/0x140 mm/kasan/quarantine.c:179 kasan_quarantine_reduce+0x148/0x160 mm/kasan/quarantine.c:286 __kasan_slab_alloc+0x22/0x80 mm/kasan/common.c:329 kasan_slab_alloc include/linux/kasan.h:250 [inline] slab_post_alloc_hook mm/slub.c:4147 [inline] slab_alloc_node mm/slub.c:4196 [inline] kmem_cache_alloc_noprof+0x1c1/0x3c0 mm/slub.c:4203 ptlock_alloc+0x20/0x70 mm/memory.c:7354 ptlock_init include/linux/mm.h:3074 [inline] pagetable_pte_ctor include/linux/mm.h:3122 [inline] __pte_alloc_one_noprof include/asm-generic/pgalloc.h:73 [inline] pte_alloc_one+0x6d/0x160 arch/x86/mm/pgtable.c:17 __pte_alloc+0x25/0x160 mm/memory.c:430 do_anonymous_page mm/memory.c:4968 [inline] do_pte_missing mm/memory.c:4158 [inline] handle_pte_fault mm/memory.c:5997 [inline] __handle_mm_fault+0x49e9/0x5380 mm/memory.c:6140 handle_mm_fault+0x3f6/0x8c0 mm/memory.c:6309 do_user_addr_fault+0xa81/0x1390 arch/x86/mm/fault.c:1337 handle_page_fault arch/x86/mm/fault.c:1480 [inline] exc_page_fault+0x68/0x110 arch/x86/mm/fault.c:1538 asm_exc_page_fault+0x26/0x30 arch/x86/include/asm/idtentry.h:623 Memory state around the buggy address: ffff888035376b80: fc fc fc fc 00 00 00 00 00 00 00 00 00 00 00 00 ffff888035376c00: 00 00 00 00 00 00 00 00 00 00 00 fc fc fc fc fc >ffff888035376c80: fc fc fc fa fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff888035376d00: fb fb fb fb fb fb fb fb fb fb fc fc fc fc fc fc ffff888035376d80: fc fc 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ==================================================================