From bec908240b34ca85c3b30ba6a0644e64a8d1aa47 Mon Sep 17 00:00:00 2001 From: Sathisha S Date: Thu, 26 Feb 2026 10:06:08 +0000 Subject: [PATCH] dmicheck: Fix SMBIOS table size boundary check Allow actual SMBIOS table size to equal maximum size as permitted by the SMBIOS specification; only treat sizes exceeding the maximum as error. Signed-off-by: Sathisha S Change-Id: Ifa045f03b317c9a3d55a20c88af1d99d735a3784 --- SystemReady-band/build-scripts/get_source.sh | 1 + ...check-fix-smbios-table-size-boundary-check.patch | 13 +++++++++++++ 2 files changed, 14 insertions(+) create mode 100644 SystemReady-band/patches/0001-dmicheck-fix-smbios-table-size-boundary-check.patch diff --git a/SystemReady-band/build-scripts/get_source.sh b/SystemReady-band/build-scripts/get_source.sh index b7e8bfa6..4bd70390 100755 --- a/SystemReady-band/build-scripts/get_source.sh +++ b/SystemReady-band/build-scripts/get_source.sh @@ -209,6 +209,7 @@ get_buildroot_src() exit 1 fi pushd $TOP_DIR/buildroot/package/fwts + cp $TOP_DIR/patches/0001-dmicheck-fix-smbios-table-size-boundary-check.patch $TOP_DIR/buildroot/package/fwts echo "Applying Buildroot FWTS patch..." # patch buildroot config git apply $TOP_DIR/../common/patches/build_fwts_version_${FWTS_VERSION}.patch diff --git a/SystemReady-band/patches/0001-dmicheck-fix-smbios-table-size-boundary-check.patch b/SystemReady-band/patches/0001-dmicheck-fix-smbios-table-size-boundary-check.patch new file mode 100644 index 00000000..aba2e814 --- /dev/null +++ b/SystemReady-band/patches/0001-dmicheck-fix-smbios-table-size-boundary-check.patch @@ -0,0 +1,13 @@ +diff --git a/src/dmi/dmicheck/dmicheck.c b/src/dmi/dmicheck/dmicheck.c +index 1eab8360..621b0677 100644 +--- a/src/dmi/dmicheck/dmicheck.c ++++ b/src/dmi/dmicheck/dmicheck.c +@@ -378,7 +378,7 @@ static int dmi_load_file_variable_size( + return FWTS_ERROR; + + for (p = buf, total = count = 0; ; p += count) { +- if (total >= sz) { ++ if (total > sz) { + close(fd); + return FWTS_ERROR; + }