Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 6AF933E3C40 for ; Mon, 27 Apr 2026 17:32:43 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1777311163; cv=none; b=s/GRbz0Bkvv6xPsj51H9oZdXKRVqKPsK5HPFrapeNYZW3b5+DPrVlesltoujuHtHFKWSPa0XzgsQukFUJ4GIuXexBvD5dw/vAiSYvXx0ELkBrgb+oBWWbu5uwpwVFGe6lU9IMLWOhgbNoyJ30yU4kortsXKZHsMU5yDNM3wt3/8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1777311163; c=relaxed/simple; bh=8KngWACFk573j+A200T8H3YVCsb6E/Oq/eRm9hiKsuU=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=MoLWVzTyqd422fSYRh0BGp2HYjwtM6P4c5k6+cjvjp80x9OAPtLVQXzQg90G4awny1RcQ4Ume7lXFRdEtuLNWxlu+a0Kl5N4nC/NHyha4MEj52d2Ccbv8JqV/CKM3gr+LgW/ff+q1ScvQhvf4lUKfqPHox45yLMWCZ1runwDOwQ= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=X/jJ2H0k; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="X/jJ2H0k" Received: by smtp.kernel.org (Postfix) with ESMTPSA id CF66CC19425; Mon, 27 Apr 2026 17:32:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1777311163; bh=8KngWACFk573j+A200T8H3YVCsb6E/Oq/eRm9hiKsuU=; h=From:To:Cc:Subject:Date:Reply-To:From; b=X/jJ2H0kKXYOTmz1xaQ+LWQT0XMST5cygz28ZHo3sdVB8Xpk1N0hyJw0QW/qO0THB QMPrnrYjoNnkxF7a9azcYF0uCLjeMRx8uzMcGjEapcKR79Nm1JzUwZ2ZivEYw9W6OF On9GdiKWErgORd/kikZhXLdFhjZUmD7YPQgL4+nk= From: Greg Kroah-Hartman To: linux-cve-announce@vger.kernel.org Cc: Greg Kroah-Hartman Subject: CVE-2026-31688: driver core: enforce device_lock for driver_match_device() Date: Mon, 27 Apr 2026 11:32:08 -0600 Message-ID: <2026042706-CVE-2026-31688-1f56@gregkh> X-Mailer: git-send-email 2.54.0 Reply-To: , Precedence: bulk X-Mailing-List: linux-cve-announce@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=2531; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=yt5UtIE7Ox2McO0/3IKypzxeZHBLmqCDNrAEYTWzCHA=; b=owGbwMvMwCRo6H6F97bub03G02pJDJnv506TnGNZX1e16UVLz26umPXRgaKdDfbu8k03di8wv 3KJZcnxjlgWBkEmBlkxRZYv23iO7q84pOhlaHsaZg4rE8gQBi5OAZiIQx3Dgpv5x+RdJuYyzJCo 900w4zLbvTO8lmGegbzppNpifs0lT/X1pl/jW+w2d78aAA== X-Developer-Key: i=gregkh@linuxfoundation.org; a=openpgp; fpr=F4B60CC5BF78C2214A313DCB3147D40DDB2DFB29 Content-Transfer-Encoding: 8bit From: Greg Kroah-Hartman Description =========== In the Linux kernel, the following vulnerability has been resolved: driver core: enforce device_lock for driver_match_device() Currently, driver_match_device() is called from three sites. One site (__device_attach_driver) holds device_lock(dev), but the other two (bind_store and __driver_attach) do not. This inconsistency means that bus match() callbacks are not guaranteed to be called with the lock held. Fix this by introducing driver_match_device_locked(), which guarantees holding the device lock using a scoped guard. Replace the unlocked calls in bind_store() and __driver_attach() with this new helper. Also add a lock assertion to driver_match_device() to enforce this guarantee. This consistency also fixes a known race condition. The driver_override implementation relies on the device_lock, so the missing lock led to the use-after-free (UAF) reported in Bugzilla for buses using this field. Stress testing the two newly locked paths for 24 hours with CONFIG_PROVE_LOCKING and CONFIG_LOCKDEP enabled showed no UAF recurrence and no lockdep warnings. The Linux kernel CVE team has assigned CVE-2026-31688 to this issue. Affected and fixed versions =========================== Issue introduced in 2.6.30 with commit 49b420a13ff95b449947181190b08367348e3e1b and fixed in 7.0 with commit dc23806a7c47ec5f1293aba407fb69519f976ee0 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-31688 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/base/base.h drivers/base/bus.c drivers/base/dd.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/dc23806a7c47ec5f1293aba407fb69519f976ee0