ACPICA: actbl2: Replace 1-element arrays with flexible arrays
authorKees Cook <kees@outflux.net>
Wed, 5 Apr 2023 13:50:18 +0000 (15:50 +0200)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Thu, 6 Apr 2023 18:29:11 +0000 (20:29 +0200)
commit74522fea27f8a0695f529089130da64ac98f1761
treebfab89b09bfbc9ab1b85aaa00ede8c97652a2d3c
parent48ff467c338b184bc309ea2e0d2a9524f569d245
ACPICA: actbl2: Replace 1-element arrays with flexible arrays

ACPICA commit 44f1af0664599e87bebc3a1260692baa27b2f264

Similar to "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).

The sizeof() uses with struct acpi_nfit_flush_address and struct
acpi_nfit_smbios have been adjusted to drop the open-coded subtraction
of the trailing single element. The result is no binary differences in
.text nor .data sections.

Link: https://github.com/acpica/acpica/commit/44f1af06
Signed-off-by: Bob Moore <robert.moore@intel.com>
Co-developed-by: Dan Williams <dan.j.williams@intel.com>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
drivers/acpi/nfit/core.c
include/acpi/actbl2.h
tools/testing/nvdimm/test/nfit.c