[PATCH 1/2] acpi: msct: fix incorrect length check on max proximity domains
Ivan Hu
ivan.hu at canonical.com
Thu Sep 11 06:57:27 UTC 2025
Buglink: https://bugs.launchpad.net/fwts/+bug/2121792
The total length should be checked for whether exceeding the maximum
possible proximity domain included rather than checking if it is
shorter.
Signed-off-by: Ivan Hu <ivan.hu at canonical.com>
---
src/acpi/msct/msct.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/src/acpi/msct/msct.c b/src/acpi/msct/msct.c
index fa52db2f..e8a83ea9 100644
--- a/src/acpi/msct/msct.c
+++ b/src/acpi/msct/msct.c
@@ -56,12 +56,12 @@ static int msct_test1(fwts_framework *fw)
} else
offset_proximity = msct->proximity_offset;
- if (offset_proximity + sizeof(fwts_acpi_msct_proximity) *
- msct->max_proximity_domains > msct->header.length) {
+ if (msct->header.length > offset_proximity + sizeof(fwts_acpi_msct_proximity) *
+ (msct->max_proximity_domains + 1)) {
fwts_failed(fw, LOG_LEVEL_MEDIUM,
"MSCTBadTableLength",
- "MSCT Table is too small to include maximum number of "
- "Proximity Domains");
+ "MSCT table length is larger than expected for the offset "
+ "that includes the maximum number of proximity domains");
passed = false;
}
--
2.34.1
More information about the fwts-devel
mailing list