================================================================== BUG: KASAN: slab-use-after-free in drop_metapage fs/jfs/jfs_metapage.c:312 [inline] BUG: KASAN: slab-use-after-free in release_metapage+0x717/0xa60 fs/jfs/jfs_metapage.c:893 Read of size 8 at addr ffff888031b8fdb8 by task jfsCommit/110 CPU: 0 UID: 0 PID: 110 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 04/01/2014 Call Trace: dump_stack_lvl+0xe8/0x150 lib/dump_stack.c:120 print_address_description+0x55/0x1e0 mm/kasan/report.c:378 print_report+0x58/0x70 mm/kasan/report.c:482 kasan_report+0x117/0x150 mm/kasan/report.c:595 drop_metapage fs/jfs/jfs_metapage.c:312 [inline] release_metapage+0x717/0xa60 fs/jfs/jfs_metapage.c:893 txUnlock+0x51c/0xde0 fs/jfs/jfs_txnmgr.c:949 txLazyCommit fs/jfs/jfs_txnmgr.c:2684 [inline] jfs_lazycommit+0x59f/0xac0 fs/jfs/jfs_txnmgr.c:2735 kthread+0x38b/0x480 kernel/kthread.c:436 ret_from_fork+0x514/0xb70 arch/x86/kernel/process.c:158 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:245 Allocated by task 5315: kasan_save_stack mm/kasan/common.c:57 [inline] kasan_save_track+0x3e/0x80 mm/kasan/common.c:78 unpoison_slab_object mm/kasan/common.c:340 [inline] __kasan_slab_alloc+0x6c/0x80 mm/kasan/common.c:366 kasan_slab_alloc include/linux/kasan.h:253 [inline] slab_post_alloc_hook mm/slub.c:4683 [inline] slab_alloc_node mm/slub.c:4996 [inline] kmem_cache_alloc_noprof+0x2b9/0x600 mm/slub.c:5010 mempool_alloc_noprof+0x1bf/0x300 mm/mempool.c:572 alloc_metapage fs/jfs/jfs_metapage.c:264 [inline] __get_metapage+0x4ed/0xdf0 fs/jfs/jfs_metapage.c:761 dtSplitRoot+0x216/0x1900 fs/jfs/jfs_dtree.c:1907 dtSplitUp fs/jfs/jfs_dtree.c:990 [inline] dtInsert+0xedd/0x5cb0 fs/jfs/jfs_dtree.c:868 jfs_rename+0x89d/0x1870 fs/jfs/namei.c:1226 vfs_rename+0xbd9/0xef0 fs/namei.c:6208 filename_renameat2+0x533/0x9a0 fs/namei.c:6326 __do_sys_rename fs/namei.c:6370 [inline] __se_sys_rename+0x55/0x2c0 fs/namei.c:6366 do_syscall_x64 arch/x86/entry/syscall_64.c:61 [inline] do_syscall_64+0x166/0x520 arch/x86/entry/syscall_64.c:84 entry_SYSCALL_64_after_hwframe+0x77/0x7f Freed by task 5315: kasan_save_stack mm/kasan/common.c:57 [inline] kasan_save_track+0x3e/0x80 mm/kasan/common.c:78 kasan_save_free_info+0x40/0x50 mm/kasan/generic.c:584 poison_slab_object mm/kasan/common.c:253 [inline] __kasan_slab_free+0x5c/0x80 mm/kasan/common.c:285 kasan_slab_free include/linux/kasan.h:235 [inline] slab_free_hook mm/slub.c:2748 [inline] slab_free mm/slub.c:6499 [inline] kmem_cache_free+0x182/0x650 mm/slub.c:6626 mempool_free+0xec/0x130 mm/mempool.c:717 free_metapage fs/jfs/jfs_metapage.c:280 [inline] drop_metapage fs/jfs/jfs_metapage.c:317 [inline] release_metapage+0x7f5/0xa60 fs/jfs/jfs_metapage.c:893 dtSearch+0x1ba2/0x2010 fs/jfs/jfs_dtree.c:621 jfs_lookup+0x1b0/0x420 fs/jfs/namei.c:1464 lookup_one_qstr_excl+0x12d/0x360 fs/namei.c:1810 __start_dirop fs/namei.c:2920 [inline] start_dirop fs/namei.c:2942 [inline] filename_create+0x20e/0x370 fs/namei.c:5092 filename_symlinkat+0xf7/0x410 fs/namei.c:5813 __do_sys_symlink fs/namei.c:5846 [inline] __se_sys_symlink+0x4d/0x2b0 fs/namei.c:5842 do_syscall_x64 arch/x86/entry/syscall_64.c:61 [inline] do_syscall_64+0x166/0x520 arch/x86/entry/syscall_64.c:84 entry_SYSCALL_64_after_hwframe+0x77/0x7f The buggy address belongs to the object at ffff888031b8fd90 which belongs to the cache jfs_mp of size 184 The buggy address is located 40 bytes inside of freed 184-byte region [ffff888031b8fd90, ffff888031b8fe48) The buggy address belongs to the physical page: page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x31b8f flags: 0x4fff00000000000(node=1|zone=1|lastcpupid=0x7ff) page_type: f5(slab) raw: 04fff00000000000 ffff888031b8a000 dead000000000122 0000000000000000 raw: 0000000000000000 0000000200100010 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 0xd2cc0(GFP_KERNEL|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC), pid 1, tgid 1 (swapper/0), ts 8149139920 set_page_owner include/linux/page_owner.h:33 [inline] post_alloc_hook+0x1f9/0x250 mm/page_alloc.c:1871 prep_new_page mm/page_alloc.c:1879 [inline] get_page_from_freelist+0x2209/0x2280 mm/page_alloc.c:3943 __alloc_frozen_pages_noprof+0x217/0x5a0 mm/page_alloc.c:5436 alloc_slab_page mm/slub.c:3347 [inline] allocate_slab+0x7d/0x620 mm/slub.c:3462 new_slab mm/slub.c:3513 [inline] refill_objects+0x2d5/0x350 mm/slub.c:7410 refill_sheaf mm/slub.c:2885 [inline] __pcs_replace_empty_main+0x2c8/0x6c0 mm/slub.c:4774 alloc_from_pcs mm/slub.c:4850 [inline] slab_alloc_node mm/slub.c:4984 [inline] kmem_cache_alloc_noprof+0x399/0x600 mm/slub.c:5010 mempool_init_node+0x1f4/0x510 mm/mempool.c:272 mempool_create_node_noprof+0xb8/0x150 mm/mempool.c:336 metapage_init+0xed/0x150 fs/jfs/jfs_metapage.c:293 init_jfs_fs+0xfd/0x4e0 fs/jfs/super.c:969 do_one_initcall+0x250/0x870 init/main.c:1357 do_initcall_level+0x10a/0x1a0 init/main.c:1419 do_initcalls+0x59/0xa0 init/main.c:1435 kernel_init_freeable+0x29d/0x3e0 init/main.c:1670 kernel_init+0x22/0x1d0 init/main.c:1560 page_owner free stack trace missing Memory state around the buggy address: ffff888031b8fc80: fc fc fc 00 00 00 00 00 00 00 00 00 00 00 00 00 ffff888031b8fd00: 00 00 00 00 00 00 00 00 00 00 fc fc fc fc fc fc >ffff888031b8fd80: fc fc fa fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff888031b8fe00: fb fb fb fb fb fb fb fb fb fc fc fc fc fc fc fc ffff888031b8fe80: fc 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ==================================================================