BUG: spinlock bad magic on CPU#0, jfsCommit/98 ================================================================== BUG: KASAN: slab-out-of-bounds in string_nocheck lib/vsprintf.c:646 [inline] BUG: KASAN: slab-out-of-bounds in string+0x1dc/0x264 lib/vsprintf.c:728 Read of size 1 at addr ffff0000dee752e8 by task jfsCommit/98 CPU: 0 UID: 0 PID: 98 Comm: jfsCommit Not tainted 6.12.0-rc5-syzkaller-g5283dc78f4da #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 09/13/2024 Call trace: show_stack+0x2c/0x3c arch/arm64/kernel/stacktrace.c:484 (C) __dump_stack lib/dump_stack.c:94 [inline] dump_stack_lvl+0xe4/0x150 lib/dump_stack.c:120 print_address_description mm/kasan/report.c:377 [inline] print_report+0x198/0x538 mm/kasan/report.c:488 kasan_report+0xd8/0x138 mm/kasan/report.c:601 __asan_report_load1_noabort+0x20/0x2c mm/kasan/report_generic.c:378 string_nocheck lib/vsprintf.c:646 [inline] string+0x1dc/0x264 lib/vsprintf.c:728 vsnprintf+0xe9c/0x1a8c lib/vsprintf.c:2803 vprintk_store+0x38c/0xd80 kernel/printk/printk.c:2260 vprintk_emit+0x258/0x55c kernel/printk/printk.c:2383 vprintk_default+0xa0/0xe4 kernel/printk/printk.c:2422 vprintk+0x200/0x300 kernel/printk/printk_safe.c:68 _printk+0xdc/0x128 kernel/printk/printk.c:2432 spin_dump kernel/locking/spinlock_debug.c:64 [inline] spin_bug+0x114/0x1e8 kernel/locking/spinlock_debug.c:78 debug_spin_lock_before kernel/locking/spinlock_debug.c:86 [inline] do_raw_spin_lock+0x1d8/0x334 kernel/locking/spinlock_debug.c:115 __raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:111 [inline] _raw_spin_lock_irqsave+0x64/0x7c kernel/locking/spinlock.c:162 __wake_up_common_lock kernel/sched/wait.c:105 [inline] __wake_up+0x38/0x1b0 kernel/sched/wait.c:127 unlock_metapage fs/jfs/jfs_metapage.c:39 [inline] release_metapage+0x164/0xa38 fs/jfs/jfs_metapage.c:763 xtTruncate+0xc78/0x2a08 jfs_free_zero_link+0x374/0x598 fs/jfs/namei.c:759 jfs_evict_inode+0x300/0x3f4 fs/jfs/inode.c:153 evict+0x444/0x978 fs/inode.c:725 iput_final fs/inode.c:1877 [inline] iput+0x744/0x8ec fs/inode.c:1903 txUpdateMap+0x85c/0xa18 fs/jfs/jfs_txnmgr.c:2367 txLazyCommit fs/jfs/jfs_txnmgr.c:2664 [inline] jfs_lazycommit+0x3bc/0x9a8 fs/jfs/jfs_txnmgr.c:2733 kthread+0x288/0x310 kernel/kthread.c:389 ret_from_fork+0x10/0x20 arch/arm64/kernel/entry.S:862 Allocated by task 6429: kasan_save_stack mm/kasan/common.c:47 [inline] kasan_save_track+0x40/0x78 mm/kasan/common.c:68 kasan_save_alloc_info+0x40/0x50 mm/kasan/generic.c:565 unpoison_slab_object mm/kasan/common.c:319 [inline] __kasan_slab_alloc+0x74/0x8c mm/kasan/common.c:345 kasan_slab_alloc include/linux/kasan.h:247 [inline] slab_post_alloc_hook mm/slub.c:4085 [inline] slab_alloc_node mm/slub.c:4134 [inline] kmem_cache_alloc_lru_noprof+0x1c4/0x358 mm/slub.c:4153 jfs_alloc_inode+0x2c/0x68 fs/jfs/super.c:105 alloc_inode+0x68/0x19c fs/inode.c:265 iget_locked+0x184/0x814 fs/inode.c:1418 jfs_iget+0x30/0x378 fs/jfs/inode.c:29 jfs_lookup+0x1e8/0x39c fs/jfs/namei.c:1469 __lookup_slow+0x250/0x374 fs/namei.c:1732 lookup_slow+0x60/0x84 fs/namei.c:1749 walk_component+0x280/0x36c fs/namei.c:2053 lookup_last fs/namei.c:2556 [inline] path_lookupat+0x13c/0x3d0 fs/namei.c:2580 filename_lookup+0x1d4/0x4e0 fs/namei.c:2609 user_path_at+0x50/0x74 fs/namei.c:3016 ksys_umount fs/namespace.c:2033 [inline] __do_sys_umount fs/namespace.c:2041 [inline] __se_sys_umount fs/namespace.c:2039 [inline] __arm64_sys_umount+0xf4/0x178 fs/namespace.c:2039 __invoke_syscall arch/arm64/kernel/syscall.c:35 [inline] invoke_syscall+0x98/0x2b8 arch/arm64/kernel/syscall.c:49 el0_svc_common+0x130/0x23c arch/arm64/kernel/syscall.c:132 do_el0_svc+0x48/0x58 arch/arm64/kernel/syscall.c:151 el0_svc+0x54/0x168 arch/arm64/kernel/entry-common.c:744 el0t_64_sync_handler+0x84/0x108 arch/arm64/kernel/entry-common.c:762 el0t_64_sync+0x198/0x19c arch/arm64/kernel/entry.S:600 The buggy address belongs to the object at ffff0000dee749c0 which belongs to the cache jfs_ip of size 2232 The buggy address is located 112 bytes to the right of allocated 2232-byte region [ffff0000dee749c0, ffff0000dee75278) The buggy address belongs to the physical page: page: refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x11ee70 head: order:3 mapcount:0 entire_mapcount:0 nr_pages_mapped:0 pincount:0 memcg:ffff0000eb380e01 flags: 0x5ffc00000000040(head|node=0|zone=2|lastcpupid=0x7ff) page_type: f5(slab) raw: 05ffc00000000040 ffff0000c49d53c0 dead000000000122 0000000000000000 raw: 0000000000000000 00000000800d000d 00000001f5000000 ffff0000eb380e01 head: 05ffc00000000040 ffff0000c49d53c0 dead000000000122 0000000000000000 head: 0000000000000000 00000000800d000d 00000001f5000000 ffff0000eb380e01 head: 05ffc00000000003 fffffdffc37b9c01 ffffffffffffffff 0000000000000000 head: 0000000f00000008 0000000000000000 00000000ffffffff 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff0000dee75180: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ffff0000dee75200: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 fc >ffff0000dee75280: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc 00 ^ ffff0000dee75300: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ffff0000dee75380: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ================================================================== lock: 0xffff0000dee74a68, .magic: ffff8000, .owner: /-1952905920, .owner_cpu: 512 CPU: 0 UID: 0 PID: 98 Comm: jfsCommit Tainted: G B 6.12.0-rc5-syzkaller-g5283dc78f4da #0 Tainted: [B]=BAD_PAGE Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 09/13/2024 Call trace: show_stack+0x2c/0x3c arch/arm64/kernel/stacktrace.c:484 (C) __dump_stack lib/dump_stack.c:94 [inline] dump_stack_lvl+0xe4/0x150 lib/dump_stack.c:120 dump_stack+0x1c/0x28 lib/dump_stack.c:129 spin_dump kernel/locking/spinlock_debug.c:70 [inline] spin_bug+0x118/0x1e8 kernel/locking/spinlock_debug.c:78 debug_spin_lock_before kernel/locking/spinlock_debug.c:86 [inline] do_raw_spin_lock+0x1d8/0x334 kernel/locking/spinlock_debug.c:115 __raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:111 [inline] _raw_spin_lock_irqsave+0x64/0x7c kernel/locking/spinlock.c:162 __wake_up_common_lock kernel/sched/wait.c:105 [inline] __wake_up+0x38/0x1b0 kernel/sched/wait.c:127 unlock_metapage fs/jfs/jfs_metapage.c:39 [inline] release_metapage+0x164/0xa38 fs/jfs/jfs_metapage.c:763 xtTruncate+0xc78/0x2a08 jfs_free_zero_link+0x374/0x598 fs/jfs/namei.c:759 jfs_evict_inode+0x300/0x3f4 fs/jfs/inode.c:153 evict+0x444/0x978 fs/inode.c:725 iput_final fs/inode.c:1877 [inline] iput+0x744/0x8ec fs/inode.c:1903 txUpdateMap+0x85c/0xa18 fs/jfs/jfs_txnmgr.c:2367 txLazyCommit fs/jfs/jfs_txnmgr.c:2664 [inline] jfs_lazycommit+0x3bc/0x9a8 fs/jfs/jfs_txnmgr.c:2733 kthread+0x288/0x310 kernel/kthread.c:389 ret_from_fork+0x10/0x20 arch/arm64/kernel/entry.S:862 ------------[ cut here ]------------ UBSAN: array-index-out-of-bounds in kernel/locking/qspinlock.c:131:9 index 8933 is out of range for type 'unsigned long[8]' CPU: 0 UID: 0 PID: 98 Comm: jfsCommit Tainted: G B 6.12.0-rc5-syzkaller-g5283dc78f4da #0 Tainted: [B]=BAD_PAGE Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 09/13/2024 Call trace: show_stack+0x2c/0x3c arch/arm64/kernel/stacktrace.c:484 (C) __dump_stack lib/dump_stack.c:94 [inline] dump_stack_lvl+0xe4/0x150 lib/dump_stack.c:120 dump_stack+0x1c/0x28 lib/dump_stack.c:129 ubsan_epilogue lib/ubsan.c:231 [inline] __ubsan_handle_out_of_bounds+0xf8/0x148 lib/ubsan.c:429 decode_tail kernel/locking/qspinlock.c:131 [inline] queued_spin_lock_slowpath+0x974/0xd00 kernel/locking/qspinlock.c:468 queued_spin_lock include/asm-generic/qspinlock.h:114 [inline] do_raw_spin_lock+0x2ec/0x334 kernel/locking/spinlock_debug.c:116 __raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:111 [inline] _raw_spin_lock_irqsave+0x64/0x7c kernel/locking/spinlock.c:162 __wake_up_common_lock kernel/sched/wait.c:105 [inline] __wake_up+0x38/0x1b0 kernel/sched/wait.c:127 unlock_metapage fs/jfs/jfs_metapage.c:39 [inline] release_metapage+0x164/0xa38 fs/jfs/jfs_metapage.c:763 xtTruncate+0xc78/0x2a08 jfs_free_zero_link+0x374/0x598 fs/jfs/namei.c:759 jfs_evict_inode+0x300/0x3f4 fs/jfs/inode.c:153 evict+0x444/0x978 fs/inode.c:725 iput_final fs/inode.c:1877 [inline] iput+0x744/0x8ec fs/inode.c:1903 txUpdateMap+0x85c/0xa18 fs/jfs/jfs_txnmgr.c:2367 txLazyCommit fs/jfs/jfs_txnmgr.c:2664 [inline] jfs_lazycommit+0x3bc/0x9a8 fs/jfs/jfs_txnmgr.c:2733 kthread+0x288/0x310 kernel/kthread.c:389 ret_from_fork+0x10/0x20 arch/arm64/kernel/entry.S:862 ---[ end trace ]--- Unable to handle kernel paging request at virtual address ffff80008f765810 KASAN: probably user-memory-access in range [0x000000047bb2c080-0x000000047bb2c087] 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, ISS2 = 0x00000000 CM = 0, WnR = 1, TnD = 0, TagAccess = 0 GCS = 0, Overlay = 0, DirtyBit = 0, Xs = 0 swapper pgtable: 4k pages, 48-bit VAs, pgdp=00000001a5b0c000 [ffff80008f765810] pgd=0000000000000000, p4d=10000001adf99003, pud=10000001adf9a003, pmd=10000001adf9f003, pte=0000000000000000 Internal error: Oops: 0000000096000047 [#1] PREEMPT SMP Modules linked in: CPU: 0 UID: 0 PID: 98 Comm: jfsCommit Tainted: G B 6.12.0-rc5-syzkaller-g5283dc78f4da #0 Tainted: [B]=BAD_PAGE 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+0x3cc/0xd00 kernel/locking/qspinlock.c:471 lr : decode_tail kernel/locking/qspinlock.c:131 [inline] lr : queued_spin_lock_slowpath+0x974/0xd00 kernel/locking/qspinlock.c:468 sp : ffff80009b5872c0 x29: ffff80009b587360 x28: 0000000000008b99 x27: 1ffff000136b0e64 x26: dfff800000000000 x25: 1fffe0001bdce94d x24: 0000000000040000 x23: ffff0001b364e808 x22: ffff80008f765810 x21: ffff0001b364e800 x20: 1fffe000366c9d00 x19: ffff0000dee74a68 x18: 0000000000000008 x17: 0000000000000000 x16: ffff8000830cb3ac x15: ffff7000125a0240 x14: 1ffff000125a0240 x13: 0000000000000004 x12: ffffffffffffffff x11: ffff7000125a0240 x10: ffff80008f765800 x9 : 0000000000000001 x8 : 0000000000000000 x7 : 0000000000000001 x6 : 0000000000000001 x5 : ffff80009b5869b8 x4 : ffff80008f8edaa0 x3 : ffff8000801f08e4 x2 : 0000000000000001 x1 : 0000000000000004 x0 : ffff0001b364e808 Call trace: queued_spin_lock_slowpath+0x3cc/0xd00 kernel/locking/qspinlock.c:474 (P) decode_tail kernel/locking/qspinlock.c:131 [inline] (L) queued_spin_lock_slowpath+0x974/0xd00 kernel/locking/qspinlock.c:468 (L) queued_spin_lock include/asm-generic/qspinlock.h:114 [inline] do_raw_spin_lock+0x2ec/0x334 kernel/locking/spinlock_debug.c:116 __raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:111 [inline] _raw_spin_lock_irqsave+0x64/0x7c kernel/locking/spinlock.c:162 __wake_up_common_lock kernel/sched/wait.c:105 [inline] __wake_up+0x38/0x1b0 kernel/sched/wait.c:127 unlock_metapage fs/jfs/jfs_metapage.c:39 [inline] release_metapage+0x164/0xa38 fs/jfs/jfs_metapage.c:763 xtTruncate+0xc78/0x2a08 jfs_free_zero_link+0x374/0x598 fs/jfs/namei.c:759 jfs_evict_inode+0x300/0x3f4 fs/jfs/inode.c:153 evict+0x444/0x978 fs/inode.c:725 iput_final fs/inode.c:1877 [inline] iput+0x744/0x8ec fs/inode.c:1903 txUpdateMap+0x85c/0xa18 fs/jfs/jfs_txnmgr.c:2367 txLazyCommit fs/jfs/jfs_txnmgr.c:2664 [inline] jfs_lazycommit+0x3bc/0x9a8 fs/jfs/jfs_txnmgr.c:2733 kthread+0x288/0x310 kernel/kthread.c:389 ret_from_fork+0x10/0x20 arch/arm64/kernel/entry.S:862 Code: aa1603e0 972635a1 aa1703e0 52800081 (f90002d5) ---[ end trace 0000000000000000 ]--- ---------------- Code disassembly (best guess): 0: aa1603e0 mov x0, x22 4: 972635a1 bl 0xfffffffffc98d688 8: aa1703e0 mov x0, x23 c: 52800081 mov w1, #0x4 // #4 * 10: f90002d5 str x21, [x22] <-- trapping instruction