blkno = 8ed2c, nblocks = 1 ERROR: (device loop0): dbUpdatePMap: blocks are outside the map JFS: metapage_get_blocks failed ERROR: (device loop0): release_metapage: metapage_write_one() failed ================================================================== BUG: KASAN: slab-use-after-free in drop_metapage fs/jfs/jfs_metapage.c:311 [inline] BUG: KASAN: slab-use-after-free in release_metapage+0x760/0xac0 fs/jfs/jfs_metapage.c:892 Read of size 8 at addr ffff8880426dabc8 by task jfsCommit/104 CPU: 0 UID: 0 PID: 104 Comm: jfsCommit Not tainted syzkaller #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:378 [inline] print_report+0xca/0x240 mm/kasan/report.c:482 kasan_report+0x118/0x150 mm/kasan/report.c:595 drop_metapage fs/jfs/jfs_metapage.c:311 [inline] release_metapage+0x760/0xac0 fs/jfs/jfs_metapage.c:892 txUnlock+0x524/0xdf0 fs/jfs/jfs_txnmgr.c:948 txLazyCommit fs/jfs/jfs_txnmgr.c:2683 [inline] jfs_lazycommit+0x584/0xa90 fs/jfs/jfs_txnmgr.c:2734 kthread+0x711/0x8a0 kernel/kthread.c:463 ret_from_fork+0x4bc/0x870 arch/x86/kernel/process.c:158 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:245 Allocated by task 5319: kasan_save_stack mm/kasan/common.c:56 [inline] kasan_save_track+0x3e/0x80 mm/kasan/common.c:77 unpoison_slab_object mm/kasan/common.c:342 [inline] __kasan_slab_alloc+0x6c/0x80 mm/kasan/common.c:368 kasan_slab_alloc include/linux/kasan.h:252 [inline] slab_post_alloc_hook mm/slub.c:4970 [inline] slab_alloc_node mm/slub.c:5280 [inline] kmem_cache_alloc_noprof+0x367/0x6e0 mm/slub.c:5287 mempool_alloc_noprof+0x1a7/0x510 mm/mempool.c:406 alloc_metapage fs/jfs/jfs_metapage.c:264 [inline] __get_metapage+0x509/0xde0 fs/jfs/jfs_metapage.c:760 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+0xb34/0xe80 fs/namei.c:5216 do_renameat2+0x6a2/0xa50 fs/namei.c:5364 __do_sys_rename fs/namei.c:5411 [inline] __se_sys_rename fs/namei.c:5409 [inline] __x64_sys_rename+0x82/0x90 fs/namei.c:5409 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline] do_syscall_64+0xfa/0xfa0 arch/x86/entry/syscall_64.c:94 entry_SYSCALL_64_after_hwframe+0x77/0x7f Freed by task 73: kasan_save_stack mm/kasan/common.c:56 [inline] kasan_save_track+0x3e/0x80 mm/kasan/common.c:77 __kasan_save_free_info+0x46/0x50 mm/kasan/generic.c:587 kasan_save_free_info mm/kasan/kasan.h:406 [inline] poison_slab_object mm/kasan/common.c:252 [inline] __kasan_slab_free+0x5c/0x80 mm/kasan/common.c:284 kasan_slab_free include/linux/kasan.h:234 [inline] slab_free_hook mm/slub.c:2539 [inline] slab_free mm/slub.c:6630 [inline] kmem_cache_free+0x19b/0x690 mm/slub.c:6740 free_metapage fs/jfs/jfs_metapage.c:279 [inline] metapage_release_folio+0x40e/0x540 fs/jfs/jfs_metapage.c:636 shrink_folio_list+0x20ac/0x4c70 mm/vmscan.c:1519 evict_folios+0x471e/0x57c0 mm/vmscan.c:4745 try_to_shrink_lruvec+0x8a3/0xb50 mm/vmscan.c:4908 shrink_one+0x21b/0x7c0 mm/vmscan.c:4953 shrink_many mm/vmscan.c:5016 [inline] lru_gen_shrink_node mm/vmscan.c:5094 [inline] shrink_node+0x315d/0x3780 mm/vmscan.c:6081 kswapd_shrink_node mm/vmscan.c:6941 [inline] balance_pgdat mm/vmscan.c:7124 [inline] kswapd+0x147c/0x2800 mm/vmscan.c:7389 kthread+0x711/0x8a0 kernel/kthread.c:463 ret_from_fork+0x4bc/0x870 arch/x86/kernel/process.c:158 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:245 The buggy address belongs to the object at ffff8880426daba0 which belongs to the cache jfs_mp of size 184 The buggy address is located 40 bytes inside of freed 184-byte region [ffff8880426daba0, ffff8880426dac58) The buggy address belongs to the physical page: page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x426da flags: 0x4fff00000000000(node=1|zone=1|lastcpupid=0x7ff) page_type: f5(slab) raw: 04fff00000000000 ffff88803255db40 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 5319, tgid 5318 (syz.0.0), ts 79323343260, free_ts 79286078445 set_page_owner include/linux/page_owner.h:32 [inline] post_alloc_hook+0x240/0x2a0 mm/page_alloc.c:1850 prep_new_page mm/page_alloc.c:1858 [inline] get_page_from_freelist+0x2365/0x2440 mm/page_alloc.c:3884 __alloc_frozen_pages_noprof+0x181/0x370 mm/page_alloc.c:5183 alloc_pages_mpol+0x232/0x4a0 mm/mempolicy.c:2416 alloc_slab_page mm/slub.c:3055 [inline] allocate_slab+0x96/0x350 mm/slub.c:3228 new_slab mm/slub.c:3282 [inline] ___slab_alloc+0xe94/0x18a0 mm/slub.c:4651 __slab_alloc+0x65/0x100 mm/slub.c:4770 __slab_alloc_node mm/slub.c:4846 [inline] slab_alloc_node mm/slub.c:5268 [inline] kmem_cache_alloc_noprof+0x3f9/0x6e0 mm/slub.c:5287 mempool_alloc_noprof+0x1a7/0x510 mm/mempool.c:406 alloc_metapage fs/jfs/jfs_metapage.c:264 [inline] __get_metapage+0x509/0xde0 fs/jfs/jfs_metapage.c:760 diReadSpecial+0x25b/0x710 fs/jfs/jfs_imap.c:447 jfs_mount+0x73/0x870 fs/jfs/jfs_mount.c:87 jfs_fill_super+0x6bc/0xd80 fs/jfs/super.c:523 get_tree_bdev_flags+0x40e/0x4d0 fs/super.c:1691 vfs_get_tree+0x92/0x2b0 fs/super.c:1751 fc_mount fs/namespace.c:1208 [inline] do_new_mount_fc fs/namespace.c:3651 [inline] do_new_mount+0x302/0xa10 fs/namespace.c:3727 page last free pid 5319 tgid 5318 stack trace: reset_page_owner include/linux/page_owner.h:25 [inline] free_pages_prepare mm/page_alloc.c:1394 [inline] __free_frozen_pages+0xbc4/0xd30 mm/page_alloc.c:2906 __tlb_remove_table_free mm/mmu_gather.c:227 [inline] tlb_remove_table_rcu+0x85/0x100 mm/mmu_gather.c:290 rcu_do_batch kernel/rcu/tree.c:2605 [inline] rcu_core+0xcab/0x1770 kernel/rcu/tree.c:2861 handle_softirqs+0x286/0x870 kernel/softirq.c:622 __do_softirq kernel/softirq.c:656 [inline] invoke_softirq kernel/softirq.c:496 [inline] __irq_exit_rcu+0xca/0x1f0 kernel/softirq.c:723 irq_exit_rcu+0x9/0x30 kernel/softirq.c:739 instr_sysvec_apic_timer_interrupt arch/x86/kernel/apic/apic.c:1052 [inline] sysvec_apic_timer_interrupt+0xa6/0xc0 arch/x86/kernel/apic/apic.c:1052 asm_sysvec_apic_timer_interrupt+0x1a/0x20 arch/x86/include/asm/idtentry.h:697 Memory state around the buggy address: ffff8880426daa80: fc fc fc fc fc fa fb fb fb fb fb fb fb fb fb fb ffff8880426dab00: fb fb fb fb fb fb fb fb fb fb fb fb fc fc fc fc >ffff8880426dab80: fc fc fc fc fa fb fb fb fb fb fb fb fb fb fb fb ^ ffff8880426dac00: fb fb fb fb fb fb fb fb fb fb fb fc fc fc fc fc ffff8880426dac80: fc fc fc 00 00 00 00 00 00 00 00 00 00 00 00 00 ==================================================================