In the Linux kernel, the following vulnerability has been resolved:
platform/chrome: crosusbpdnotify: Fix error handling in crosusbpdnotify_init()
The following WARNING message was given when rmmod crosusbpdnotify:
Unexpected driver unregister! WARNING: CPU: 0 PID: 253 at drivers/base/driver.c:270 driverunregister+0x8a/0xb0 Modules linked in: crosusbpdnotify(-) CPU: 0 PID: 253 Comm: rmmod Not tainted 6.1.0-rc3 #24 ... Call Trace: <TASK> crosusbpdnotifyexit+0x11/0x1e [crosusbpdnotify] _x64sysdeletemodule+0x3c7/0x570 ? _ia32sysdeletemodule+0x570/0x570 ? lockisheldtype+0xe3/0x140 ? syscallenterfromusermode+0x17/0x50 ? rcureadlockschedheld+0xa0/0xd0 ? syscallenterfromusermode+0x1c/0x50 dosyscall64+0x37/0x90 entrySYSCALL64after_hwframe+0x63/0xcd RIP: 0033:0x7f333fe9b1b7
The reason is that the crosusbpdnotifyinit() does not check the return value of platformdriverregister(), and the crosusbpdnotify can install successfully even if platformdriver_register() failed.
Fix by checking the return value of platformdriverregister() and unregister crosusbpdnotifyplatdriver when it failed.