]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
6.12-stable patches
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 26 Oct 2025 15:00:37 +0000 (16:00 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 26 Oct 2025 15:00:37 +0000 (16:00 +0100)
added patches:
platform-x86-amd-hsmp-ensure-sock-metric_tbl_addr-is-non-null.patch

queue-6.12/platform-x86-amd-hsmp-ensure-sock-metric_tbl_addr-is-non-null.patch [new file with mode: 0644]
queue-6.12/series

diff --git a/queue-6.12/platform-x86-amd-hsmp-ensure-sock-metric_tbl_addr-is-non-null.patch b/queue-6.12/platform-x86-amd-hsmp-ensure-sock-metric_tbl_addr-is-non-null.patch
new file mode 100644 (file)
index 0000000..671e925
--- /dev/null
@@ -0,0 +1,41 @@
+From 2c78fb287e1f430b929f2e49786518350d15605c Mon Sep 17 00:00:00 2001
+From: Suma Hegde <suma.hegde@amd.com>
+Date: Thu, 7 Aug 2025 10:06:37 +0000
+Subject: platform/x86/amd/hsmp: Ensure sock->metric_tbl_addr is non-NULL
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+From: Suma Hegde <suma.hegde@amd.com>
+
+commit 2c78fb287e1f430b929f2e49786518350d15605c upstream.
+
+If metric table address is not allocated, accessing metrics_bin will
+result in a NULL pointer dereference, so add a check.
+
+Fixes: 5150542b8ec5 ("platform/x86/amd/hsmp: add support for metrics tbl")
+Signed-off-by: Suma Hegde <suma.hegde@amd.com>
+Link: https://lore.kernel.org/r/20250807100637.952729-1-suma.hegde@amd.com
+Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
+Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
+[ Minor context change fixed. ]
+Signed-off-by: Alva Lan <alvalan9@foxmail.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ drivers/platform/x86/amd/hsmp.c |    5 +++++
+ 1 file changed, 5 insertions(+)
+
+--- a/drivers/platform/x86/amd/hsmp.c
++++ b/drivers/platform/x86/amd/hsmp.c
+@@ -569,6 +569,11 @@ static ssize_t hsmp_metric_tbl_read(stru
+       if (!sock)
+               return -EINVAL;
++      if (!sock->metric_tbl_addr) {
++              dev_err(sock->dev, "Metrics table address not available\n");
++              return -ENOMEM;
++      }
++
+       /* Do not support lseek(), reads entire metric table */
+       if (count < bin_attr->size) {
+               dev_err(sock->dev, "Wrong buffer size\n");
index 5ce5b52d2e3b9209373a689a0a4c9d6c21c44b68..8321f2267bc42bfac71aa5f07bb96acc35c2d4d6 100644 (file)
@@ -90,3 +90,4 @@ sched-remove-never-used-code-in-mm_cid_get.patch
 io_uring-sqpoll-switch-away-from-getrusage-for-cpu-accounting.patch
 io_uring-sqpoll-be-smarter-on-when-to-update-the-stime-usage.patch
 bluetooth-btintel-add-dsbr-support-for-blazariw-blazaru-and-gap.patch
+platform-x86-amd-hsmp-ensure-sock-metric_tbl_addr-is-non-null.patch