[SRU][J][PATCH 1/1] drm/amdgpu: avoid buffer overflow attach in smu_sys_set_pp_table()
Alice C. Munduruca
alice.munduruca at canonical.com
Wed Jan 28 17:21:40 UTC 2026
From: Jiang Liu <gerry at linux.alibaba.com>
commit 1abb2648698bf10783d2236a6b4a7ca5e8021699 upstream.
It malicious user provides a small pptable through sysfs and then
a bigger pptable, it may cause buffer overflow attack in function
smu_sys_set_pp_table().
Reviewed-by: Lijo Lazar <lijo.lazar at amd.com>
Signed-off-by: Jiang Liu <gerry at linux.alibaba.com>
Signed-off-by: Alex Deucher <alexander.deucher at amd.com>
Cc: stable at vger.kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh at linuxfoundation.org>
(backported from commit 3484ea33157bc7334f57e64826ec5a4bf992151a linux-6.1.129)
[cremfuelled: keep `mutex_lock` to match context and add the
changes around that]
CVE-2025-21780
Signed-off-by: Alice C. Munduruca <alice.munduruca at canonical.com>
---
drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c b/drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c
index 587fdd55e525..1776bd6bf373 100644
--- a/drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c
+++ b/drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c
@@ -520,8 +520,11 @@ static int smu_sys_set_pp_table(void *handle,
}
mutex_lock(&smu->mutex);
- if (!smu_table->hardcode_pptable)
+ if (!smu_table->hardcode_pptable || smu_table->power_play_table_size < size) {
+ kfree(smu_table->hardcode_pptable);
smu_table->hardcode_pptable = kzalloc(size, GFP_KERNEL);
+ }
+
if (!smu_table->hardcode_pptable) {
ret = -ENOMEM;
goto failed;
--
2.51.0
More information about the kernel-team
mailing list