CVE-2026-64340: USB: legousbtower: fix use-after-free on disconnect race

Greg Kroah-Hartman <[email protected]> Sat, 25 Jul 2026 10:49:17 +0200
Newsgroups org.kernel.vger.linux-cve-announce
Message-ID <2026072515-CVE-2026-64340-1720@gregkh>
From: Greg Kroah-Hartman <[email protected]>

Description
===========

In the Linux kernel, the following vulnerability has been resolved:

USB: legousbtower: fix use-after-free on disconnect race

mutex_unlock() may access the mutex structure after releasing the lock
and therefore cannot be used to manage lifetime of objects directly
(unlike spinlocks and refcounts). [1][2]

Use a kref to release the driver data to avoid use-after-free in
mutex_unlock() when release() races with disconnect().

[1] a51749ab34d9 ("locking/mutex: Document that mutex_unlock() is
                   non-atomic")
[2] 2b9d9e0a9ba0 ("locking/mutex: Clarify that mutex_unlock(), and most
                   other sleeping locks, can still use the lock object
                   after it's unlocked")

The Linux kernel CVE team has assigned CVE-2026-64340 to this issue.


Affected and fixed versions
===========================

	Issue introduced in 2.6.25 with commit 18bcbcfe9ca2308ebffb40068b51803da9315d97 and fixed in 5.10.261 with commit 11d069f85851997b4ea0adf242ed9672dc749b8f
	Issue introduced in 2.6.25 with commit 18bcbcfe9ca2308ebffb40068b51803da9315d97 and fixed in 5.15.212 with commit b4222c05066b252b451f9c8c4730b5b60824ea66
	Issue introduced in 2.6.25 with commit 18bcbcfe9ca2308ebffb40068b51803da9315d97 and fixed in 6.1.178 with commit 6462de75d2e370c7e74dcfb7b4ae79eb5a6a55ee
	Issue introduced in 2.6.25 with commit 18bcbcfe9ca2308ebffb40068b51803da9315d97 and fixed in 6.6.145 with commit 0b57e5ddbd89df3bc367463de3d2ca66f99a1a5e
	Issue introduced in 2.6.25 with commit 18bcbcfe9ca2308ebffb40068b51803da9315d97 and fixed in 6.12.96 with commit ab2bfd7bec4f134b377ec42f513e90c35db94160
	Issue introduced in 2.6.25 with commit 18bcbcfe9ca2308ebffb40068b51803da9315d97 and fixed in 6.18.39 with commit 766738ecf2b819e54d38763c8d1c8ae6cff14b39
	Issue introduced in 2.6.25 with commit 18bcbcfe9ca2308ebffb40068b51803da9315d97 and fixed in 7.1.4 with commit 9ba62966461a8e3cc593b62c56ec62eb2d80436d
	Issue introduced in 2.6.25 with commit 18bcbcfe9ca2308ebffb40068b51803da9315d97 and fixed in 7.2-rc3 with commit 62fc8eb1b1481051f7bab4aa93d79809053dd09f

Please see https://www.kernel.org for a full list of currently supported
kernel versions by the kernel community.

Unaffected versions might change over time as fixes are backported to
older supported kernel versions.  The official CVE entry at
	https://cve.org/CVERecord/?id=CVE-2026-64340
will be updated if fixes are backported, please check that for the most
up to date information about this issue.


Affected files
==============

The file(s) affected by this issue are:
	drivers/usb/misc/legousbtower.c


Mitigation
==========

The Linux kernel CVE team recommends that you update to the latest
stable kernel version for this, and many other bugfixes.  Individual
changes are never tested alone, but rather are part of a larger kernel
release.  Cherry-picking individual commits is not recommended or
supported by the Linux kernel community at all.  If however, updating to
the latest release is impossible, the individual changes to resolve this
issue can be found at these commits:
	https://git.kernel.org/stable/c/11d069f85851997b4ea0adf242ed9672dc749b8f
	https://git.kernel.org/stable/c/b4222c05066b252b451f9c8c4730b5b60824ea66
	https://git.kernel.org/stable/c/6462de75d2e370c7e74dcfb7b4ae79eb5a6a55ee
	https://git.kernel.org/stable/c/0b57e5ddbd89df3bc367463de3d2ca66f99a1a5e
	https://git.kernel.org/stable/c/ab2bfd7bec4f134b377ec42f513e90c35db94160
	https://git.kernel.org/stable/c/766738ecf2b819e54d38763c8d1c8ae6cff14b39
	https://git.kernel.org/stable/c/9ba62966461a8e3cc593b62c56ec62eb2d80436d
	https://git.kernel.org/stable/c/62fc8eb1b1481051f7bab4aa93d79809053dd09f