From mboxrd@z Thu Jan 1 00:00:00 1970 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 8B086306B3C for ; Wed, 12 Nov 2025 10:24:39 +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=1762943079; cv=none; b=pZ3vbWL3RPOJR+IfWQcx/RCos98pD+lTD1e3FH3/KK0c/aIAN2g04VHKjTAH2qJ40MnVFL/3xTygW9KVfy2y8mKIJ4MJsrNfLlGxFWiF9b6uMxkV9NxoT+nY7Cc0AF0a9JCVNUtPdgypZL8XB9g5WhWSQHPy9UjaKR8neOWVsyQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1762943079; c=relaxed/simple; bh=XG2ymlPhwMDNoyO8wgdYe3TBKb9Vm+5FXzsAY7wIJ2U=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=i+Im52aQScy17uQyHGOMqFOAJwisgnckgI7PYaOeb8enLO/4eJt2Tqlboheeza26WIo5y9HK0atFOQQWKNvZcfmGo+kxoWm5gd8hBRGTguFbrLyB5oF7CBABT+Wyv7aNE7JOmZ2CVi6XjBkrzzBt/p/Yid5KfJc7rtnPcioDiWo= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=mWXp+Hhz; 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="mWXp+Hhz" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 4CFF1C16AAE; Wed, 12 Nov 2025 10:24:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1762943079; bh=XG2ymlPhwMDNoyO8wgdYe3TBKb9Vm+5FXzsAY7wIJ2U=; h=From:To:Cc:Subject:Date:Reply-to:From; b=mWXp+HhzudTs5HDFEG9KC2q6JuMiElutbHGRu4E7OCpJ+Inl/U9f9ojzSwFYg4r8B w5KaFtrlNzclHV/Rm/hlt9fBooqEiZejf8Ha5n8nyqKXeBP58/HoyIiN03N/XBs3Lv n1YAtMww9grST1SdgEUKfDFXDyBY0ZMmUbp4AGL4= From: Greg Kroah-Hartman To: linux-cve-announce@vger.kernel.org Cc: Greg Kroah-Hartman Subject: CVE-2025-40148: drm/amd/display: Add NULL pointer checks in dc_stream cursor attribute functions Date: Wed, 12 Nov 2025 19:24:24 +0900 Message-ID: <2025111257-CVE-2025-40148-eef5@gregkh> X-Mailer: git-send-email 2.51.2 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=3627; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=vTQrj8a8xuhkRwumQbTtxqYNMzufL3YsNCw0xeq6x50=; b=owGbwMvMwCRo6H6F97bub03G02pJDJkiCbat57mKxFOS6pa8+WzcOfHqkkrvzymLfip7pJ4I5 ztp/8KvI5aFQZCJQVZMkeXLNp6j+ysOKXoZ2p6GmcPKBDKEgYtTACayMplhwfVMtrKL7k9ma8zv +pG79Peh/efaZjHMFQna886Zbd0LaQXTmvVtHw/5iX/2BAA= 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: drm/amd/display: Add NULL pointer checks in dc_stream cursor attribute functions The function dc_stream_set_cursor_attributes() currently dereferences the `stream` pointer and nested members `stream->ctx->dc->current_state` without checking for NULL. All callers of these functions, such as in `dcn30_apply_idle_power_optimizations()` and `amdgpu_dm_plane_handle_cursor_update()`, already perform NULL checks before calling these functions. Fixes below: drivers/gpu/drm/amd/amdgpu/../display/dc/core/dc_stream.c:336 dc_stream_program_cursor_attributes() error: we previously assumed 'stream' could be null (see line 334) drivers/gpu/drm/amd/amdgpu/../display/dc/core/dc_stream.c 327 bool dc_stream_program_cursor_attributes( 328 struct dc_stream_state *stream, 329 const struct dc_cursor_attributes *attributes) 330 { 331 struct dc *dc; 332 bool reset_idle_optimizations = false; 333 334 dc = stream ? stream->ctx->dc : NULL; ^^^^^^ The old code assumed stream could be NULL. 335 --> 336 if (dc_stream_set_cursor_attributes(stream, attributes)) { ^^^^^^ The refactor added an unchecked dereference. drivers/gpu/drm/amd/amdgpu/../display/dc/core/dc_stream.c 313 bool dc_stream_set_cursor_attributes( 314 struct dc_stream_state *stream, 315 const struct dc_cursor_attributes *attributes) 316 { 317 bool result = false; 318 319 if (dc_stream_check_cursor_attributes(stream, stream->ctx->dc->current_state, attributes)) { ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Here. This function used to check for if stream as NULL and return false at the start. Probably we should add that back. The Linux kernel CVE team has assigned CVE-2025-40148 to this issue. Affected and fixed versions =========================== Issue introduced in 6.16 with commit 4465dd0e41e8223a46a41ce4fcdfc55fabd319d8 and fixed in 6.17.3 with commit 01e793e7d4d402c473f1a61ca5824f086693be65 Issue introduced in 6.16 with commit 4465dd0e41e8223a46a41ce4fcdfc55fabd319d8 and fixed in 6.18-rc1 with commit bf4e4b97d0fdc66f04fc19d807e24dd8421b8f11 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-40148 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/gpu/drm/amd/display/dc/core/dc_stream.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/01e793e7d4d402c473f1a61ca5824f086693be65 https://git.kernel.org/stable/c/bf4e4b97d0fdc66f04fc19d807e24dd8421b8f11