WARNING in driver_unregister

Status: upstream: reported C repro on 2022/05/27 09:25
Fix commit: f2d8c2606825 usb: gadget: Fix non-unique driver names in raw-gadget driver
Patched on: [ci-qemu-upstream ci-qemu-upstream-386 ci-qemu2-arm32 ci-qemu2-arm64 ci-qemu2-arm64-compat ci-qemu2-arm64-mte ci-upstream-gce-leak ci-upstream-kasan-gce ci-upstream-kasan-gce-386 ci-upstream-kasan-gce-root ci-upstream-kasan-gce-selinux-root ci-upstream-kasan-gce-smack-root ci-upstream-linux-next-kasan-gce-root ci2-upstream-kcsan-gce], missing on: [ci-qemu2-riscv64 ci-upstream-bpf-kasan-gce ci-upstream-bpf-next-kasan-gce ci-upstream-kmsan-gce ci-upstream-kmsan-gce-386 ci-upstream-net-kasan-gce ci-upstream-net-this-kasan-gce ci2-upstream-usb]
First crash: 34d, last: 34d
Patch testing requests:
Created Duration User Patch Repo Result
2022/05/28 20:22 16m patch 97fa5887cf28 OK
2022/05/28 17:23 19m patch 97fa5887cf28 OK
2022/05/28 16:26 14m patch 97fa5887cf28 report log
2022/05/28 14:45 11m patch 97fa5887cf28 error
2022/05/28 02:31 21m patch 97fa5887cf28 OK
2022/05/27 19:14 14m patch 97fa5887cf28 report log

Sample crash report:
kobject_add_internal failed for raw-gadget with -EEXIST, don't try to register things with the same name in the same directory.
UDC core: USB Raw Gadget: driver registration failed: -17
misc raw-gadget: fail, usb_gadget_register_driver returned -17
------------[ cut here ]------------
Unexpected driver unregister!
WARNING: CPU: 0 PID: 1308 at drivers/base/driver.c:194 driver_unregister drivers/base/driver.c:194 [inline]
WARNING: CPU: 0 PID: 1308 at drivers/base/driver.c:194 driver_unregister+0x8c/0xb0 drivers/base/driver.c:191
Modules linked in:
CPU: 0 PID: 1308 Comm: syz-executor314 Not tainted 5.18.0-rc5-syzkaller-00157-g97fa5887cf28 #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
RIP: 0010:driver_unregister drivers/base/driver.c:194 [inline]
RIP: 0010:driver_unregister+0x8c/0xb0 drivers/base/driver.c:191
Code: 68 4c 89 e7 e8 65 b9 db fe 48 89 ef e8 fd a0 ff ff 5d 41 5c e9 75 fa 78 fe e8 70 fa 78 fe 48 c7 c7 80 7a 81 86 e8 12 96 ee 02 <0f> 0b 5d 41 5c e9 5a fa 78 fe e8 75 93 ad fe eb 96 e8 6e 93 ad fe
RSP: 0018:ffffc90001087a78 EFLAGS: 00010282
RAX: 0000000000000000 RBX: ffff88811d184050 RCX: 0000000000000000
RDX: ffff88810902d580 RSI: ffffffff812bdce8 RDI: fffff52000210f41
RBP: ffff88811d184098 R08: 0000000000000000 R09: 0000000000000000
R10: ffffffff812b86be R11: 0000000000000000 R12: 0000000000000000
R13: ffff88811d184008 R14: ffff88811d05b1a8 R15: ffff8881008456a0
FS:  0000000000000000(0000) GS:ffff8881f6800000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00007fea994ab2d0 CR3: 0000000007825000 CR4: 00000000003506f0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
Call Trace:
 usb_gadget_unregister_driver+0x48/0x70 drivers/usb/gadget/udc/core.c:1590
 raw_release+0x18a/0x290 drivers/usb/gadget/legacy/raw_gadget.c:401
 __fput+0x277/0x9d0 fs/file_table.c:317
 task_work_run+0xdd/0x1a0 kernel/task_work.c:164
 exit_task_work include/linux/task_work.h:37 [inline]
 do_exit+0xaff/0x2980 kernel/exit.c:795
 do_group_exit+0xd2/0x2f0 kernel/exit.c:925
 get_signal+0x22df/0x24c0 kernel/signal.c:2864
 arch_do_signal_or_restart+0x82/0x20f0 arch/x86/kernel/signal.c:867
 exit_to_user_mode_loop kernel/entry/common.c:166 [inline]
 exit_to_user_mode_prepare+0x156/0x200 kernel/entry/common.c:201
 __syscall_exit_to_user_mode_work kernel/entry/common.c:283 [inline]
 syscall_exit_to_user_mode+0x19/0x60 kernel/entry/common.c:294
 do_syscall_64+0x42/0xb0 arch/x86/entry/common.c:86
RIP: 0033:0x7fea99520a57
Code: Unable to access opcode bytes at RIP 0x7fea99520a2d.
RSP: 002b:00007fea994aa258 EFLAGS: 00000246 ORIG_RAX: 0000000000000010
RAX: ffffffffffffffef RBX: 00007fea994ab2d0 RCX: 00007fea99520a57
RDX: 0000000000000000 RSI: 0000000000005501 RDI: 0000000000000003
RBP: 0000000000000000 R08: 000000000000ffff R09: 000000000000000b
R10: 00007fea994aa300 R11: 0000000000000246 R12: 00007fea995a55e0
R13: 00007fea994aa2a0 R14: 00007fea994ac400 R15: 0000000000000003

Crashes (1):
Manager Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Title
ci2-upstream-usb 2022/05/23 09:17 usb-testing 97fa5887cf28 7268fa62 .config log report syz C WARNING in driver_unregister