loop0: detected capacity change from 0 to 32768 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:312 [inline] BUG: KASAN: slab-use-after-free in release_metapage+0x738/0xaa0 fs/jfs/jfs_metapage.c:893 Read of size 8 at addr ffff888000e22eb0 by task syz.0.0/5328 CPU: 0 UID: 0 PID: 5328 Comm: syz.0.0 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+0x738/0xaa0 fs/jfs/jfs_metapage.c:893 write_metapage fs/jfs/jfs_metapage.h:75 [inline] flush_metapage fs/jfs/jfs_metapage.h:81 [inline] jfs_symlink+0xb80/0xfd0 fs/jfs/namei.c:1008 vfs_symlink+0x195/0x340 fs/namei.c:5643 filename_symlinkat+0x1cd/0x410 fs/namei.c:5668 __do_sys_symlinkat fs/namei.c:5688 [inline] __se_sys_symlinkat+0x4e/0x2b0 fs/namei.c:5683 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline] do_syscall_64+0x15f/0xf80 arch/x86/entry/syscall_64.c:94 entry_SYSCALL_64_after_hwframe+0x77/0x7f RIP: 0033:0x7f756fd9c819 Code: ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 44 00 00 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 c7 c1 e8 ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007f7570bc2fe8 EFLAGS: 00000246 ORIG_RAX: 000000000000010a RAX: ffffffffffffffda RBX: 00007f7570015fa0 RCX: 00007f756fd9c819 RDX: 0000200000000340 RSI: 0000000000000005 RDI: 0000200000000440 RBP: 00007f756fe32c91 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 00007f7570016038 R14: 00007f7570015fa0 R15: 00007ffcb20299c8 Allocated by task 5328: 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:4569 [inline] slab_alloc_node mm/slub.c:4898 [inline] kmem_cache_alloc_noprof+0x2bc/0x650 mm/slub.c:4905 mempool_alloc_noprof+0x1ce/0x300 mm/mempool.c:566 alloc_metapage fs/jfs/jfs_metapage.c:264 [inline] __get_metapage+0x50c/0xe20 fs/jfs/jfs_metapage.c:761 jfs_symlink+0xaff/0xfd0 fs/jfs/namei.c:999 vfs_symlink+0x195/0x340 fs/namei.c:5643 filename_symlinkat+0x1cd/0x410 fs/namei.c:5668 __do_sys_symlinkat fs/namei.c:5688 [inline] __se_sys_symlinkat+0x4e/0x2b0 fs/namei.c:5683 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline] do_syscall_64+0x15f/0xf80 arch/x86/entry/syscall_64.c:94 entry_SYSCALL_64_after_hwframe+0x77/0x7f Freed by task 71: kasan_save_stack mm/kasan/common.c:57 [inline] kasan_save_track+0x3e/0x80 mm/kasan/common.c:78 kasan_save_free_info+0x46/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:2689 [inline] slab_free mm/slub.c:6246 [inline] kmem_cache_free+0x182/0x650 mm/slub.c:6373 mempool_free+0xec/0x130 mm/mempool.c:711 free_metapage fs/jfs/jfs_metapage.c:280 [inline] metapage_release_folio+0x46c/0x5b0 fs/jfs/jfs_metapage.c:637 shrink_folio_list+0x2270/0x52f0 mm/vmscan.c:1486 evict_folios+0x453a/0x54d0 mm/vmscan.c:4724 try_to_shrink_lruvec+0xb62/0xfa0 mm/vmscan.c:4885 shrink_one+0x25c/0x710 mm/vmscan.c:4930 shrink_many mm/vmscan.c:4993 [inline] lru_gen_shrink_node mm/vmscan.c:5071 [inline] shrink_node+0x31bf/0x3ae0 mm/vmscan.c:6059 kswapd_shrink_node mm/vmscan.c:6913 [inline] balance_pgdat mm/vmscan.c:7089 [inline] kswapd+0x1736/0x2de0 mm/vmscan.c:7362 kthread+0x388/0x470 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 The buggy address belongs to the object at ffff888000e22e88 which belongs to the cache jfs_mp of size 184 The buggy address is located 40 bytes inside of freed 184-byte region [ffff888000e22e88, ffff888000e22f40) The buggy address belongs to the physical page: page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0xe22 flags: 0x7ff00000000000(node=0|zone=0|lastcpupid=0x7ff) page_type: f5(slab) raw: 007ff00000000000 ffff888000bdeb40 dead000000000122 0000000000000000 raw: 0000000000000000 0000000800100010 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 8398347277, free_ts 0 set_page_owner include/linux/page_owner.h:32 [inline] post_alloc_hook+0x231/0x280 mm/page_alloc.c:1850 prep_new_page mm/page_alloc.c:1858 [inline] get_page_from_freelist+0x24ba/0x2540 mm/page_alloc.c:3938 __alloc_frozen_pages_noprof+0x18d/0x380 mm/page_alloc.c:5218 alloc_slab_page mm/slub.c:3278 [inline] allocate_slab+0x77/0x660 mm/slub.c:3467 new_slab mm/slub.c:3525 [inline] refill_objects+0x339/0x3d0 mm/slub.c:7251 refill_sheaf mm/slub.c:2816 [inline] __pcs_replace_empty_main+0x321/0x720 mm/slub.c:4651 alloc_from_pcs mm/slub.c:4749 [inline] slab_alloc_node mm/slub.c:4883 [inline] kmem_cache_alloc_noprof+0x37d/0x650 mm/slub.c:4905 mempool_init_node+0x1ea/0x4d0 mm/mempool.c:259 mempool_create_node_noprof+0xb8/0x150 mm/mempool.c:323 metapage_init+0xed/0x150 fs/jfs/jfs_metapage.c:293 init_jfs_fs+0xfd/0x4e0 fs/jfs/super.c:968 do_one_initcall+0x250/0x870 init/main.c:1392 do_initcall_level+0x104/0x190 init/main.c:1454 do_initcalls+0x59/0xa0 init/main.c:1470 kernel_init_freeable+0x2a6/0x3e0 init/main.c:1703 kernel_init+0x1d/0x1d0 init/main.c:1593 page_owner free stack trace missing Memory state around the buggy address: ffff888000e22d80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff888000e22e00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc >ffff888000e22e80: fc fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff888000e22f00: fb fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc ffff888000e22f80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ==================================================================