diff options
author | Kees Cook <kees@outflux.net> | 2023-03-01 14:43:22 -0800 |
---|---|---|
committer | Kees Cook <kees@outflux.net> | 2023-03-02 11:03:42 -0800 |
commit | e66decc6fca36b59194b0947d87d6a9bec078bc3 (patch) | |
tree | 44df009bd543ff37381c20fe63bc570e21a5f403 /source | |
parent | 44f1af0664599e87bebc3a1260692baa27b2f264 (diff) | |
download | acpica-e66decc6fca36b59194b0947d87d6a9bec078bc3.tar.gz |
ACPI_NFIT_INTERLEAVE: Replace 1-element array with flexible array
Similar to commit 7ba2f3d91a32 ("Replace one-element array with
flexible-array"), replace the 1-element array with a proper
flexible array member as defined by C99. This allows the code to
operate without tripping compile-time and run-time bounds checkers
(e.g. via __builtin_object_size(), -fsanitize=bounds, and/or
-fstrict-flex-arrays=3).
Unlike ACPI_NFIT_FLUSH_ADDRESS and ACPI_NFIT_SMBIOS, which had their
sizeof() uses adjusted in code, ACPI_NFIT_INTERLEAVE did not. This appears
to have been a bug. After this change, there is a binary difference in
AcpiDmDumpNfit() since the size of the structure now has the correct size,
as the prior result was including the trailing U32:
- mov $0x14,%ebp
+ mov $0x10,%ebp
Signed-off-by: Kees Cook <kees@outflux.net>
Diffstat (limited to 'source')
-rw-r--r-- | source/include/actbl2.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/source/include/actbl2.h b/source/include/actbl2.h index 6f13261a6..c594658ac 100644 --- a/source/include/actbl2.h +++ b/source/include/actbl2.h @@ -2045,7 +2045,7 @@ typedef struct acpi_nfit_interleave UINT16 Reserved; /* Reserved, must be zero */ UINT32 LineCount; UINT32 LineSize; - UINT32 LineOffset[1]; /* Variable length */ + UINT32 LineOffset[]; /* Variable length */ } ACPI_NFIT_INTERLEAVE; |