kobject: kobject_add_internal failed for raw_gadget with -EEXIST, don't try to register things with the same name in the same directory. Oops: general protection fault, probably for non-canonical address 0xdffffc0000000004: 0000 [#1] SMP KASAN NOPTI KASAN: null-ptr-deref in range [0x0000000000000020-0x0000000000000027] CPU: 1 UID: 0 PID: 6244 Comm: syz.4.75 Not tainted 6.15.0-rc5-syzkaller #0 PREEMPT(full) Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 04/29/2025 RIP: 0010:kasan_byte_accessible+0x12/0x30 mm/kasan/generic.c:199 Code: 0f 1f 84 00 00 00 00 00 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 66 0f 1f 00 48 c1 ef 03 48 b8 00 00 00 00 00 fc ff df <0f> b6 04 07 3c 08 0f 92 c0 e9 7b 90 ee fe cc 66 66 66 66 66 66 2e RSP: 0018:ffffc9000e3b7840 EFLAGS: 00010012 RAX: dffffc0000000000 RBX: ffffffff8b58a807 RCX: 00aca3f4f9223600 RDX: 0000000000000000 RSI: ffffffff8b58a807 RDI: 0000000000000004 RBP: ffffffff819b49d8 R08: 0000000000000001 R09: 0000000000000000 R10: dffffc0000000000 R11: fffffbfff1efdb2f R12: 0000000000000000 R13: 0000000000000020 R14: 0000000000000020 R15: 0000000000000001 FS: 00007f9d2a2236c0(0000) GS:ffff8881261cb000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 000055555f2ee5c8 CR3: 0000000057c0d000 CR4: 0000000000350ef0 Call Trace: __kasan_check_byte+0x12/0x40 mm/kasan/common.c:556 kasan_check_byte include/linux/kasan.h:399 [inline] lock_acquire+0x8d/0x360 kernel/locking/lockdep.c:5840 __raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:110 [inline] _raw_spin_lock_irqsave+0xa7/0xf0 kernel/locking/spinlock.c:162 complete_with_flags kernel/sched/completion.c:20 [inline] complete+0x28/0x1b0 kernel/sched/completion.c:47 kobject_cleanup lib/kobject.c:689 [inline] kobject_release lib/kobject.c:720 [inline] kref_put include/linux/kref.h:65 [inline] kobject_put+0x22b/0x480 lib/kobject.c:737 lookup_or_create_module_kobject+0x150/0x170 kernel/params.c:783 module_add_driver+0xb9/0x310 drivers/base/module.c:46 bus_add_driver+0x391/0x640 drivers/base/bus.c:682 driver_register+0x23a/0x320 drivers/base/driver.c:249 usb_gadget_register_driver_owner+0xf9/0x270 drivers/usb/gadget/udc/core.c:1700 raw_ioctl_run drivers/usb/gadget/legacy/raw_gadget.c:595 [inline] raw_ioctl+0x149a/0x3c90 drivers/usb/gadget/legacy/raw_gadget.c:1306 vfs_ioctl fs/ioctl.c:51 [inline] __do_sys_ioctl fs/ioctl.c:906 [inline] __se_sys_ioctl+0xfc/0x170 fs/ioctl.c:892 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline] do_syscall_64+0xf6/0x210 arch/x86/entry/syscall_64.c:94 entry_SYSCALL_64_after_hwframe+0x77/0x7f RIP: 0033:0x7f9d2938e56b Code: 00 48 89 44 24 18 31 c0 48 8d 44 24 60 c7 04 24 10 00 00 00 48 89 44 24 08 48 8d 44 24 20 48 89 44 24 10 b8 10 00 00 00 0f 05 <89> c2 3d 00 f0 ff ff 77 1c 48 8b 44 24 18 64 48 2b 04 25 28 00 00 RSP: 002b:00007f9d2a220f10 EFLAGS: 00000246 ORIG_RAX: 0000000000000010 RAX: ffffffffffffffda RBX: 0000000000000003 RCX: 00007f9d2938e56b RDX: 0000000000000000 RSI: 0000000000005501 RDI: 0000000000000003 RBP: 00007f9d2a221fe0 R08: 0000000000000000 R09: 00342e6364755f79 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 00007f9d2a220fb0 R14: 0000200000000140 R15: 00007f9d296e0320 Modules linked in: ---[ end trace 0000000000000000 ]--- RIP: 0010:kasan_byte_accessible+0x12/0x30 mm/kasan/generic.c:199 Code: 0f 1f 84 00 00 00 00 00 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 66 0f 1f 00 48 c1 ef 03 48 b8 00 00 00 00 00 fc ff df <0f> b6 04 07 3c 08 0f 92 c0 e9 7b 90 ee fe cc 66 66 66 66 66 66 2e RSP: 0018:ffffc9000e3b7840 EFLAGS: 00010012 RAX: dffffc0000000000 RBX: ffffffff8b58a807 RCX: 00aca3f4f9223600 RDX: 0000000000000000 RSI: ffffffff8b58a807 RDI: 0000000000000004 RBP: ffffffff819b49d8 R08: 0000000000000001 R09: 0000000000000000 R10: dffffc0000000000 R11: fffffbfff1efdb2f R12: 0000000000000000 R13: 0000000000000020 R14: 0000000000000020 R15: 0000000000000001 FS: 00007f9d2a2236c0(0000) GS:ffff8881261cb000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 000055555f2ee5c8 CR3: 0000000057c0d000 CR4: 0000000000350ef0 ---------------- Code disassembly (best guess): 0: 0f 1f 84 00 00 00 00 nopl 0x0(%rax,%rax,1) 7: 00 8: 90 nop 9: 90 nop a: 90 nop b: 90 nop c: 90 nop d: 90 nop e: 90 nop f: 90 nop 10: 90 nop 11: 90 nop 12: 90 nop 13: 90 nop 14: 90 nop 15: 90 nop 16: 90 nop 17: 90 nop 18: 66 0f 1f 00 nopw (%rax) 1c: 48 c1 ef 03 shr $0x3,%rdi 20: 48 b8 00 00 00 00 00 movabs $0xdffffc0000000000,%rax 27: fc ff df * 2a: 0f b6 04 07 movzbl (%rdi,%rax,1),%eax <-- trapping instruction 2e: 3c 08 cmp $0x8,%al 30: 0f 92 c0 setb %al 33: e9 7b 90 ee fe jmp 0xfeee90b3 38: cc int3 39: 66 data16 3a: 66 data16 3b: 66 data16 3c: 66 data16 3d: 66 data16 3e: 66 data16 3f: 2e cs