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 0F7AE1482E1 for ; Mon, 26 Aug 2024 10:23:29 +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=1724667809; cv=none; b=BzyBUHs9vBFUJY7Gq1+oU+J5HqRRG0FLZ+ATeUuNnibqalhTxCeT0djuaxul8fTQsabIcjs62k0Y5K1DNzaruR17tnauZsNH+WhRB/yvr/dpVFy//h4fjlCIfMwVOi4oqwMuowEOmHF7sYt4PjDPty1ArGy6iK7lz9stPmEdNXI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724667809; c=relaxed/simple; bh=oSXehT8bCEZ94qNEwgEbFj98l70P51sg/jmKwWP288A=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=MaAmWjvIN7hI/M96OIJxI0gVmviRgcWk72iXdsSvo4L2IheFPsyeZGO9kwAxdIZWxElzldb8nCstjQTwEYLrfFtXhkcNhQ74HbXiXNNhhuhJr8oyv3uNifi5ECfH4ldwBFawYrHD2FGAVbHZl4pZ82Hi4Q3TyYZz4+eXZfuM3XY= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=sR/wo+d6; 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="sR/wo+d6" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 8A60DC582AE; Mon, 26 Aug 2024 10:23:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1724667808; bh=oSXehT8bCEZ94qNEwgEbFj98l70P51sg/jmKwWP288A=; h=From:To:Cc:Subject:Date:Reply-to:From; b=sR/wo+d67Or2y93fcci54BCGbj3FrL0cn/UANyld6ZBsRyW5dGjww2bddU5wx0Qjs WI1px5KsdWMxbMnrdg8rGTrHH6nQ/vhb84ymmjYhbuJXXNeq06LeANPPbP5Vz97Kka OhhCJTCr1HcWPKGh9wKlYcsTt+oL/FGn5piZ1wcU= From: Greg Kroah-Hartman To: linux-cve-announce@vger.kernel.org Cc: Greg Kroah-Hartman Subject: CVE-2024-43901: drm/amd/display: Fix NULL pointer dereference for DTN log in DCN401 Date: Mon, 26 Aug 2024 12:17:09 +0200 Message-ID: <2024082617-CVE-2024-43901-6c76@gregkh> X-Mailer: git-send-email 2.46.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=4094; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=oSXehT8bCEZ94qNEwgEbFj98l70P51sg/jmKwWP288A=; b=owGbwMvMwCRo6H6F97bub03G02pJDGlnwvTy27OVu1Wc6hSvcLPU/orYnMO6VG/dLT/pe+qTl s9kCj/YEcvCIMjEICumyPJlG8/R/RWHFL0MbU/DzGFlAhnCwMUpABMJmMAwV+Bn/ZFZTQedUoR0 Ki1bZjFrfnN7zbBg7aUXifsleff/vsHW/HbXZuvnxoLfAA== 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 NULL pointer dereference for DTN log in DCN401 When users run the command: cat /sys/kernel/debug/dri/0/amdgpu_dm_dtn_log The following NULL pointer dereference happens: [ +0.000003] BUG: kernel NULL pointer dereference, address: NULL [ +0.000005] #PF: supervisor instruction fetch in kernel mode [ +0.000002] #PF: error_code(0x0010) - not-present page [ +0.000002] PGD 0 P4D 0 [ +0.000004] Oops: 0010 [#1] PREEMPT SMP NOPTI [ +0.000003] RIP: 0010:0x0 [ +0.000008] Code: Unable to access opcode bytes at 0xffffffffffffffd6. [...] [ +0.000002] PKRU: 55555554 [ +0.000002] Call Trace: [ +0.000002] [ +0.000003] ? show_regs+0x65/0x70 [ +0.000006] ? __die+0x24/0x70 [ +0.000004] ? page_fault_oops+0x160/0x470 [ +0.000006] ? do_user_addr_fault+0x2b5/0x690 [ +0.000003] ? prb_read_valid+0x1c/0x30 [ +0.000005] ? exc_page_fault+0x8c/0x1a0 [ +0.000005] ? asm_exc_page_fault+0x27/0x30 [ +0.000012] dcn10_log_color_state+0xf9/0x510 [amdgpu] [ +0.000306] ? srso_alias_return_thunk+0x5/0xfbef5 [ +0.000003] ? vsnprintf+0x2fb/0x600 [ +0.000009] dcn10_log_hw_state+0xfd0/0xfe0 [amdgpu] [ +0.000218] ? __mod_memcg_lruvec_state+0xe8/0x170 [ +0.000008] ? srso_alias_return_thunk+0x5/0xfbef5 [ +0.000002] ? debug_smp_processor_id+0x17/0x20 [ +0.000003] ? srso_alias_return_thunk+0x5/0xfbef5 [ +0.000002] ? srso_alias_return_thunk+0x5/0xfbef5 [ +0.000002] ? set_ptes.isra.0+0x2b/0x90 [ +0.000004] ? srso_alias_return_thunk+0x5/0xfbef5 [ +0.000002] ? _raw_spin_unlock+0x19/0x40 [ +0.000004] ? srso_alias_return_thunk+0x5/0xfbef5 [ +0.000002] ? do_anonymous_page+0x337/0x700 [ +0.000004] dtn_log_read+0x82/0x120 [amdgpu] [ +0.000207] full_proxy_read+0x66/0x90 [ +0.000007] vfs_read+0xb0/0x340 [ +0.000005] ? __count_memcg_events+0x79/0xe0 [ +0.000002] ? srso_alias_return_thunk+0x5/0xfbef5 [ +0.000003] ? count_memcg_events.constprop.0+0x1e/0x40 [ +0.000003] ? handle_mm_fault+0xb2/0x370 [ +0.000003] ksys_read+0x6b/0xf0 [ +0.000004] __x64_sys_read+0x19/0x20 [ +0.000003] do_syscall_64+0x60/0x130 [ +0.000004] entry_SYSCALL_64_after_hwframe+0x6e/0x76 [ +0.000003] RIP: 0033:0x7fdf32f147e2 [...] This error happens when the color log tries to read the gamut remap information from DCN401 which is not initialized in the dcn401_dpp_funcs which leads to a null pointer dereference. This commit addresses this issue by adding a proper guard to access the gamut_remap callback in case the specific ASIC did not implement this function. The Linux kernel CVE team has assigned CVE-2024-43901 to this issue. Affected and fixed versions =========================== Fixed in 6.10.5 with commit 1e68b7ce6bc6 Fixed in 6.11-rc1 with commit 5af757124792 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-43901 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/hwss/dcn10/dcn10_hwseq.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/1e68b7ce6bc6073579fe8713ec6b85aa9cd2e351 https://git.kernel.org/stable/c/5af757124792817f8eb1bd0c80ad60fab519586b