From 3d867f6c5fd6535cdeceef3170e5e84e5dd80fc1 Mon Sep 17 00:00:00 2001 From: Kees Cook Date: Tue, 27 Jun 2017 00:53:07 +0200 Subject: ACPICA: Use designated initializers The struct layout randomization plugin detects and randomizes any structs that contain only function pointers. Once layout is randomized, all initialization must be designated or the compiler will misalign the assignments. This switches all the ACPICA function pointer struct to use designated initializers, using the proposed upstream ACPICA macro: https://github.com/acpica/acpica/pull/248/ Signed-off-by: Kees Cook Signed-off-by: Rafael J. Wysocki --- include/acpi/platform/acenv.h | 4 ++++ include/acpi/platform/aclinux.h | 2 ++ 2 files changed, 6 insertions(+) (limited to 'include/acpi') diff --git a/include/acpi/platform/acenv.h b/include/acpi/platform/acenv.h index 09994b063243..912563c66948 100644 --- a/include/acpi/platform/acenv.h +++ b/include/acpi/platform/acenv.h @@ -382,4 +382,8 @@ #define ACPI_INIT_FUNCTION #endif +#ifndef ACPI_STRUCT_INIT +#define ACPI_STRUCT_INIT(field, value) value +#endif + #endif /* __ACENV_H__ */ diff --git a/include/acpi/platform/aclinux.h b/include/acpi/platform/aclinux.h index a39e3f67616f..047f13865608 100644 --- a/include/acpi/platform/aclinux.h +++ b/include/acpi/platform/aclinux.h @@ -178,6 +178,8 @@ #define ACPI_MSG_BIOS_ERROR KERN_ERR "ACPI BIOS Error (bug): " #define ACPI_MSG_BIOS_WARNING KERN_WARNING "ACPI BIOS Warning (bug): " +#define ACPI_STRUCT_INIT(field, value) .field = value + #else /* !__KERNEL__ */ #define ACPI_USE_STANDARD_HEADERS -- cgit v1.2.3-59-g8ed1b