summaryrefslogtreecommitdiffstats
path: root/drivers/firmware/dmi_scan.c
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-08-07 13:14:31 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-08-07 13:14:31 +0000
commite97aca3557601e6e343dcf391aa876321f48ac39 (patch)
treee7db4542359bc8b48518df7fe28fd09c7543eea1 /drivers/firmware/dmi_scan.c
parentReleasing progress-linux version 6.9.8-1~progress7.99u1. (diff)
downloadlinux-e97aca3557601e6e343dcf391aa876321f48ac39.tar.xz
linux-e97aca3557601e6e343dcf391aa876321f48ac39.zip
Merging upstream version 6.9.9.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'drivers/firmware/dmi_scan.c')
-rw-r--r--drivers/firmware/dmi_scan.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/drivers/firmware/dmi_scan.c b/drivers/firmware/dmi_scan.c
index 015c95a825..ac2a5d2d47 100644
--- a/drivers/firmware/dmi_scan.c
+++ b/drivers/firmware/dmi_scan.c
@@ -102,6 +102,17 @@ static void dmi_decode_table(u8 *buf,
const struct dmi_header *dm = (const struct dmi_header *)data;
/*
+ * If a short entry is found (less than 4 bytes), not only it
+ * is invalid, but we cannot reliably locate the next entry.
+ */
+ if (dm->length < sizeof(struct dmi_header)) {
+ pr_warn(FW_BUG
+ "Corrupted DMI table, offset %zd (only %d entries processed)\n",
+ data - buf, i);
+ break;
+ }
+
+ /*
* We want to know the total length (formatted area and
* strings) before decoding to make sure we won't run off the
* table in dmi_decode or dmi_string