BUG: spinlock bad magic on CPU#1, syz-executor/6686 ================================================================== BUG: KASAN: slab-out-of-bounds in task_pid_nr include/linux/pid.h:232 [inline] BUG: KASAN: slab-out-of-bounds in spin_dump kernel/locking/spinlock_debug.c:64 [inline] BUG: KASAN: slab-out-of-bounds in spin_bug+0x17d/0x1d0 kernel/locking/spinlock_debug.c:78 Read of size 4 at addr ffff888028d655d8 by task syz-executor/6686 CPU: 1 UID: 0 PID: 6686 Comm: syz-executor Not tainted 6.12.0-rc7-syzkaller-00042-gf1b785f4c787 #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 10/30/2024 Call Trace: __dump_stack lib/dump_stack.c:94 [inline] dump_stack_lvl+0x116/0x1f0 lib/dump_stack.c:120 print_address_description mm/kasan/report.c:377 [inline] print_report+0xc3/0x620 mm/kasan/report.c:488 kasan_report+0xd9/0x110 mm/kasan/report.c:601 task_pid_nr include/linux/pid.h:232 [inline] spin_dump kernel/locking/spinlock_debug.c:64 [inline] spin_bug+0x17d/0x1d0 kernel/locking/spinlock_debug.c:78 debug_spin_lock_before kernel/locking/spinlock_debug.c:86 [inline] do_raw_spin_lock+0x225/0x2c0 kernel/locking/spinlock_debug.c:115 put_pwq_unlocked kernel/workqueue.c:1662 [inline] put_pwq_unlocked kernel/workqueue.c:1655 [inline] destroy_workqueue+0x5dd/0xaa0 kernel/workqueue.c:5883 btrfs_stop_all_workers+0x29f/0x370 fs/btrfs/disk-io.c:1795 close_ctree+0x511/0xe60 fs/btrfs/disk-io.c:4362 generic_shutdown_super+0x15f/0x3d0 fs/super.c:642 kill_anon_super+0x3a/0x60 fs/super.c:1237 btrfs_kill_super+0x3b/0x50 fs/btrfs/super.c:2114 deactivate_locked_super+0xc1/0x1a0 fs/super.c:473 deactivate_super+0xde/0x100 fs/super.c:506 cleanup_mnt+0x222/0x450 fs/namespace.c:1373 task_work_run+0x151/0x250 kernel/task_work.c:239 resume_user_mode_work include/linux/resume_user_mode.h:50 [inline] exit_to_user_mode_loop kernel/entry/common.c:114 [inline] exit_to_user_mode_prepare include/linux/entry-common.h:328 [inline] __syscall_exit_to_user_mode_work kernel/entry/common.c:207 [inline] syscall_exit_to_user_mode+0x27b/0x2a0 kernel/entry/common.c:218 do_syscall_64+0xda/0x250 arch/x86/entry/common.c:89 entry_SYSCALL_64_after_hwframe+0x77/0x7f RIP: 0033:0x7fa62817fa47 Code: a8 ff ff ff f7 d8 64 89 01 48 83 c8 ff c3 0f 1f 44 00 00 31 f6 e9 09 00 00 00 66 0f 1f 84 00 00 00 00 00 b8 a6 00 00 00 0f 05 <48> 3d 00 f0 ff ff 77 01 c3 48 c7 c2 a8 ff ff ff f7 d8 64 89 02 b8 RSP: 002b:00007ffe01220288 EFLAGS: 00000246 ORIG_RAX: 00000000000000a6 RAX: 0000000000000000 RBX: 0000000000000000 RCX: 00007fa62817fa47 RDX: 0000000000000000 RSI: 0000000000000009 RDI: 00007ffe01220340 RBP: 00007ffe01220340 R08: 0000000000000000 R09: 0000000000000000 R10: 00000000ffffffff R11: 0000000000000246 R12: 00007ffe012213c0 R13: 00007fa6281f15fc R14: 000000000006b27e R15: 00007ffe01221400 Allocated by task 7538: kasan_save_stack+0x33/0x60 mm/kasan/common.c:47 kasan_save_track+0x14/0x30 mm/kasan/common.c:68 poison_kmalloc_redzone mm/kasan/common.c:377 [inline] __kasan_kmalloc+0xaa/0xb0 mm/kasan/common.c:394 kmalloc_noprof include/linux/slab.h:878 [inline] kzalloc_noprof include/linux/slab.h:1014 [inline] xfs_mru_cache_create+0xf4/0x5d0 fs/xfs/xfs_mru_cache.c:335 xfs_fs_fill_super+0xf74/0x1e50 fs/xfs/xfs_super.c:1694 get_tree_bdev_flags+0x38e/0x620 fs/super.c:1636 vfs_get_tree+0x92/0x380 fs/super.c:1814 do_new_mount fs/namespace.c:3507 [inline] path_mount+0x14e6/0x1f20 fs/namespace.c:3834 do_mount fs/namespace.c:3847 [inline] __do_sys_mount fs/namespace.c:4057 [inline] __se_sys_mount fs/namespace.c:4034 [inline] __x64_sys_mount+0x294/0x320 fs/namespace.c:4034 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0xcd/0x250 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x77/0x7f The buggy address belongs to the object at ffff888028d65400 which belongs to the cache kmalloc-512 of size 512 The buggy address is located 88 bytes to the right of allocated 384-byte region [ffff888028d65400, ffff888028d65580) The buggy address belongs to the physical page: page: refcount:1 mapcount:0 mapping:0000000000000000 index:0xffff888028d64800 pfn:0x28d64 head: order:2 mapcount:0 entire_mapcount:0 nr_pages_mapped:0 pincount:0 flags: 0xfff00000000240(workingset|head|node=0|zone=1|lastcpupid=0x7ff) page_type: f5(slab) raw: 00fff00000000240 ffff88801b041c80 ffffea00023e0810 ffffea0000c59310 raw: ffff888028d64800 000000000010000f 00000001f5000000 0000000000000000 head: 00fff00000000240 ffff88801b041c80 ffffea00023e0810 ffffea0000c59310 head: ffff888028d64800 000000000010000f 00000001f5000000 0000000000000000 head: 00fff00000000002 ffffea0000a35901 ffffffffffffffff 0000000000000000 head: 0000000000000004 0000000000000000 00000000ffffffff 0000000000000000 page dumped because: kasan: bad access detected page_owner tracks the page as allocated page last allocated via order 2, migratetype Unmovable, gfp_mask 0xd20c0(__GFP_IO|__GFP_FS|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC), pid 5213, tgid 5213 (udevd), ts 38888395487, free_ts 38877596654 set_page_owner include/linux/page_owner.h:32 [inline] post_alloc_hook+0x2d1/0x350 mm/page_alloc.c:1541 prep_new_page mm/page_alloc.c:1549 [inline] get_page_from_freelist+0xfce/0x2f80 mm/page_alloc.c:3459 __alloc_pages_noprof+0x223/0x25a0 mm/page_alloc.c:4735 alloc_pages_mpol_noprof+0x2c9/0x610 mm/mempolicy.c:2265 alloc_slab_page mm/slub.c:2412 [inline] allocate_slab mm/slub.c:2578 [inline] new_slab+0x2c9/0x410 mm/slub.c:2631 ___slab_alloc+0xdac/0x1880 mm/slub.c:3818 __slab_alloc.constprop.0+0x56/0xb0 mm/slub.c:3908 __slab_alloc_node mm/slub.c:3961 [inline] slab_alloc_node mm/slub.c:4122 [inline] __kmalloc_cache_noprof+0x2b4/0x300 mm/slub.c:4290 kmalloc_noprof include/linux/slab.h:878 [inline] kzalloc_noprof include/linux/slab.h:1014 [inline] kernfs_fop_open+0x28b/0xdb0 fs/kernfs/file.c:623 do_dentry_open+0x6cd/0x1530 fs/open.c:958 vfs_open+0x82/0x3f0 fs/open.c:1088 do_open fs/namei.c:3774 [inline] path_openat+0x1e6a/0x2d60 fs/namei.c:3933 do_filp_open+0x1dc/0x430 fs/namei.c:3960 do_sys_openat2+0x17a/0x1e0 fs/open.c:1415 do_sys_open fs/open.c:1430 [inline] __do_sys_openat fs/open.c:1446 [inline] __se_sys_openat fs/open.c:1441 [inline] __x64_sys_openat+0x175/0x210 fs/open.c:1441 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0xcd/0x250 arch/x86/entry/common.c:83 page last free pid 5224 tgid 5224 stack trace: reset_page_owner include/linux/page_owner.h:25 [inline] free_pages_prepare mm/page_alloc.c:1112 [inline] free_unref_page+0x5f4/0xdc0 mm/page_alloc.c:2642 qlink_free mm/kasan/quarantine.c:163 [inline] qlist_free_all+0x4e/0x120 mm/kasan/quarantine.c:179 kasan_quarantine_reduce+0x192/0x1e0 mm/kasan/quarantine.c:286 __kasan_slab_alloc+0x69/0x90 mm/kasan/common.c:329 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] __kmalloc_cache_noprof+0x11e/0x300 mm/slub.c:4290 kmalloc_noprof include/linux/slab.h:878 [inline] kzalloc_noprof include/linux/slab.h:1014 [inline] kernfs_get_open_node fs/kernfs/file.c:525 [inline] kernfs_fop_open+0xa88/0xdb0 fs/kernfs/file.c:700 do_dentry_open+0x6cd/0x1530 fs/open.c:958 vfs_open+0x82/0x3f0 fs/open.c:1088 do_open fs/namei.c:3774 [inline] path_openat+0x1e6a/0x2d60 fs/namei.c:3933 do_filp_open+0x1dc/0x430 fs/namei.c:3960 do_sys_openat2+0x17a/0x1e0 fs/open.c:1415 do_sys_open fs/open.c:1430 [inline] __do_sys_openat fs/open.c:1446 [inline] __se_sys_openat fs/open.c:1441 [inline] __x64_sys_openat+0x175/0x210 fs/open.c:1441 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0xcd/0x250 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x77/0x7f Memory state around the buggy address: ffff888028d65480: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ffff888028d65500: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 >ffff888028d65580: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ^ ffff888028d65600: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff888028d65680: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ================================================================== lock: 0xffff88803d651800, .magic: ffff8880, .owner: /0, .owner_cpu: 1503267976 CPU: 1 UID: 0 PID: 6686 Comm: syz-executor Tainted: G B 6.12.0-rc7-syzkaller-00042-gf1b785f4c787 #0 Tainted: [B]=BAD_PAGE Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 10/30/2024 Call Trace: __dump_stack lib/dump_stack.c:94 [inline] dump_stack_lvl+0x116/0x1f0 lib/dump_stack.c:120 debug_spin_lock_before kernel/locking/spinlock_debug.c:86 [inline] do_raw_spin_lock+0x225/0x2c0 kernel/locking/spinlock_debug.c:115 put_pwq_unlocked kernel/workqueue.c:1662 [inline] put_pwq_unlocked kernel/workqueue.c:1655 [inline] destroy_workqueue+0x5dd/0xaa0 kernel/workqueue.c:5883 btrfs_stop_all_workers+0x29f/0x370 fs/btrfs/disk-io.c:1795 close_ctree+0x511/0xe60 fs/btrfs/disk-io.c:4362 generic_shutdown_super+0x15f/0x3d0 fs/super.c:642 kill_anon_super+0x3a/0x60 fs/super.c:1237 btrfs_kill_super+0x3b/0x50 fs/btrfs/super.c:2114 deactivate_locked_super+0xc1/0x1a0 fs/super.c:473 deactivate_super+0xde/0x100 fs/super.c:506 cleanup_mnt+0x222/0x450 fs/namespace.c:1373 task_work_run+0x151/0x250 kernel/task_work.c:239 resume_user_mode_work include/linux/resume_user_mode.h:50 [inline] exit_to_user_mode_loop kernel/entry/common.c:114 [inline] exit_to_user_mode_prepare include/linux/entry-common.h:328 [inline] __syscall_exit_to_user_mode_work kernel/entry/common.c:207 [inline] syscall_exit_to_user_mode+0x27b/0x2a0 kernel/entry/common.c:218 do_syscall_64+0xda/0x250 arch/x86/entry/common.c:89 entry_SYSCALL_64_after_hwframe+0x77/0x7f RIP: 0033:0x7fa62817fa47 Code: a8 ff ff ff f7 d8 64 89 01 48 83 c8 ff c3 0f 1f 44 00 00 31 f6 e9 09 00 00 00 66 0f 1f 84 00 00 00 00 00 b8 a6 00 00 00 0f 05 <48> 3d 00 f0 ff ff 77 01 c3 48 c7 c2 a8 ff ff ff f7 d8 64 89 02 b8 RSP: 002b:00007ffe01220288 EFLAGS: 00000246 ORIG_RAX: 00000000000000a6 RAX: 0000000000000000 RBX: 0000000000000000 RCX: 00007fa62817fa47 RDX: 0000000000000000 RSI: 0000000000000009 RDI: 00007ffe01220340 RBP: 00007ffe01220340 R08: 0000000000000000 R09: 0000000000000000 R10: 00000000ffffffff R11: 0000000000000246 R12: 00007ffe012213c0 R13: 00007fa6281f15fc R14: 000000000006b27e R15: 00007ffe01221400 ------------[ cut here ]------------ UBSAN: array-index-out-of-bounds in kernel/locking/qspinlock.c:131:9 index 5733 is out of range for type 'long unsigned int [8]' CPU: 1 UID: 0 PID: 6686 Comm: syz-executor Tainted: G B 6.12.0-rc7-syzkaller-00042-gf1b785f4c787 #0 Tainted: [B]=BAD_PAGE Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 10/30/2024 Call Trace: __dump_stack lib/dump_stack.c:94 [inline] dump_stack_lvl+0x116/0x1f0 lib/dump_stack.c:120 ubsan_epilogue lib/ubsan.c:231 [inline] __ubsan_handle_out_of_bounds+0x110/0x150 lib/ubsan.c:429 decode_tail kernel/locking/qspinlock.c:131 [inline] __pv_queued_spin_lock_slowpath+0xc86/0xc90 kernel/locking/qspinlock.c:468 pv_queued_spin_lock_slowpath arch/x86/include/asm/paravirt.h:584 [inline] queued_spin_lock_slowpath arch/x86/include/asm/qspinlock.h:51 [inline] queued_spin_lock include/asm-generic/qspinlock.h:114 [inline] do_raw_spin_lock+0x210/0x2c0 kernel/locking/spinlock_debug.c:116 put_pwq_unlocked kernel/workqueue.c:1662 [inline] put_pwq_unlocked kernel/workqueue.c:1655 [inline] destroy_workqueue+0x5dd/0xaa0 kernel/workqueue.c:5883 btrfs_stop_all_workers+0x29f/0x370 fs/btrfs/disk-io.c:1795 close_ctree+0x511/0xe60 fs/btrfs/disk-io.c:4362 generic_shutdown_super+0x15f/0x3d0 fs/super.c:642 kill_anon_super+0x3a/0x60 fs/super.c:1237 btrfs_kill_super+0x3b/0x50 fs/btrfs/super.c:2114 deactivate_locked_super+0xc1/0x1a0 fs/super.c:473 deactivate_super+0xde/0x100 fs/super.c:506 cleanup_mnt+0x222/0x450 fs/namespace.c:1373 task_work_run+0x151/0x250 kernel/task_work.c:239 resume_user_mode_work include/linux/resume_user_mode.h:50 [inline] exit_to_user_mode_loop kernel/entry/common.c:114 [inline] exit_to_user_mode_prepare include/linux/entry-common.h:328 [inline] __syscall_exit_to_user_mode_work kernel/entry/common.c:207 [inline] syscall_exit_to_user_mode+0x27b/0x2a0 kernel/entry/common.c:218 do_syscall_64+0xda/0x250 arch/x86/entry/common.c:89 entry_SYSCALL_64_after_hwframe+0x77/0x7f RIP: 0033:0x7fa62817fa47 Code: a8 ff ff ff f7 d8 64 89 01 48 83 c8 ff c3 0f 1f 44 00 00 31 f6 e9 09 00 00 00 66 0f 1f 84 00 00 00 00 00 b8 a6 00 00 00 0f 05 <48> 3d 00 f0 ff ff 77 01 c3 48 c7 c2 a8 ff ff ff f7 d8 64 89 02 b8 RSP: 002b:00007ffe01220288 EFLAGS: 00000246 ORIG_RAX: 00000000000000a6 RAX: 0000000000000000 RBX: 0000000000000000 RCX: 00007fa62817fa47 RDX: 0000000000000000 RSI: 0000000000000009 RDI: 00007ffe01220340 RBP: 00007ffe01220340 R08: 0000000000000000 R09: 0000000000000000 R10: 00000000ffffffff R11: 0000000000000246 R12: 00007ffe012213c0 R13: 00007fa6281f15fc R14: 000000000006b27e R15: 00007ffe01221400 ---[ end trace ]---