Skip to contentSkip to conversation

acpi: Replace struct acpi_table_slit 1-element array with flex-array

PATCH Applied Wyes Karny 3 participants 4 messages May 23, 2023 – Jun 1, 2023

Subsystems (2)
lore
Share & tools
lore

Wyes Karny

author
#0 lore raw

PATCH 1/1 acpi: Replace struct acpi_table_slit 1-element array with flex-array

struct acpi_table_slit is used for copying System Locality Information Table data from ACPI tables. Here entry is a flex array but it was using ancient 1-element fake flexible array, which has been deprecated. Replace it with a C99 flexible array.

---
 include/acpi/actbl3.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
include/acpi/actbl3.h +1 -1
index f51c46f4e3e4..000764ab3985 100644
@@ -86,7 +86,7 @@ struct acpi_table_slic {
 struct acpi_table_slit {
 	struct acpi_table_header header;	/* Common ACPI table header */
 	u64 locality_count;
-	u8 entry[1];		/* Real size = localities^2 */
+	u8 entry[];				/* Real size = localities^2 */
 };
 
 /*******************************************************************************
Signature · 1 line
2.34.1
Reviewed-by on v1 1/1
#1 lore raw
Quoted 6 lines · Wyes Karny

struct acpi_table_slit is used for copying System Locality Information Table data from ACPI tables. Here entry is a flex array but it was using ancient 1-element fake flexible array, which has been deprecated. Replace it with a C99 flexible array.

Eek, thanks. I missed one! :)

Signature · 1 line
Kees Cook
Applied
#2 lore raw
In reply to Wyes Karny
Quoted 6 lines · Wyes Karny

struct acpi_table_slit is used for copying System Locality Information Table data from ACPI tables. Here entry is a flex array but it was using ancient 1-element fake flexible array, which has been deprecated. Replace it with a C99 flexible array.

Since this is a fix for -fstrict-flex-arrays=3, I can carry this in the hardening tree until it shows up in upstream ACPICA.

Applied to for-next/hardening, thanks!

[1/1] acpi: Replace struct acpi_table_slit 1-element array with flex-array

      https://git.kernel.org/kees/c/0233ca593eba
Signature · 1 line
Kees Cook
#3 lore raw
Quoted 9 lines · Kees Cook
Quoted 6 lines · Wyes Karny

struct acpi_table_slit is used for copying System Locality Information Table data from ACPI tables. Here entry is a flex array but it was using ancient 1-element fake flexible array, which has been deprecated. Replace it with a C99 flexible array.

Quoted 7 lines

Since this is a fix for -fstrict-flex-arrays=3, I can carry this in the hardening tree until it shows up in upstream ACPICA.

Applied to for-next/hardening, thanks!

[1/1] acpi: Replace struct acpi_table_slit 1-element array with flex-array

      https://git.kernel.org/kees/c/0233ca593eba

Works for me, thanks!