In the Linux kernel, the following vulnerability has been resolved: vsock: fix lock inversion in vsockassigntransport() Syzbot reported a potential lock inversion deadlock between vsockregistermutex and sklock-AFVSOCK when vsocklinger() is called. The issue was introduced by commit 687aa0c5581b ("vsock: Fix transport* TOCTOU") which added vsockregistermutex locking in vsockassigntransport() around the transport->release() call, that can call vsocklinger(). vsockassigntransport() can be called with sklock held. vsocklinger() calls skwaitevent() that temporarily releases and re-acquires sklock. During this window, if another thread hold vsockregistermutex while trying to acquire sklock, a circular dependency is created. Fix this by releasing vsockregistermutex before calling transport->release() and vsockdeassigntransport(). This is safe because we don't need to hold vsockregistermutex while releasing the old transport, and we ensure the new transport won't disappear by obtaining a module reference first via trymodule_get().