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 2F18F1BFE00 for ; Tue, 1 Apr 2025 15:41:20 +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=1743522080; cv=none; b=coihV8oHbtgloHhV4Spzg8LkR/960ak3DgOlenkhZn2qGpG+kHGow0p9TEZngrx8FWeNuyqHlSu3Y+dPKTtAvi+pK89bfyPAeMU9hIvyNvFb5goaqQyn5ehndUBJ7R4eBiKvFc/KW4OZCtUbsOOK1hQ27v/9itBZwKogW46mvNc= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1743522080; c=relaxed/simple; bh=SlyaGMAxRg/3apBgLgMQFLr1b/JJvm8J9lmseRE5FJc=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=mS2hXb9h2ZuO1IxMTiKPoQm9kQ15nD5lrHPMNs3O96Xen8/nmri97639Ex/KVrIm5YNjRi7ikdIg+j/caZwTX0UIuorlL1z6xeO3fQPUbeEaYPZARLIOtCkuNds0LRaHVksn0aE4IyH4MhR1vlc8O92/hKIVA8yYOKacV+Sfhns= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=YvzBCEVW; 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="YvzBCEVW" Received: by smtp.kernel.org (Postfix) with ESMTPSA id BBF02C4CEE4; Tue, 1 Apr 2025 15:41:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1743522080; bh=SlyaGMAxRg/3apBgLgMQFLr1b/JJvm8J9lmseRE5FJc=; h=From:To:Cc:Subject:Date:Reply-to:From; b=YvzBCEVWbykDIcgfic3/fAh0kIP0bnGaXtXTaX0KpQh9KmJigzlEwsVjoK0S6deav oEouuNLKGB/Xpfw4hl961DYefWnsUKelKFByrU+iSxhsU71GpPijIbQKcSZOdljyb6 etv2Q96uWZeDAiRVWeVVUG1talTFaMp5lY2rTxeQ= From: Greg Kroah-Hartman To: linux-cve-announce@vger.kernel.org Cc: Greg Kroah-Hartman Subject: CVE-2025-21915: cdx: Fix possible UAF error in driver_override_show() Date: Tue, 1 Apr 2025 16:39:39 +0100 Message-ID: <2025040130-CVE-2025-21915-b56c@gregkh> X-Mailer: git-send-email 2.49.0 Precedence: bulk X-Mailing-List: linux-cve-announce@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Reply-to: , X-Developer-Signature: v=1; a=openpgp-sha256; l=3328; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=SlyaGMAxRg/3apBgLgMQFLr1b/JJvm8J9lmseRE5FJc=; b=owGbwMvMwCRo6H6F97bub03G02pJDOlvODYrz9wiIqJ00rjl5eHAp/+C1QIO3WI79C1708F66 +6iPw+2dMSyMAgyMciKKbJ82cZzdH/FIUUvQ9vTMHNYmUCGMHBxCsBE5u5lmJ/+2PnNtshOO9ZL 815diGti7byt+JBhfgbDsazQWZZ1qd94arwmPhR/suL+HQA= X-Developer-Key: i=gregkh@linuxfoundation.org; a=openpgp; fpr=F4B60CC5BF78C2214A313DCB3147D40DDB2DFB29 Content-Transfer-Encoding: 8bit Description =========== In the Linux kernel, the following vulnerability has been resolved: cdx: Fix possible UAF error in driver_override_show() Fixed a possible UAF problem in driver_override_show() in drivers/cdx/cdx.c This function driver_override_show() is part of DEVICE_ATTR_RW, which includes both driver_override_show() and driver_override_store(). These functions can be executed concurrently in sysfs. The driver_override_store() function uses driver_set_override() to update the driver_override value, and driver_set_override() internally locks the device (device_lock(dev)). If driver_override_show() reads cdx_dev->driver_override without locking, it could potentially access a freed pointer if driver_override_store() frees the string concurrently. This could lead to printing a kernel address, which is a security risk since DEVICE_ATTR can be read by all users. Additionally, a similar pattern is used in drivers/amba/bus.c, as well as many other bus drivers, where device_lock() is taken in the show function, and it has been working without issues. This potential bug was detected by our experimental static analysis tool, which analyzes locking APIs and paired functions to identify data races and atomicity violations. The Linux kernel CVE team has assigned CVE-2025-21915 to this issue. Affected and fixed versions =========================== Issue introduced in 5.10 with commit 1f86a00c1159fd77e66b1bd6ff1a183f4d46f34d and fixed in 6.6.83 with commit d7b339bbc887bcfc1a5b620bfc70c6fbb8f733bf Issue introduced in 5.10 with commit 1f86a00c1159fd77e66b1bd6ff1a183f4d46f34d and fixed in 6.12.19 with commit 8473135f89c0949436a22adb05b8cece2fb3da91 Issue introduced in 5.10 with commit 1f86a00c1159fd77e66b1bd6ff1a183f4d46f34d and fixed in 6.13.7 with commit 0439d541aa8d3444ad41c39e39eb71acb57acde3 Issue introduced in 5.10 with commit 1f86a00c1159fd77e66b1bd6ff1a183f4d46f34d and fixed in 6.14 with commit 91d44c1afc61a2fec37a9c7a3485368309391e0b 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-2025-21915 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/cdx/cdx.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/d7b339bbc887bcfc1a5b620bfc70c6fbb8f733bf https://git.kernel.org/stable/c/8473135f89c0949436a22adb05b8cece2fb3da91 https://git.kernel.org/stable/c/0439d541aa8d3444ad41c39e39eb71acb57acde3 https://git.kernel.org/stable/c/91d44c1afc61a2fec37a9c7a3485368309391e0b