================================================================== BUG: KASAN: slab-out-of-bounds in mutex_can_spin_on_owner kernel/locking/mutex.c:417 [inline] BUG: KASAN: slab-out-of-bounds in mutex_optimistic_spin kernel/locking/mutex.c:462 [inline] BUG: KASAN: slab-out-of-bounds in __mutex_lock_common kernel/locking/mutex.c:621 [inline] BUG: KASAN: slab-out-of-bounds in __mutex_lock+0x122d/0x1870 kernel/locking/mutex.c:756 Read of size 4 at addr ffff88810778ce6c by task syz.1.685/3255 CPU: 0 PID: 3255 Comm: syz.1.685 Not tainted 5.15.161-syzkaller-00425-gb92c0d35d015 #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 08/06/2024 Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0x151/0x1c0 lib/dump_stack.c:106 print_address_description+0x87/0x3b0 mm/kasan/report.c:248 __kasan_report mm/kasan/report.c:427 [inline] kasan_report+0x179/0x1c0 mm/kasan/report.c:444 __asan_report_load4_noabort+0x14/0x20 mm/kasan/report_generic.c:308 mutex_can_spin_on_owner kernel/locking/mutex.c:417 [inline] mutex_optimistic_spin kernel/locking/mutex.c:462 [inline] __mutex_lock_common kernel/locking/mutex.c:621 [inline] __mutex_lock+0x122d/0x1870 kernel/locking/mutex.c:756 __mutex_lock_slowpath+0xe/0x10 kernel/locking/mutex.c:1007 mutex_lock+0x135/0x1e0 kernel/locking/mutex.c:289 steam_input_open+0x91/0x1a0 drivers/hid/hid-steam.c:297 input_open_device+0x1a5/0x310 drivers/input/input.c:640 evdev_open_device drivers/input/evdev.c:404 [inline] evdev_open+0x3df/0x620 drivers/input/evdev.c:491 chrdev_open+0x4f7/0x620 fs/char_dev.c:414 do_dentry_open+0x81c/0xfd0 fs/open.c:828 vfs_open+0x73/0x80 fs/open.c:958 do_open fs/namei.c:3608 [inline] path_openat+0x26f0/0x2f40 fs/namei.c:3742 do_filp_open+0x21c/0x460 fs/namei.c:3769 do_sys_openat2+0x13f/0x830 fs/open.c:1234 do_sys_open fs/open.c:1250 [inline] __do_sys_openat fs/open.c:1266 [inline] __se_sys_openat fs/open.c:1261 [inline] __x64_sys_openat+0x243/0x290 fs/open.c:1261 x64_sys_call+0x6bf/0x9a0 arch/x86/include/generated/asm/syscalls_64.h:258 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x3b/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x66/0xd0 RIP: 0033:0x7f6403731890 Code: 48 89 44 24 20 75 93 44 89 54 24 0c e8 19 8f 02 00 44 8b 54 24 0c 89 da 48 89 ee 41 89 c0 bf 9c ff ff ff b8 01 01 00 00 0f 05 <48> 3d 00 f0 ff ff 77 38 44 89 c7 89 44 24 0c e8 6c 8f 02 00 8b 44 RSP: 002b:00007f64023abb70 EFLAGS: 00000293 ORIG_RAX: 0000000000000101 RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 00007f6403731890 RDX: 0000000000000000 RSI: 00007f64023abc10 RDI: 00000000ffffff9c RBP: 00007f64023abc10 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000293 R12: 0000000000000000 R13: 0000000000000000 R14: 00007f64038eaf80 R15: 00007ffef3568f48 Allocated by task 100: kasan_save_stack mm/kasan/common.c:38 [inline] kasan_set_track mm/kasan/common.c:45 [inline] set_alloc_info mm/kasan/common.c:433 [inline] ____kasan_kmalloc+0xdb/0x110 mm/kasan/common.c:512 __kasan_kmalloc+0x9/0x10 mm/kasan/common.c:521 kasan_kmalloc include/linux/kasan.h:227 [inline] __kmalloc+0x13a/0x270 mm/slub.c:4427 kmalloc include/linux/slab.h:608 [inline] kernfs_fop_write_iter+0x151/0x410 fs/kernfs/file.c:273 call_write_iter include/linux/fs.h:2204 [inline] new_sync_write fs/read_write.c:507 [inline] vfs_write+0xd5d/0x1110 fs/read_write.c:594 ksys_write+0x199/0x2c0 fs/read_write.c:647 __do_sys_write fs/read_write.c:659 [inline] __se_sys_write fs/read_write.c:656 [inline] __x64_sys_write+0x7b/0x90 fs/read_write.c:656 x64_sys_call+0x2f/0x9a0 arch/x86/include/generated/asm/syscalls_64.h:2 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x3b/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x66/0xd0 The buggy address belongs to the object at ffff88810778ce60 which belongs to the cache kmalloc-8 of size 8 The buggy address is located 4 bytes to the right of 8-byte region [ffff88810778ce60, ffff88810778ce68) The buggy address belongs to the page: page:ffffea00041de300 refcount:1 mapcount:0 mapping:0000000000000000 index:0xffff88810778c370 pfn:0x10778c flags: 0x4000000000000200(slab|zone=1) raw: 4000000000000200 ffffea00048fe108 ffffea00041cf908 ffff888100042300 raw: ffff88810778c370 0000000000660031 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 0x12cc0(GFP_KERNEL|__GFP_NOWARN|__GFP_NORETRY), pid 1, ts 1186702992, free_ts 0 set_page_owner include/linux/page_owner.h:33 [inline] post_alloc_hook+0x1a3/0x1b0 mm/page_alloc.c:2605 prep_new_page+0x1b/0x110 mm/page_alloc.c:2611 get_page_from_freelist+0x3550/0x35d0 mm/page_alloc.c:4485 __alloc_pages+0x27e/0x8f0 mm/page_alloc.c:5779 allocate_slab mm/slub.c:1932 [inline] new_slab+0x9a/0x4e0 mm/slub.c:1995 ___slab_alloc+0x39e/0x830 mm/slub.c:3028 __slab_alloc+0x4a/0x90 mm/slub.c:3115 slab_alloc_node mm/slub.c:3206 [inline] slab_alloc mm/slub.c:3248 [inline] __kmalloc_track_caller+0x16c/0x260 mm/slub.c:4945 kstrdup mm/util.c:64 [inline] kstrdup_const+0x55/0x90 mm/util.c:87 __kernfs_new_node+0x99/0x700 fs/kernfs/dir.c:589 kernfs_new_node+0x130/0x230 fs/kernfs/dir.c:669 kernfs_create_dir_ns+0x44/0x130 fs/kernfs/dir.c:1017 sysfs_create_dir_ns+0x185/0x390 fs/sysfs/dir.c:59 create_dir lib/kobject.c:89 [inline] kobject_add_internal+0x763/0xd90 lib/kobject.c:263 kobject_add_varg lib/kobject.c:398 [inline] kobject_init_and_add+0x120/0x190 lib/kobject.c:481 locate_module_kobject+0xe4/0x170 kernel/params.c:776 page_owner free stack trace missing Memory state around the buggy address: ffff88810778cd00: fc fc fc fc 03 fc fc fc fc 05 fc fc fc fc fb fc ffff88810778cd80: fc fc fc fb fc fc fc fc fb fc fc fc fc fb fc fc >ffff88810778ce00: fc fc 06 fc fc fc fc 05 fc fc fc fc fb fc fc fc ^ ffff88810778ce80: fc 04 fc fc fc fc 05 fc fc fc fc 00 fc fc fc fc ffff88810778cf00: fb fc fc fc fc fb fc fc fc fc fb fc fc fc fc fb ================================================================== BUG: unable to handle page fault for address: 0000000000027051 #PF: supervisor read access in kernel mode #PF: error_code(0x0000) - not-present page PGD 120f3b067 P4D 120f3b067 PUD 1157e9067 PMD 0 Oops: 0000 [#1] PREEMPT SMP KASAN CPU: 0 PID: 3255 Comm: syz.1.685 Tainted: G B 5.15.161-syzkaller-00425-gb92c0d35d015 #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 08/06/2024 RIP: 0010:__raw_callee_save___kvm_vcpu_is_preempted+0x8/0x20 Code: e8 4d 68 51 01 bf 21 10 01 c0 be 0e 00 00 00 e8 3e 68 51 01 5d c3 cc cc cc cc cc cc cc cc cc cc cc cc 48 8b 04 fd 20 d8 25 86 <80> b8 50 70 02 00 00 0f 95 c0 c3 66 2e 0f 1f 84 00 00 00 00 00 0f RSP: 0018:ffffc90000ddf2d8 EFLAGS: 00010286 RAX: 0000000000000001 RBX: dffffc0000000000 RCX: ffffffff84e48523 RDX: 0000000000000000 RSI: 0000000000000286 RDI: 0000000000000064 RBP: ffffc90000ddf500 R08: ffffffff814194db R09: 0000000000000003 R10: fffffbfff0e99c4c R11: dffffc0000000001 R12: 1ffff110234e94f0 R13: 1ffff920001bbe88 R14: 1ffff920001bbe6c R15: 0000000000000064 FS: 00007f64023ac6c0(0000) GS:ffff8881f7000000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 0000000000027051 CR3: 000000011eb18000 CR4: 00000000003506b0 DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 Call Trace: __mutex_lock_slowpath+0xe/0x10 kernel/locking/mutex.c:1007 mutex_lock+0x135/0x1e0 kernel/locking/mutex.c:289 steam_input_open+0x91/0x1a0 drivers/hid/hid-steam.c:297 input_open_device+0x1a5/0x310 drivers/input/input.c:640 evdev_open_device drivers/input/evdev.c:404 [inline] evdev_open+0x3df/0x620 drivers/input/evdev.c:491 chrdev_open+0x4f7/0x620 fs/char_dev.c:414 do_dentry_open+0x81c/0xfd0 fs/open.c:828 vfs_open+0x73/0x80 fs/open.c:958 do_open fs/namei.c:3608 [inline] path_openat+0x26f0/0x2f40 fs/namei.c:3742 do_filp_open+0x21c/0x460 fs/namei.c:3769 do_sys_openat2+0x13f/0x830 fs/open.c:1234 do_sys_open fs/open.c:1250 [inline] __do_sys_openat fs/open.c:1266 [inline] __se_sys_openat fs/open.c:1261 [inline] __x64_sys_openat+0x243/0x290 fs/open.c:1261 x64_sys_call+0x6bf/0x9a0 arch/x86/include/generated/asm/syscalls_64.h:258 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x3b/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x66/0xd0 RIP: 0033:0x7f6403731890 Code: 48 89 44 24 20 75 93 44 89 54 24 0c e8 19 8f 02 00 44 8b 54 24 0c 89 da 48 89 ee 41 89 c0 bf 9c ff ff ff b8 01 01 00 00 0f 05 <48> 3d 00 f0 ff ff 77 38 44 89 c7 89 44 24 0c e8 6c 8f 02 00 8b 44 RSP: 002b:00007f64023abb70 EFLAGS: 00000293 ORIG_RAX: 0000000000000101 RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 00007f6403731890 RDX: 0000000000000000 RSI: 00007f64023abc10 RDI: 00000000ffffff9c RBP: 00007f64023abc10 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000293 R12: 0000000000000000 R13: 0000000000000000 R14: 00007f64038eaf80 R15: 00007ffef3568f48 Modules linked in: CR2: 0000000000027051 ---[ end trace 618d4878ee1ae3e4 ]--- RIP: 0010:__raw_callee_save___kvm_vcpu_is_preempted+0x8/0x20 Code: e8 4d 68 51 01 bf 21 10 01 c0 be 0e 00 00 00 e8 3e 68 51 01 5d c3 cc cc cc cc cc cc cc cc cc cc cc cc 48 8b 04 fd 20 d8 25 86 <80> b8 50 70 02 00 00 0f 95 c0 c3 66 2e 0f 1f 84 00 00 00 00 00 0f RSP: 0018:ffffc90000ddf2d8 EFLAGS: 00010286 RAX: 0000000000000001 RBX: dffffc0000000000 RCX: ffffffff84e48523 RDX: 0000000000000000 RSI: 0000000000000286 RDI: 0000000000000064 RBP: ffffc90000ddf500 R08: ffffffff814194db R09: 0000000000000003 R10: fffffbfff0e99c4c R11: dffffc0000000001 R12: 1ffff110234e94f0 R13: 1ffff920001bbe88 R14: 1ffff920001bbe6c R15: 0000000000000064 FS: 00007f64023ac6c0(0000) GS:ffff8881f7000000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 0000000000027051 CR3: 000000011eb18000 CR4: 00000000003506b0 DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 ---------------- Code disassembly (best guess): 0: e8 4d 68 51 01 call 0x1516852 5: bf 21 10 01 c0 mov $0xc0011021,%edi a: be 0e 00 00 00 mov $0xe,%esi f: e8 3e 68 51 01 call 0x1516852 14: 5d pop %rbp 15: c3 ret 16: cc int3 17: cc int3 18: cc int3 19: cc int3 1a: cc int3 1b: cc int3 1c: cc int3 1d: cc int3 1e: cc int3 1f: cc int3 20: cc int3 21: cc int3 22: 48 8b 04 fd 20 d8 25 mov -0x79da27e0(,%rdi,8),%rax 29: 86 * 2a: 80 b8 50 70 02 00 00 cmpb $0x0,0x27050(%rax) <-- trapping instruction 31: 0f 95 c0 setne %al 34: c3 ret 35: 66 2e 0f 1f 84 00 00 cs nopw 0x0(%rax,%rax,1) 3c: 00 00 00 3f: 0f .byte 0xf