In the Linux kernel, the following vulnerability has been resolved: can: j1939: make j1939sessionactivate() fail if device is no longer registered syzbot is still reporting unregisternetdevice: waiting for vcan0 to become free. Usage count = 2 even after commit 93a27b5891b8 ("can: j1939: add missing calls in NETDEVUNREGISTER notification handler") was added. A debug printk() patch found that j1939sessionactivate() can succeed even after j1939cancelactivesession() from j1939netdevnotify(NETDEVUNREGISTER) has completed. Since j1939cancelactivesession() is processed with the session list lock held, checking ndev->regstate in j1939sessionactivate() with the session list lock held can reliably close the race window.