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 7D2A01CABF for ; Fri, 8 Nov 2024 05:24:27 +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=1731043467; cv=none; b=Xpc9/4axJy7q73zwhI/2dcf5Gd42n1mWhLnEtO1Eu3GOpC2Zybp9LJxaSf/bBFGY1LTC/yR6crc6ZogRe2QWHHGKmJp5dOrxrVPniftkypJDsbEbipzEJgizdhVCi1fBir58BMuy8qETzt3SHuJR/jN9K9+K3bIj9IWgXTufDq0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1731043467; c=relaxed/simple; bh=w7UgLsO2Fy1LlE6JNuoTFhk+bfeevLgQ/8fF1VIB/rw=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=ZYOI4qbO3gzr2MJt7sZG5CCk9rUPRWy8nMPoLcpkutR9fQ3IEK2Dr5DA4Y4Jf/22kDH6GtJXLVHmJYvStOq1m9gPLdtQAR2whwXsbH+7x19RvnVnyrzxNvYwvDP4he/1jtWtgKaZarg7zbzTbpF59Mj8lN5xNYqmrrNQDCSfhhc= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=yJBe0AdG; 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="yJBe0AdG" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 9B4ADC4CECF; Fri, 8 Nov 2024 05:24:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1731043467; bh=w7UgLsO2Fy1LlE6JNuoTFhk+bfeevLgQ/8fF1VIB/rw=; h=From:To:Cc:Subject:Date:Reply-to:From; b=yJBe0AdGKt+nRtp0wLrDSw+L1AobIjgow0NqrkHwg2YO1bE6iB1AbdPWrP0XwHSWZ SDjUdGlQv9bkfvuRcm3ow8jN8STksEvufn7PlnNZRy5WIvwG4fU+Kk2f7lXBcaRkO2 BVs8ZDtOk2MjP3hs7EKKfmjIMCeAh2GNLdRulUMg= From: Greg Kroah-Hartman To: linux-cve-announce@vger.kernel.org Cc: Greg Kroah-Hartman Subject: CVE-2024-50177: drm/amd/display: fix a UBSAN warning in DML2.1 Date: Fri, 8 Nov 2024 06:24:08 +0100 Message-ID: <2024110807-CVE-2024-50177-73ee@gregkh> X-Mailer: git-send-email 2.47.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=4002; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=w7UgLsO2Fy1LlE6JNuoTFhk+bfeevLgQ/8fF1VIB/rw=; b=owGbwMvMwCRo6H6F97bub03G02pJDOm6C8rfMGX94rmlc1uQZ3t/ebHT9p/iDAWtZX5TttZHM 9XErd/XEcvCIMjEICumyPJlG8/R/RWHFL0MbU/DzGFlAhnCwMUpABOJ3cqwYHXJvjbZ21zafw4s TD62V0x0GdesYwzzFCI9K9x5w1lVuzr3Xi1kfLPj46JLAA== 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: drm/amd/display: fix a UBSAN warning in DML2.1 When programming phantom pipe, since cursor_width is explicity set to 0, this causes calculation logic to trigger overflow for an unsigned int triggering the kernel's UBSAN check as below: [ 40.962845] UBSAN: shift-out-of-bounds in /tmp/amd.EfpumTkO/amd/amdgpu/../display/dc/dml2/dml21/src/dml2_core/dml2_core_dcn4_calcs.c:3312:34 [ 40.962849] shift exponent 4294967170 is too large for 32-bit type 'unsigned int' [ 40.962852] CPU: 1 PID: 1670 Comm: gnome-shell Tainted: G W OE 6.5.0-41-generic #41~22.04.2-Ubuntu [ 40.962854] Hardware name: Gigabyte Technology Co., Ltd. X670E AORUS PRO X/X670E AORUS PRO X, BIOS F21 01/10/2024 [ 40.962856] Call Trace: [ 40.962857] [ 40.962860] dump_stack_lvl+0x48/0x70 [ 40.962870] dump_stack+0x10/0x20 [ 40.962872] __ubsan_handle_shift_out_of_bounds+0x1ac/0x360 [ 40.962878] calculate_cursor_req_attributes.cold+0x1b/0x28 [amdgpu] [ 40.963099] dml_core_mode_support+0x6b91/0x16bc0 [amdgpu] [ 40.963327] ? srso_alias_return_thunk+0x5/0x7f [ 40.963331] ? CalculateWatermarksMALLUseAndDRAMSpeedChangeSupport+0x18b8/0x2790 [amdgpu] [ 40.963534] ? srso_alias_return_thunk+0x5/0x7f [ 40.963536] ? dml_core_mode_support+0xb3db/0x16bc0 [amdgpu] [ 40.963730] dml2_core_calcs_mode_support_ex+0x2c/0x90 [amdgpu] [ 40.963906] ? srso_alias_return_thunk+0x5/0x7f [ 40.963909] ? dml2_core_calcs_mode_support_ex+0x2c/0x90 [amdgpu] [ 40.964078] core_dcn4_mode_support+0x72/0xbf0 [amdgpu] [ 40.964247] dml2_top_optimization_perform_optimization_phase+0x1d3/0x2a0 [amdgpu] [ 40.964420] dml2_build_mode_programming+0x23d/0x750 [amdgpu] [ 40.964587] dml21_validate+0x274/0x770 [amdgpu] [ 40.964761] ? srso_alias_return_thunk+0x5/0x7f [ 40.964763] ? resource_append_dpp_pipes_for_plane_composition+0x27c/0x3b0 [amdgpu] [ 40.964942] dml2_validate+0x504/0x750 [amdgpu] [ 40.965117] ? dml21_copy+0x95/0xb0 [amdgpu] [ 40.965291] ? srso_alias_return_thunk+0x5/0x7f [ 40.965295] dcn401_validate_bandwidth+0x4e/0x70 [amdgpu] [ 40.965491] update_planes_and_stream_state+0x38d/0x5c0 [amdgpu] [ 40.965672] update_planes_and_stream_v3+0x52/0x1e0 [amdgpu] [ 40.965845] ? srso_alias_return_thunk+0x5/0x7f [ 40.965849] dc_update_planes_and_stream+0x71/0xb0 [amdgpu] Fix this by adding a guard for checking cursor width before triggering the size calculation. The Linux kernel CVE team has assigned CVE-2024-50177 to this issue. Affected and fixed versions =========================== Fixed in 6.11.3 with commit 27bc3da5eae5 Fixed in 6.12-rc1 with commit eaf3adb8faab 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-2024-50177 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/dml2/dml21/src/dml2_core/dml2_core_dcn4_calcs.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/27bc3da5eae57e3af8f5648b4498ffde48781434 https://git.kernel.org/stable/c/eaf3adb8faab611ba57594fa915893fc93a7788c