BUG: spinlock bad magic on CPU#1, jfsCommit/275 ================================================================== BUG: KASAN: use-after-free in string_nocheck lib/vsprintf.c:642 [inline] BUG: KASAN: use-after-free in string+0x218/0x2b0 lib/vsprintf.c:724 Read of size 1 at addr ffff888072ffa538 by task jfsCommit/275 CPU: 1 PID: 275 Comm: jfsCommit Not tainted 5.15.168-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 09/13/2024 Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0x1e3/0x2d0 lib/dump_stack.c:106 print_address_description+0x63/0x3b0 mm/kasan/report.c:248 __kasan_report mm/kasan/report.c:434 [inline] kasan_report+0x16b/0x1c0 mm/kasan/report.c:451 string_nocheck lib/vsprintf.c:642 [inline] string+0x218/0x2b0 lib/vsprintf.c:724 vsnprintf+0x11a4/0x1c70 lib/vsprintf.c:2811 vprintk_store+0x3ba/0x1300 kernel/printk/printk.c:2164 vprintk_emit+0x83/0x150 kernel/printk/printk.c:2258 _printk+0xd1/0x120 kernel/printk/printk.c:2299 spin_dump kernel/locking/spinlock_debug.c:63 [inline] spin_bug+0x136/0x1d0 kernel/locking/spinlock_debug.c:77 debug_spin_lock_before kernel/locking/spinlock_debug.c:85 [inline] do_raw_spin_lock+0x200/0x370 kernel/locking/spinlock_debug.c:114 __raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:117 [inline] _raw_spin_lock_irqsave+0xdd/0x120 kernel/locking/spinlock.c:162 __wake_up_common_lock kernel/sched/wait.c:137 [inline] __wake_up+0xf5/0x1c0 kernel/sched/wait.c:157 unlock_metapage fs/jfs/jfs_metapage.c:37 [inline] release_metapage+0x155/0xe00 fs/jfs/jfs_metapage.c:737 xtTruncate+0xff9/0x3260 jfs_free_zero_link+0x46a/0x6e0 fs/jfs/namei.c:758 jfs_evict_inode+0x35b/0x440 fs/jfs/inode.c:153 evict+0x529/0x930 fs/inode.c:622 txUpdateMap+0x825/0x9e0 fs/jfs/jfs_txnmgr.c:2401 txLazyCommit fs/jfs/jfs_txnmgr.c:2698 [inline] jfs_lazycommit+0x470/0xc30 fs/jfs/jfs_txnmgr.c:2766 kthread+0x3f6/0x4f0 kernel/kthread.c:334 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:287 Allocated by task 4263: kasan_save_stack mm/kasan/common.c:38 [inline] kasan_set_track mm/kasan/common.c:46 [inline] set_alloc_info mm/kasan/common.c:434 [inline] __kasan_slab_alloc+0x8e/0xc0 mm/kasan/common.c:467 kasan_slab_alloc include/linux/kasan.h:254 [inline] slab_post_alloc_hook+0x53/0x380 mm/slab.h:519 slab_alloc_node mm/slub.c:3220 [inline] slab_alloc mm/slub.c:3228 [inline] kmem_cache_alloc+0xf3/0x280 mm/slub.c:3233 jfs_alloc_inode+0x17/0x50 fs/jfs/super.c:105 alloc_inode fs/inode.c:236 [inline] new_inode_pseudo+0x60/0x210 fs/inode.c:976 new_inode+0x25/0x1d0 fs/inode.c:1005 diReadSpecial+0x4e/0x680 fs/jfs/jfs_imap.c:426 jfs_mount+0x3ab/0x820 fs/jfs/jfs_mount.c:166 jfs_fill_super+0x5ba/0xc70 fs/jfs/super.c:561 mount_bdev+0x2c9/0x3f0 fs/super.c:1400 legacy_get_tree+0xeb/0x180 fs/fs_context.c:611 vfs_get_tree+0x88/0x270 fs/super.c:1530 do_new_mount+0x2ba/0xb40 fs/namespace.c:3012 do_mount fs/namespace.c:3355 [inline] __do_sys_mount fs/namespace.c:3563 [inline] __se_sys_mount+0x2d5/0x3c0 fs/namespace.c:3540 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x3b/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x66/0xd0 Last potentially related work creation: kasan_save_stack+0x36/0x60 mm/kasan/common.c:38 kasan_record_aux_stack+0xba/0x100 mm/kasan/generic.c:348 __call_rcu kernel/rcu/tree.c:3007 [inline] call_rcu+0x1c4/0xa70 kernel/rcu/tree.c:3087 destroy_inode fs/inode.c:291 [inline] evict+0x87d/0x930 fs/inode.c:637 jfs_umount+0x111/0x370 fs/jfs/jfs_umount.c:65 jfs_put_super+0x86/0x180 fs/jfs/super.c:194 generic_shutdown_super+0x130/0x310 fs/super.c:475 kill_block_super+0x7a/0xe0 fs/super.c:1427 deactivate_locked_super+0xa0/0x110 fs/super.c:335 cleanup_mnt+0x44e/0x500 fs/namespace.c:1143 task_work_run+0x129/0x1a0 kernel/task_work.c:188 tracehook_notify_resume include/linux/tracehook.h:189 [inline] exit_to_user_mode_loop+0x106/0x130 kernel/entry/common.c:181 exit_to_user_mode_prepare+0xb1/0x140 kernel/entry/common.c:214 __syscall_exit_to_user_mode_work kernel/entry/common.c:296 [inline] syscall_exit_to_user_mode+0x5d/0x240 kernel/entry/common.c:307 do_syscall_64+0x47/0xb0 arch/x86/entry/common.c:86 entry_SYSCALL_64_after_hwframe+0x66/0xd0 The buggy address belongs to the object at ffff888072ffa500 which belongs to the cache jfs_ip of size 2240 The buggy address is located 56 bytes inside of 2240-byte region [ffff888072ffa500, ffff888072ffadc0) The buggy address belongs to the page: page:ffffea0001cbfe00 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x72ff8 head:ffffea0001cbfe00 order:3 compound_mapcount:0 compound_pincount:0 memcg:ffff888021f22901 flags: 0xfff00000010200(slab|head|node=0|zone=1|lastcpupid=0x7ff) raw: 00fff00000010200 0000000000000000 dead000000000122 ffff88801dde5140 raw: 0000000000000000 00000000800d000d 00000001ffffffff ffff888021f22901 page dumped because: kasan: bad access detected page_owner tracks the page as allocated page last allocated via order 3, migratetype Reclaimable, gfp_mask 0x1d2050(__GFP_IO|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC|__GFP_HARDWALL|__GFP_RECLAIMABLE), pid 4263, ts 121262331232, free_ts 115600037436 prep_new_page mm/page_alloc.c:2426 [inline] get_page_from_freelist+0x322a/0x33c0 mm/page_alloc.c:4159 __alloc_pages+0x272/0x700 mm/page_alloc.c:5423 alloc_slab_page mm/slub.c:1775 [inline] allocate_slab mm/slub.c:1912 [inline] new_slab+0xbb/0x4b0 mm/slub.c:1975 ___slab_alloc+0x6f6/0xe10 mm/slub.c:3008 __slab_alloc mm/slub.c:3095 [inline] slab_alloc_node mm/slub.c:3186 [inline] slab_alloc mm/slub.c:3228 [inline] kmem_cache_alloc+0x18e/0x280 mm/slub.c:3233 jfs_alloc_inode+0x17/0x50 fs/jfs/super.c:105 alloc_inode fs/inode.c:236 [inline] new_inode_pseudo+0x60/0x210 fs/inode.c:976 new_inode+0x25/0x1d0 fs/inode.c:1005 jfs_fill_super+0x404/0xc70 fs/jfs/super.c:549 mount_bdev+0x2c9/0x3f0 fs/super.c:1400 legacy_get_tree+0xeb/0x180 fs/fs_context.c:611 vfs_get_tree+0x88/0x270 fs/super.c:1530 do_new_mount+0x2ba/0xb40 fs/namespace.c:3012 do_mount fs/namespace.c:3355 [inline] __do_sys_mount fs/namespace.c:3563 [inline] __se_sys_mount+0x2d5/0x3c0 fs/namespace.c:3540 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x3b/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x66/0xd0 page last free stack trace: reset_page_owner include/linux/page_owner.h:24 [inline] free_pages_prepare mm/page_alloc.c:1340 [inline] free_pcp_prepare mm/page_alloc.c:1391 [inline] free_unref_page_prepare+0xc34/0xcf0 mm/page_alloc.c:3317 free_unref_page+0x95/0x2d0 mm/page_alloc.c:3396 do_slab_free mm/slub.c:3487 [inline] ___cache_free+0xe3/0x100 mm/slub.c:3506 qlist_free_all+0x36/0x90 mm/kasan/quarantine.c:176 kasan_quarantine_reduce+0x162/0x180 mm/kasan/quarantine.c:283 __kasan_slab_alloc+0x2f/0xc0 mm/kasan/common.c:444 kasan_slab_alloc include/linux/kasan.h:254 [inline] slab_post_alloc_hook+0x53/0x380 mm/slab.h:519 slab_alloc_node mm/slub.c:3220 [inline] slab_alloc mm/slub.c:3228 [inline] __kmalloc+0x120/0x300 mm/slub.c:4403 kmalloc include/linux/slab.h:596 [inline] allocate_probes kernel/tracepoint.c:109 [inline] func_remove kernel/tracepoint.c:267 [inline] tracepoint_remove_func kernel/tracepoint.c:403 [inline] tracepoint_probe_unregister+0x259/0x980 kernel/tracepoint.c:551 bpf_raw_tp_link_release+0x5f/0x80 kernel/bpf/syscall.c:2900 bpf_link_free kernel/bpf/syscall.c:2471 [inline] bpf_link_put+0x234/0x2c0 kernel/bpf/syscall.c:2497 bpf_link_release+0x37/0x40 kernel/bpf/syscall.c:2505 __fput+0x3fe/0x8e0 fs/file_table.c:280 task_work_run+0x129/0x1a0 kernel/task_work.c:188 tracehook_notify_resume include/linux/tracehook.h:189 [inline] exit_to_user_mode_loop+0x106/0x130 kernel/entry/common.c:181 exit_to_user_mode_prepare+0xb1/0x140 kernel/entry/common.c:214 Memory state around the buggy address: ffff888072ffa400: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ffff888072ffa480: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc >ffff888072ffa500: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff888072ffa580: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff888072ffa600: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ==================================================================