BUG: spinlock bad magic on CPU#0, jfsCommit/92 ================================================================== BUG: KASAN: slab-out-of-bounds in string_nocheck lib/vsprintf.c:643 [inline] BUG: KASAN: slab-out-of-bounds in string+0x1dc/0x264 lib/vsprintf.c:725 Read of size 1 at addr ffff0000f46d1ba0 by task jfsCommit/92 CPU: 0 PID: 92 Comm: jfsCommit Not tainted 6.1.126-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 09/13/2024 Call trace: dump_backtrace+0x1c8/0x1f4 arch/arm64/kernel/stacktrace.c:158 show_stack+0x2c/0x3c arch/arm64/kernel/stacktrace.c:165 __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0x108/0x170 lib/dump_stack.c:106 print_address_description mm/kasan/report.c:316 [inline] print_report+0x174/0x4c0 mm/kasan/report.c:427 kasan_report+0xd4/0x130 mm/kasan/report.c:531 __asan_report_load1_noabort+0x2c/0x38 mm/kasan/report_generic.c:348 string_nocheck lib/vsprintf.c:643 [inline] string+0x1dc/0x264 lib/vsprintf.c:725 vsnprintf+0xe9c/0x1a8c lib/vsprintf.c:2805 vprintk_store+0x3c4/0xdc8 kernel/printk/printk.c:2187 vprintk_emit+0x110/0x2e8 kernel/printk/printk.c:2284 vprintk_default+0xa0/0xe4 kernel/printk/printk.c:2318 vprintk+0x200/0x2d4 kernel/printk/printk_safe.c:45 _printk+0xdc/0x128 kernel/printk/printk.c:2328 spin_dump kernel/locking/spinlock_debug.c:63 [inline] spin_bug+0x120/0x240 kernel/locking/spinlock_debug.c:77 debug_spin_lock_before kernel/locking/spinlock_debug.c:85 [inline] do_raw_spin_lock+0x1fc/0x358 kernel/locking/spinlock_debug.c:114 __raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:111 [inline] _raw_spin_lock_irqsave+0x74/0xb4 kernel/locking/spinlock.c:162 __wake_up_common_lock kernel/sched/wait.c:137 [inline] __wake_up+0xec/0x1a8 kernel/sched/wait.c:160 unlock_metapage fs/jfs/jfs_metapage.c:38 [inline] release_metapage+0x19c/0xc84 fs/jfs/jfs_metapage.c:736 xtTruncate+0xc78/0x2a08 jfs_free_zero_link+0x374/0x598 fs/jfs/namei.c:758 jfs_evict_inode+0x300/0x3f4 fs/jfs/inode.c:153 evict+0x418/0x894 fs/inode.c:705 iput_final fs/inode.c:1834 [inline] iput+0x7c0/0x8a4 fs/inode.c:1860 txUpdateMap+0x73c/0x8e4 fs/jfs/jfs_txnmgr.c:2367 txLazyCommit fs/jfs/jfs_txnmgr.c:2664 [inline] jfs_lazycommit+0x3a0/0x988 fs/jfs/jfs_txnmgr.c:2732 kthread+0x250/0x2d8 kernel/kthread.c:376 ret_from_fork+0x10/0x20 arch/arm64/kernel/entry.S:864 Allocated by task 4297: kasan_save_stack mm/kasan/common.c:45 [inline] kasan_set_track+0x4c/0x80 mm/kasan/common.c:52 kasan_save_alloc_info+0x24/0x30 mm/kasan/generic.c:505 __kasan_slab_alloc+0x74/0x8c mm/kasan/common.c:328 kasan_slab_alloc include/linux/kasan.h:201 [inline] slab_post_alloc_hook+0x74/0x458 mm/slab.h:737 slab_alloc_node mm/slub.c:3398 [inline] slab_alloc mm/slub.c:3406 [inline] __kmem_cache_alloc_lru mm/slub.c:3413 [inline] kmem_cache_alloc_lru+0x1ac/0x2f8 mm/slub.c:3429 alloc_inode_sb include/linux/fs.h:3245 [inline] jfs_alloc_inode+0x2c/0x68 fs/jfs/super.c:105 alloc_inode fs/inode.c:261 [inline] iget_locked+0x170/0x708 fs/inode.c:1373 jfs_iget+0x30/0x364 fs/jfs/inode.c:29 jfs_lookup+0x1e8/0x39c fs/jfs/namei.c:1467 __lookup_slow+0x250/0x374 fs/namei.c:1690 lookup_slow+0x60/0x84 fs/namei.c:1707 walk_component+0x280/0x36c fs/namei.c:1998 lookup_last fs/namei.c:2455 [inline] path_lookupat+0x13c/0x3d0 fs/namei.c:2479 filename_lookup+0x1d4/0x4e0 fs/namei.c:2508 user_path_at_empty+0x5c/0x84 fs/namei.c:2905 user_path_at include/linux/namei.h:57 [inline] ksys_umount fs/namespace.c:1822 [inline] __do_sys_umount fs/namespace.c:1830 [inline] __se_sys_umount fs/namespace.c:1828 [inline] __arm64_sys_umount+0xf8/0x17c fs/namespace.c:1828 __invoke_syscall arch/arm64/kernel/syscall.c:38 [inline] invoke_syscall+0x98/0x2bc arch/arm64/kernel/syscall.c:52 el0_svc_common+0x138/0x258 arch/arm64/kernel/syscall.c:140 do_el0_svc+0x58/0x13c arch/arm64/kernel/syscall.c:204 el0_svc+0x58/0x168 arch/arm64/kernel/entry-common.c:637 el0t_64_sync_handler+0x84/0xf0 arch/arm64/kernel/entry-common.c:655 el0t_64_sync+0x18c/0x190 arch/arm64/kernel/entry.S:585 The buggy address belongs to the object at ffff0000f46d1280 which belongs to the cache jfs_ip of size 2240 The buggy address is located 96 bytes to the right of 2240-byte region [ffff0000f46d1280, ffff0000f46d1b40) The buggy address belongs to the physical page: page:00000000a867ab9a refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x1346d0 head:00000000a867ab9a order:3 compound_mapcount:0 compound_pincount:0 memcg:ffff0000f26e1c01 flags: 0x5ffc00000010200(slab|head|node=0|zone=2|lastcpupid=0x7ff) raw: 05ffc00000010200 0000000000000000 dead000000000122 ffff0000c6f23e00 raw: 0000000000000000 00000000800d000d 00000001ffffffff ffff0000f26e1c01 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff0000f46d1a80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ffff0000f46d1b00: 00 00 00 00 00 00 00 00 fc fc fc fc fc fc fc fc >ffff0000f46d1b80: fc fc fc fc fc fc fc fc 00 00 00 00 00 00 00 00 ^ ffff0000f46d1c00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ffff0000f46d1c80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ================================================================== lock: 0xffff0000f46d1328, .magic: ffff8000, .owner: /0, .owner_cpu: 512 CPU: 0 PID: 92 Comm: jfsCommit Tainted: G B 6.1.126-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 09/13/2024 Call trace: dump_backtrace+0x1c8/0x1f4 arch/arm64/kernel/stacktrace.c:158 show_stack+0x2c/0x3c arch/arm64/kernel/stacktrace.c:165 __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0x108/0x170 lib/dump_stack.c:106 dump_stack+0x1c/0x5c lib/dump_stack.c:113 spin_dump kernel/locking/spinlock_debug.c:69 [inline] spin_bug+0x124/0x240 kernel/locking/spinlock_debug.c:77 debug_spin_lock_before kernel/locking/spinlock_debug.c:85 [inline] do_raw_spin_lock+0x1fc/0x358 kernel/locking/spinlock_debug.c:114 __raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:111 [inline] _raw_spin_lock_irqsave+0x74/0xb4 kernel/locking/spinlock.c:162 __wake_up_common_lock kernel/sched/wait.c:137 [inline] __wake_up+0xec/0x1a8 kernel/sched/wait.c:160 unlock_metapage fs/jfs/jfs_metapage.c:38 [inline] release_metapage+0x19c/0xc84 fs/jfs/jfs_metapage.c:736 xtTruncate+0xc78/0x2a08 jfs_free_zero_link+0x374/0x598 fs/jfs/namei.c:758 jfs_evict_inode+0x300/0x3f4 fs/jfs/inode.c:153 evict+0x418/0x894 fs/inode.c:705 iput_final fs/inode.c:1834 [inline] iput+0x7c0/0x8a4 fs/inode.c:1860 txUpdateMap+0x73c/0x8e4 fs/jfs/jfs_txnmgr.c:2367 txLazyCommit fs/jfs/jfs_txnmgr.c:2664 [inline] jfs_lazycommit+0x3a0/0x988 fs/jfs/jfs_txnmgr.c:2732 kthread+0x250/0x2d8 kernel/kthread.c:376 ret_from_fork+0x10/0x20 arch/arm64/kernel/entry.S:864 ================================================================================ UBSAN: array-index-out-of-bounds in kernel/locking/qspinlock.c:131:9 index 1182 is out of range for type 'unsigned long[8]' CPU: 0 PID: 92 Comm: jfsCommit Tainted: G B 6.1.126-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 09/13/2024 Call trace: dump_backtrace+0x1c8/0x1f4 arch/arm64/kernel/stacktrace.c:158 show_stack+0x2c/0x3c arch/arm64/kernel/stacktrace.c:165 __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0x108/0x170 lib/dump_stack.c:106 dump_stack+0x1c/0x5c lib/dump_stack.c:113 ubsan_epilogue lib/ubsan.c:151 [inline] __ubsan_handle_out_of_bounds+0xfc/0x148 lib/ubsan.c:282 decode_tail kernel/locking/qspinlock.c:131 [inline] queued_spin_lock_slowpath+0x9fc/0xe48 kernel/locking/qspinlock.c:471 queued_spin_lock include/asm-generic/qspinlock.h:114 [inline] do_raw_spin_lock+0x330/0x358 kernel/locking/spinlock_debug.c:115 __raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:111 [inline] _raw_spin_lock_irqsave+0x74/0xb4 kernel/locking/spinlock.c:162 __wake_up_common_lock kernel/sched/wait.c:137 [inline] __wake_up+0xec/0x1a8 kernel/sched/wait.c:160 unlock_metapage fs/jfs/jfs_metapage.c:38 [inline] release_metapage+0x19c/0xc84 fs/jfs/jfs_metapage.c:736 xtTruncate+0xc78/0x2a08 jfs_free_zero_link+0x374/0x598 fs/jfs/namei.c:758 jfs_evict_inode+0x300/0x3f4 fs/jfs/inode.c:153 evict+0x418/0x894 fs/inode.c:705 iput_final fs/inode.c:1834 [inline] iput+0x7c0/0x8a4 fs/inode.c:1860 txUpdateMap+0x73c/0x8e4 fs/jfs/jfs_txnmgr.c:2367 txLazyCommit fs/jfs/jfs_txnmgr.c:2664 [inline] jfs_lazycommit+0x3a0/0x988 fs/jfs/jfs_txnmgr.c:2732 kthread+0x250/0x2d8 kernel/kthread.c:376 ret_from_fork+0x10/0x20 arch/arm64/kernel/entry.S:864 ================================================================================ Unable to handle kernel paging request at virtual address ffff8000159f7f70 KASAN: probably user-memory-access in range [0x00000000acfbfb80-0x00000000acfbfb87] Mem abort info: ESR = 0x0000000096000047 EC = 0x25: DABT (current EL), IL = 32 bits SET = 0, FnV = 0 EA = 0, S1PTW = 0 FSC = 0x07: level 3 translation fault Data abort info: ISV = 0, ISS = 0x00000047 CM = 0, WnR = 1 swapper pgtable: 4k pages, 48-bit VAs, pgdp=00000001ab226000 [ffff8000159f7f70] pgd=100000023ffff003, p4d=100000023ffff003, pud=100000023fffe003, pmd=100000023fffa003, pte=0000000000000000 Internal error: Oops: 0000000096000047 [#1] PREEMPT SMP Modules linked in: CPU: 0 PID: 92 Comm: jfsCommit Tainted: G B 6.1.126-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 09/13/2024 pstate: 804000c5 (Nzcv daIF +PAN -UAO -TCO -DIT -SSBS BTYPE=--) pc : queued_spin_lock_slowpath+0x3f4/0xe48 kernel/locking/qspinlock.c:474 lr : decode_tail kernel/locking/qspinlock.c:131 [inline] lr : queued_spin_lock_slowpath+0x9fc/0xe48 kernel/locking/qspinlock.c:471 sp : ffff80001ddd7200 x29: ffff80001ddd72a0 x28: 000000000000127f x27: 1ffff00003bbae4c x26: dfff800000000000 x25: 1fffe0001e8da265 x24: 0000000000040000 x23: ffff0001b3cf3f48 x22: ffff8000159f7f70 x21: ffff0001b3cf3f40 x20: 1fffe0003679e7e8 x19: ffff0000f46d1328 x18: ffff80001ddd7720 x17: 3d3d3d3d3d3d3d3d x16: ffff80001227e340 x15: 0000000000000000 x14: 00000000ffffffff x13: 0000000000000001 x12: ffff7000030c5eb0 x11: 0000000000ff0100 x10: ffff8000159f7f40 x9 : 0000000000000003 x8 : 0000000000000000 x7 : 0000000000000001 x6 : 0000000000000001 x5 : ffff80001ddd6ab8 x4 : ffff800015b731c0 x3 : ffff8000081a927c x2 : 0000000000000001 x1 : 0000000000000004 x0 : ffff0001b3cf3f48 Call trace: queued_spin_lock_slowpath+0x3f4/0xe48 kernel/locking/qspinlock.c:477 queued_spin_lock include/asm-generic/qspinlock.h:114 [inline] do_raw_spin_lock+0x330/0x358 kernel/locking/spinlock_debug.c:115 __raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:111 [inline] _raw_spin_lock_irqsave+0x74/0xb4 kernel/locking/spinlock.c:162 __wake_up_common_lock kernel/sched/wait.c:137 [inline] __wake_up+0xec/0x1a8 kernel/sched/wait.c:160 unlock_metapage fs/jfs/jfs_metapage.c:38 [inline] release_metapage+0x19c/0xc84 fs/jfs/jfs_metapage.c:736 xtTruncate+0xc78/0x2a08 jfs_free_zero_link+0x374/0x598 fs/jfs/namei.c:758 jfs_evict_inode+0x300/0x3f4 fs/jfs/inode.c:153 evict+0x418/0x894 fs/inode.c:705 iput_final fs/inode.c:1834 [inline] iput+0x7c0/0x8a4 fs/inode.c:1860 txUpdateMap+0x73c/0x8e4 fs/jfs/jfs_txnmgr.c:2367 txLazyCommit fs/jfs/jfs_txnmgr.c:2664 [inline] jfs_lazycommit+0x3a0/0x988 fs/jfs/jfs_txnmgr.c:2732 kthread+0x250/0x2d8 kernel/kthread.c:376 ret_from_fork+0x10/0x20 arch/arm64/kernel/entry.S:864 Code: aa1603e0 976c3e87 aa1703e0 52800081 (f90002d5) ---[ end trace 0000000000000000 ]--- ---------------- Code disassembly (best guess): 0: aa1603e0 mov x0, x22 4: 976c3e87 bl 0xfffffffffdb0fa20 8: aa1703e0 mov x0, x23 c: 52800081 mov w1, #0x4 // #4 * 10: f90002d5 str x21, [x22] <-- trapping instruction