BUG: spinlock bad magic on CPU#0, jfsCommit/93
==================================================================
BUG: KASAN: slab-out-of-bounds in string_nocheck lib/vsprintf.c:643 [inline]
BUG: KASAN: slab-out-of-bounds in string+0x204/0x280 lib/vsprintf.c:725
Read of size 1 at addr ffff0000f4e59260 by task jfsCommit/93

CPU: 0 PID: 93 Comm: jfsCommit Not tainted 6.1.137-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 02/12/2025
Call trace:
 dump_backtrace+0x1c8/0x1f4 arch/arm64/kernel/stacktrace.c:158
 show_stack+0x2c/0x3c arch/arm64/kernel/stacktrace.c:165
 __dump_stack+0x30/0x40 lib/dump_stack.c:88
 dump_stack_lvl+0xf8/0x160 lib/dump_stack.c:106
 print_address_description+0x88/0x220 mm/kasan/report.c:316
 print_report+0x50/0x68 mm/kasan/report.c:427
 kasan_report+0xa8/0x100 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+0x204/0x280 lib/vsprintf.c:725
 vsnprintf+0x10b0/0x1890 lib/vsprintf.c:2805
 vprintk_store+0x350/0xac8 kernel/printk/printk.c:2187
 vprintk_emit+0x10c/0x2dc kernel/printk/printk.c:2284
 vprintk_default+0x54/0x80 kernel/printk/printk.c:2318
 vprintk+0x1e8/0x284 kernel/printk/printk_safe.c:45
 _printk+0xd0/0x118 kernel/printk/printk.c:2328
 spin_dump+0x10c/0x208 kernel/locking/spinlock_debug.c:63
 spin_bug kernel/locking/spinlock_debug.c:77 [inline]
 debug_spin_lock_before kernel/locking/spinlock_debug.c:85 [inline]
 do_raw_spin_lock+0x1dc/0x2ec 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+0xe4/0x174 kernel/sched/wait.c:160
 unlock_metapage fs/jfs/jfs_metapage.c:38 [inline]
 release_metapage+0x19c/0xc90 fs/jfs/jfs_metapage.c:736
 xtTruncate+0xb60/0x25c4 fs/jfs/jfs_xtree.c:-1
 jfs_free_zero_link+0x2a4/0x410 fs/jfs/namei.c:758
 jfs_evict_inode+0x2f4/0x3e8 fs/jfs/inode.c:153
 evict+0x3c8/0x810 fs/inode.c:705
 iput_final fs/inode.c:1834 [inline]
 iput+0x764/0x7f4 fs/inode.c:1860
 txUpdateMap+0x67c/0x79c fs/jfs/jfs_txnmgr.c:2367
 txLazyCommit fs/jfs/jfs_txnmgr.c:2664 [inline]
 jfs_lazycommit+0x378/0x918 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 4296:
 kasan_save_stack mm/kasan/common.c:45 [inline]
 kasan_set_track+0x4c/0x80 mm/kasan/common.c:52
 kasan_save_alloc_info+0x28/0x34 mm/kasan/generic.c:505
 __kasan_slab_alloc+0x70/0x88 mm/kasan/common.c:328
 kasan_slab_alloc include/linux/kasan.h:201 [inline]
 slab_post_alloc_hook+0x74/0x43c 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+0x1b0/0x298 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+0x178/0x7c4 fs/inode.c:1373
 jfs_iget+0x30/0x374 fs/jfs/inode.c:29
 jfs_lookup+0x198/0x32c fs/jfs/namei.c:1467
 __lookup_slow+0x24c/0x370 fs/namei.c:1690
 lookup_slow+0x5c/0x80 fs/namei.c:1707
 walk_component+0x270/0x364 fs/namei.c:1998
 lookup_last fs/namei.c:2455 [inline]
 path_lookupat+0x13c/0x3d0 fs/namei.c:2479
 filename_lookup+0x190/0x42c 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:1823 [inline]
 __do_sys_umount fs/namespace.c:1831 [inline]
 __se_sys_umount fs/namespace.c:1829 [inline]
 __arm64_sys_umount+0xf4/0x178 fs/namespace.c:1829
 __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/0x138 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 ffff0000f4e58940
 which belongs to the cache jfs_ip of size 2240
The buggy address is located 96 bytes to the right of
 2240-byte region [ffff0000f4e58940, ffff0000f4e59200)

The buggy address belongs to the physical page:
page:00000000ca68ec15 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x134e58
head:00000000ca68ec15 order:3 compound_mapcount:0 compound_pincount:0
memcg:ffff0000f250d701
flags: 0x5ffc00000010200(slab|head|node=0|zone=2|lastcpupid=0x7ff)
raw: 05ffc00000010200 0000000000000000 dead000000000122 ffff0000c6ed5e00
raw: 0000000000000000 00000000800d000d 00000001ffffffff ffff0000f250d701
page dumped because: kasan: bad access detected

Memory state around the buggy address:
 ffff0000f4e59100: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
 ffff0000f4e59180: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
>ffff0000f4e59200: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
                                                       ^
 ffff0000f4e59280: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
 ffff0000f4e59300: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
==================================================================
 lock: 0xffff0000f4e589e8, .magic: ffff8000, .owner: /0, .owner_cpu: 512
CPU: 0 PID: 93 Comm: jfsCommit Tainted: G    B              6.1.137-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 02/12/2025
Call trace:
 dump_backtrace+0x1c8/0x1f4 arch/arm64/kernel/stacktrace.c:158
 show_stack+0x2c/0x3c arch/arm64/kernel/stacktrace.c:165
 __dump_stack+0x30/0x40 lib/dump_stack.c:88
 dump_stack_lvl+0xf8/0x160 lib/dump_stack.c:106
 dump_stack+0x1c/0x5c lib/dump_stack.c:113
 spin_dump+0x110/0x208 kernel/locking/spinlock_debug.c:69
 spin_bug kernel/locking/spinlock_debug.c:77 [inline]
 debug_spin_lock_before kernel/locking/spinlock_debug.c:85 [inline]
 do_raw_spin_lock+0x1dc/0x2ec 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+0xe4/0x174 kernel/sched/wait.c:160
 unlock_metapage fs/jfs/jfs_metapage.c:38 [inline]
 release_metapage+0x19c/0xc90 fs/jfs/jfs_metapage.c:736
 xtTruncate+0xb60/0x25c4 fs/jfs/jfs_xtree.c:-1
 jfs_free_zero_link+0x2a4/0x410 fs/jfs/namei.c:758
 jfs_evict_inode+0x2f4/0x3e8 fs/jfs/inode.c:153
 evict+0x3c8/0x810 fs/inode.c:705
 iput_final fs/inode.c:1834 [inline]
 iput+0x764/0x7f4 fs/inode.c:1860
 txUpdateMap+0x67c/0x79c fs/jfs/jfs_txnmgr.c:2367
 txLazyCommit fs/jfs/jfs_txnmgr.c:2664 [inline]
 jfs_lazycommit+0x378/0x918 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 1142 is out of range for type 'unsigned long[8]'
CPU: 0 PID: 93 Comm: jfsCommit Tainted: G    B              6.1.137-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 02/12/2025
Call trace:
 dump_backtrace+0x1c8/0x1f4 arch/arm64/kernel/stacktrace.c:158
 show_stack+0x2c/0x3c arch/arm64/kernel/stacktrace.c:165
 __dump_stack+0x30/0x40 lib/dump_stack.c:88
 dump_stack_lvl+0xf8/0x160 lib/dump_stack.c:106
 dump_stack+0x1c/0x5c lib/dump_stack.c:113
 ubsan_epilogue+0x14/0x48 lib/ubsan.c:151
 __ubsan_handle_out_of_bounds+0xd0/0xfc lib/ubsan.c:282
 decode_tail kernel/locking/qspinlock.c:131 [inline]
 queued_spin_lock_slowpath+0xab0/0xc08 kernel/locking/qspinlock.c:471
 queued_spin_lock include/asm-generic/qspinlock.h:114 [inline]
 do_raw_spin_lock+0x2e8/0x2ec 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+0xe4/0x174 kernel/sched/wait.c:160
 unlock_metapage fs/jfs/jfs_metapage.c:38 [inline]
 release_metapage+0x19c/0xc90 fs/jfs/jfs_metapage.c:736
 xtTruncate+0xb60/0x25c4 fs/jfs/jfs_xtree.c:-1
 jfs_free_zero_link+0x2a4/0x410 fs/jfs/namei.c:758
 jfs_evict_inode+0x2f4/0x3e8 fs/jfs/inode.c:153
 evict+0x3c8/0x810 fs/inode.c:705
 iput_final fs/inode.c:1834 [inline]
 iput+0x764/0x7f4 fs/inode.c:1860
 txUpdateMap+0x67c/0x79c fs/jfs/jfs_txnmgr.c:2367
 txLazyCommit fs/jfs/jfs_txnmgr.c:2664 [inline]
 jfs_lazycommit+0x378/0x918 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 ffff800014fd9f20
KASAN: probably user-memory-access in range [0x00000000a7ecf900-0x00000000a7ecf907]
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=00000001ac619000
[ffff800014fd9f20] pgd=100000023ffff003, p4d=100000023ffff003, pud=100000023fffe003, pmd=100000023fffa003, pte=0000000000000000
Internal error: Oops: 0000000096000047 [#1] PREEMPT SMP
Modules linked in:
CPU: 0 PID: 93 Comm: jfsCommit Tainted: G    B              6.1.137-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 02/12/2025
pstate: 804000c5 (Nzcv daIF +PAN -UAO -TCO -DIT -SSBS BTYPE=--)
pc : queued_spin_lock_slowpath+0x914/0xc08 kernel/locking/qspinlock.c:474
lr : decode_tail kernel/locking/qspinlock.c:131 [inline]
lr : queued_spin_lock_slowpath+0xab0/0xc08 kernel/locking/qspinlock.c:471
sp : ffff80001dfc7320
x29: ffff80001dfc73c0 x28: ffff800014fd9f20 x27: ffff800014fd9f20
x26: 1fffe0001e9cb13d x25: 1fffe000367c53e0 x24: dfff800000000000
x23: ffff700003bf8e68 x22: ffff0001b3e29f08 x21: 0000000000040000
x20: ffff0001b3e29f00 x19: ffff0000f4e589e8 x18: ffff800011a7bd00
x17: 3d3d3d3d3d3d3d3d x16: ffff800008190a04 x15: 0000000000000000
x14: 00000000ffffffff x13: 0000000000000001 x12: 0000000000ff0100
x11: ff00800008190a88 x10: ffff800014fd9f00 x9 : 0000000000000002
x8 : 0000000000000000 x7 : 0000000000000001 x6 : 0000000000000001
x5 : ffff80001dfc6d78 x4 : ffff800015154740 x3 : ffff800008190a50
x2 : 0000000000000001 x1 : 0000000000000004 x0 : ffff0001b3e29f08
Call trace:
 queued_spin_lock_slowpath+0x914/0xc08 kernel/locking/qspinlock.c:477
 queued_spin_lock include/asm-generic/qspinlock.h:114 [inline]
 do_raw_spin_lock+0x2e8/0x2ec 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+0xe4/0x174 kernel/sched/wait.c:160
 unlock_metapage fs/jfs/jfs_metapage.c:38 [inline]
 release_metapage+0x19c/0xc90 fs/jfs/jfs_metapage.c:736
 xtTruncate+0xb60/0x25c4 fs/jfs/jfs_xtree.c:-1
 jfs_free_zero_link+0x2a4/0x410 fs/jfs/namei.c:758
 jfs_evict_inode+0x2f4/0x3e8 fs/jfs/inode.c:153
 evict+0x3c8/0x810 fs/inode.c:705
 iput_final fs/inode.c:1834 [inline]
 iput+0x764/0x7f4 fs/inode.c:1860
 txUpdateMap+0x67c/0x79c fs/jfs/jfs_txnmgr.c:2367
 txLazyCommit fs/jfs/jfs_txnmgr.c:2664 [inline]
 jfs_lazycommit+0x378/0x918 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: aa1b03e0 9797cf1a aa1603e0 52800081 (f9000374) 
---[ end trace 0000000000000000 ]---
----------------
Code disassembly (best guess):
   0:	aa1b03e0 	mov	x0, x27
   4:	9797cf1a 	bl	0xfffffffffe5f3c6c
   8:	aa1603e0 	mov	x0, x22
   c:	52800081 	mov	w1, #0x4                   	// #4
* 10:	f9000374 	str	x20, [x27] <-- trapping instruction