BUG: spinlock bad magic on CPU#1, syz.6.5120/25728 ================================================================== BUG: KASAN: slab-out-of-bounds in task_pid_nr include/linux/sched.h:1596 [inline] BUG: KASAN: slab-out-of-bounds in spin_dump+0x197/0x1a0 kernel/locking/spinlock_debug.c:67 Read of size 4 at addr ffff88805a77c5c0 by task syz.6.5120/25728 CPU: 1 PID: 25728 Comm: syz.6.5120 Not tainted syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 10/07/2026 Call Trace: dump_stack_lvl+0x18c/0x250 lib/dump_stack.c:106 print_address_description mm/kasan/report.c:364 [inline] print_report+0xa8/0x210 mm/kasan/report.c:468 kasan_report+0x117/0x150 mm/kasan/report.c:581 task_pid_nr include/linux/sched.h:1596 [inline] spin_dump+0x197/0x1a0 kernel/locking/spinlock_debug.c:67 spin_bug kernel/locking/spinlock_debug.c:77 [inline] debug_spin_lock_before kernel/locking/spinlock_debug.c:85 [inline] do_raw_spin_lock+0x1bf/0x2b0 kernel/locking/spinlock_debug.c:114 __raw_spin_lock_irq include/linux/spinlock_api_smp.h:120 [inline] _raw_spin_lock_irq+0xbb/0xf0 kernel/locking/spinlock.c:170 spin_lock_irq include/linux/spinlock.h:376 [inline] gadget_dev_open+0x4b/0x1b0 drivers/usb/gadget/legacy/inode.c:1910 do_dentry_open+0x880/0x14b0 fs/open.c:929 do_open fs/namei.c:3695 [inline] path_openat+0x284f/0x3270 fs/namei.c:3856 do_filp_open+0x1f2/0x430 fs/namei.c:3883 do_sys_openat2+0x134/0x1d0 fs/open.c:1422 do_sys_open fs/open.c:1437 [inline] __do_sys_openat fs/open.c:1453 [inline] __se_sys_openat fs/open.c:1448 [inline] __x64_sys_openat+0x139/0x160 fs/open.c:1448 do_syscall_x64 arch/x86/entry/common.c:46 [inline] do_syscall_64+0x55/0xb0 arch/x86/entry/common.c:76 entry_SYSCALL_64_after_hwframe+0x68/0xd2 RIP: 0033:0x7f8d3f19f559 Code: ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 44 00 00 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 c7 c1 e8 ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007f8d3d3f6028 EFLAGS: 00000246 ORIG_RAX: 0000000000000101 RAX: ffffffffffffffda RBX: 00007f8d3f425fa0 RCX: 00007f8d3f19f559 RDX: 0000000000000002 RSI: 0000200000000140 RDI: ffffffffffffff9c RBP: 00007f8d3f236b50 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000084 R11: 0000000000000246 R12: 0000000000000000 R13: 00007f8d3f426038 R14: 00007f8d3f425fa0 R15: 00007fff62fe13b8 Allocated by task 5907: kasan_save_stack mm/kasan/common.c:46 [inline] kasan_set_track+0x4e/0x70 mm/kasan/common.c:53 ____kasan_kmalloc mm/kasan/common.c:375 [inline] __kasan_kmalloc+0x8f/0xa0 mm/kasan/common.c:384 kasan_kmalloc include/linux/kasan.h:198 [inline] __do_kmalloc_node mm/slab_common.c:1007 [inline] __kmalloc_node+0xb6/0x240 mm/slab_common.c:1014 kmalloc_array_node include/linux/slab.h:698 [inline] kcalloc_node include/linux/slab.h:703 [inline] memcg_alloc_slab_cgroups+0x85/0x120 mm/memcontrol.c:2928 memcg_slab_post_alloc_hook mm/slab.h:535 [inline] slab_post_alloc_hook+0xec/0x4d0 mm/slab.h:778 slab_alloc_node mm/slub.c:3518 [inline] slab_alloc mm/slub.c:3526 [inline] __kmem_cache_alloc_lru mm/slub.c:3533 [inline] kmem_cache_alloc+0x17e/0x2d0 mm/slub.c:3542 kmem_cache_zalloc include/linux/slab.h:711 [inline] alloc_buffer_head+0x2d/0x280 fs/buffer.c:3031 folio_alloc_buffers+0x39b/0x9c0 fs/buffer.c:935 folio_create_empty_buffers+0x3a/0x740 fs/buffer.c:1648 __block_write_begin_int+0x201/0x1b00 fs/buffer.c:2103 block_page_mkwrite+0x2a9/0x4c0 fs/buffer.c:2643 ext4_page_mkwrite+0xb63/0x11a0 fs/ext4/inode.c:6327 do_page_mkwrite+0x153/0x3f0 mm/memory.c:2951 do_shared_fault mm/memory.c:4717 [inline] do_fault mm/memory.c:4779 [inline] do_pte_missing mm/memory.c:3689 [inline] handle_pte_fault mm/memory.c:5047 [inline] __handle_mm_fault mm/memory.c:5190 [inline] handle_mm_fault+0x1a26/0x4a40 mm/memory.c:5355 do_user_addr_fault+0xeb7/0x13e0 arch/x86/mm/fault.c:1371 handle_page_fault arch/x86/mm/fault.c:1463 [inline] exc_page_fault+0x64/0x100 arch/x86/mm/fault.c:1516 asm_exc_page_fault+0x26/0x30 arch/x86/include/asm/idtentry.h:608 The buggy address belongs to the object at ffff88805a77c500 which belongs to the cache kmalloc-192 of size 192 The buggy address is located 56 bytes to the right of allocated 136-byte region [ffff88805a77c500, ffff88805a77c588) The buggy address belongs to the physical page: page:ffffea000169df00 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x5a77c flags: 0xfff00000000800(slab|node=0|zone=1|lastcpupid=0x7ff) page_type: 0xffffffff() raw: 00fff00000000800 ffff888018c41a00 ffffea0000935a80 dead000000000004 raw: 0000000000000000 0000000000100010 00000001ffffffff 0000000000000000 page dumped because: kasan: bad access detected page_owner tracks the page as allocated page last allocated via order 0, migratetype Unmovable, gfp_mask 0x112cc0(GFP_USER|__GFP_NOWARN|__GFP_NORETRY), pid 5786, tgid 5786 (syz-executor), ts 84440675133, free_ts 25778071720 set_page_owner include/linux/page_owner.h:31 [inline] post_alloc_hook+0x1c1/0x200 mm/page_alloc.c:1582 prep_new_page mm/page_alloc.c:1589 [inline] get_page_from_freelist+0x2181/0x22a0 mm/page_alloc.c:3221 __alloc_pages+0x1f0/0x460 mm/page_alloc.c:4501 __alloc_pages_node include/linux/gfp.h:237 [inline] alloc_slab_page+0x4f/0x180 mm/slub.c:1905 allocate_slab mm/slub.c:2050 [inline] new_slab+0x87/0x2d0 mm/slub.c:2103 ___slab_alloc+0xc5c/0x12f0 mm/slub.c:3275 __slab_alloc mm/slub.c:3361 [inline] __slab_alloc_node mm/slub.c:3414 [inline] slab_alloc_node mm/slub.c:3508 [inline] __kmem_cache_alloc_node+0x122/0x260 mm/slub.c:3557 __do_kmalloc_node mm/slab_common.c:1006 [inline] __kmalloc_node+0xa6/0x240 mm/slab_common.c:1014 kmalloc_array_node include/linux/slab.h:698 [inline] kcalloc_node include/linux/slab.h:703 [inline] memcg_alloc_slab_cgroups+0x85/0x120 mm/memcontrol.c:2928 memcg_slab_post_alloc_hook mm/slab.h:535 [inline] slab_post_alloc_hook+0xec/0x4d0 mm/slab.h:778 slab_alloc_node mm/slub.c:3518 [inline] slab_alloc mm/slub.c:3526 [inline] __kmem_cache_alloc_lru mm/slub.c:3533 [inline] kmem_cache_alloc+0x17e/0x2d0 mm/slub.c:3542 vma_lock_alloc kernel/fork.c:461 [inline] vm_area_dup+0x61/0x270 kernel/fork.c:514 dup_mmap kernel/fork.c:712 [inline] dup_mm kernel/fork.c:1703 [inline] copy_mm+0x11a6/0x1e30 kernel/fork.c:1752 copy_process+0x16c9/0x3da0 kernel/fork.c:2513 kernel_clone+0x24b/0x8a0 kernel/fork.c:2922 __do_sys_clone kernel/fork.c:3065 [inline] __se_sys_clone kernel/fork.c:3049 [inline] __x64_sys_clone+0x1b7/0x230 kernel/fork.c:3049 page last free stack trace: reset_page_owner include/linux/page_owner.h:24 [inline] free_pages_prepare mm/page_alloc.c:1182 [inline] free_unref_page_prepare+0x7d7/0x8f0 mm/page_alloc.c:2366 free_unref_page+0x32/0x2e0 mm/page_alloc.c:2459 free_contig_range+0xa1/0x150 mm/page_alloc.c:6431 destroy_args+0x7d/0x840 mm/debug_vm_pgtable.c:1015 debug_vm_pgtable+0x411/0x440 mm/debug_vm_pgtable.c:1400 do_one_initcall+0x242/0x790 init/main.c:1215 do_initcall_level+0x13d/0x1f0 init/main.c:1277 do_initcalls+0x69/0xd0 init/main.c:1293 kernel_init_freeable+0x3d9/0x560 init/main.c:1530 kernel_init+0x1d/0x1c0 init/main.c:1420 ret_from_fork+0x48/0x80 arch/x86/kernel/process.c:152 ret_from_fork_asm+0x11/0x20 arch/x86/entry/entry_64.S:293 Memory state around the buggy address: ffff88805a77c480: 00 00 00 00 00 fc fc fc fc fc fc fc fc fc fc fc ffff88805a77c500: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 >ffff88805a77c580: 00 fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ^ ffff88805a77c600: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ffff88805a77c680: 00 00 00 fc fc fc fc fc fc fc fc fc fc fc fc fc ==================================================================