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 ffff888011904bc8 by task jfsCommit/102 CPU: 0 UID: 0 PID: 102 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+0xe8/0x150 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+0x510/0xa50 arch/x86/kernel/process.c:158 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:246 Allocated by task 5336: 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:339 [inline] __kasan_slab_alloc+0x6c/0x80 mm/kasan/common.c:365 kasan_slab_alloc include/linux/kasan.h:252 [inline] slab_post_alloc_hook mm/slub.c:4953 [inline] slab_alloc_node mm/slub.c:5263 [inline] kmem_cache_alloc_noprof+0x37d/0x710 mm/slub.c:5270 mempool_alloc_noprof+0x1c9/0x2f0 mm/mempool.c:567 alloc_metapage fs/jfs/jfs_metapage.c:264 [inline] __get_metapage+0x50c/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+0xbb6/0xee0 fs/namei.c:5929 do_renameat2+0x538/0x8e0 fs/namei.c:6047 __do_sys_rename fs/namei.c:6090 [inline] __se_sys_rename fs/namei.c:6088 [inline] __x64_sys_rename+0x82/0x90 fs/namei.c:6088 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline] do_syscall_64+0xec/0xf80 arch/x86/entry/syscall_64.c:94 entry_SYSCALL_64_after_hwframe+0x77/0x7f Freed by task 5337: 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:584 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:2540 [inline] slab_free mm/slub.c:6670 [inline] kmem_cache_free+0x197/0x620 mm/slub.c:6781 mempool_free+0xec/0x130 mm/mempool.c:712 free_metapage fs/jfs/jfs_metapage.c:279 [inline] drop_metapage fs/jfs/jfs_metapage.c:316 [inline] release_metapage+0x859/0xac0 fs/jfs/jfs_metapage.c:892 dtSearch+0x1ce7/0x21b0 fs/jfs/jfs_dtree.c:624 jfs_lookup+0x155/0x380 fs/jfs/namei.c:1461 __lookup_slow+0x297/0x3d0 fs/namei.c:1858 lookup_slow+0x53/0x70 fs/namei.c:1875 walk_component fs/namei.c:2221 [inline] lookup_last fs/namei.c:2722 [inline] path_lookupat+0x3f5/0x8c0 fs/namei.c:2746 filename_lookup+0x212/0x570 fs/namei.c:2775 kern_path+0x35/0x50 fs/namei.c:2987 unix_find_bsd net/unix/af_unix.c:1215 [inline] unix_find_other+0x183/0xad0 net/unix/af_unix.c:1277 unix_dgram_sendmsg+0x761/0x18c0 net/unix/af_unix.c:2151 sock_sendmsg_nosec net/socket.c:727 [inline] __sock_sendmsg+0x21c/0x270 net/socket.c:742 ____sys_sendmsg+0x52d/0x820 net/socket.c:2592 ___sys_sendmsg+0x21f/0x2a0 net/socket.c:2646 __sys_sendmmsg+0x227/0x430 net/socket.c:2735 __do_sys_sendmmsg net/socket.c:2762 [inline] __se_sys_sendmmsg net/socket.c:2759 [inline] __x64_sys_sendmmsg+0xa0/0xc0 net/socket.c:2759 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline] do_syscall_64+0xec/0xf80 arch/x86/entry/syscall_64.c:94 entry_SYSCALL_64_after_hwframe+0x77/0x7f The buggy address belongs to the object at ffff888011904ba0 which belongs to the cache jfs_mp of size 184 The buggy address is located 40 bytes inside of freed 184-byte region [ffff888011904ba0, ffff888011904c58) The buggy address belongs to the physical page: page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x11904 flags: 0xfff00000000000(node=0|zone=1|lastcpupid=0x7ff) page_type: f5(slab) raw: 00fff00000000000 ffff88801a33f000 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 5336, tgid 5335 (syz.0.0), ts 75502610724, free_ts 75480127233 set_page_owner include/linux/page_owner.h:32 [inline] post_alloc_hook+0x234/0x290 mm/page_alloc.c:1846 prep_new_page mm/page_alloc.c:1854 [inline] get_page_from_freelist+0x24e0/0x2580 mm/page_alloc.c:3915 __alloc_frozen_pages_noprof+0x181/0x370 mm/page_alloc.c:5210 alloc_pages_mpol+0x232/0x4a0 mm/mempolicy.c:2486 alloc_slab_page mm/slub.c:3075 [inline] allocate_slab+0x86/0x3b0 mm/slub.c:3248 new_slab mm/slub.c:3302 [inline] ___slab_alloc+0xe53/0x1820 mm/slub.c:4656 __slab_alloc+0x65/0x100 mm/slub.c:4779 __slab_alloc_node mm/slub.c:4855 [inline] slab_alloc_node mm/slub.c:5251 [inline] kmem_cache_alloc_noprof+0x40f/0x710 mm/slub.c:5270 mempool_alloc_noprof+0x1c9/0x2f0 mm/mempool.c:567 alloc_metapage fs/jfs/jfs_metapage.c:264 [inline] __get_metapage+0x50c/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/0x2a0 fs/super.c:1751 fc_mount fs/namespace.c:1199 [inline] do_new_mount_fc fs/namespace.c:3636 [inline] do_new_mount+0x302/0xa10 fs/namespace.c:3712 page last free pid 5336 tgid 5335 stack trace: reset_page_owner include/linux/page_owner.h:25 [inline] free_pages_prepare mm/page_alloc.c:1395 [inline] __free_frozen_pages+0xbc8/0xd30 mm/page_alloc.c:2943 __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+0xc8e/0x1720 kernel/rcu/tree.c:2857 handle_softirqs+0x22b/0x7c0 kernel/softirq.c:622 __do_softirq kernel/softirq.c:656 [inline] invoke_softirq kernel/softirq.c:496 [inline] __irq_exit_rcu+0x60/0x150 kernel/softirq.c:723 irq_exit_rcu+0x9/0x30 kernel/softirq.c:739 instr_sysvec_apic_timer_interrupt arch/x86/kernel/apic/apic.c:1056 [inline] sysvec_apic_timer_interrupt+0xa6/0xc0 arch/x86/kernel/apic/apic.c:1056 asm_sysvec_apic_timer_interrupt+0x1a/0x20 arch/x86/include/asm/idtentry.h:697 Memory state around the buggy address: ffff888011904a80: fc fc fc fc fc fa fb fb fb fb fb fb fb fb fb fb ffff888011904b00: fb fb fb fb fb fb fb fb fb fb fb fb fc fc fc fc >ffff888011904b80: fc fc fc fc fa fb fb fb fb fb fb fb fb fb fb fb ^ ffff888011904c00: fb fb fb fb fb fb fb fb fb fb fb fc fc fc fc fc ffff888011904c80: fc fc fc 00 00 00 00 00 00 00 00 00 00 00 00 00 ==================================================================