lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <4524051.cEBGB3zze1@kreacher>
Date:   Wed, 05 Apr 2023 15:53:20 +0200
From:   "Rafael J. Wysocki" <rjw@...ysocki.net>
To:     Linux ACPI <linux-acpi@...r.kernel.org>
Cc:     LKML <linux-kernel@...r.kernel.org>,
        Bob Moore <robert.moore@...el.com>,
        Kees Cook <kees@...flux.net>
Subject: [PATCH 25/32] ACPICA: struct acpi_resource_dma: Replace 1-element array with flexible array

From: Kees Cook <kees@...flux.net>

ACPICA commit 8409bb869a1790f6e02391c3f0eaf9c5fa63e33f

Similar to "Replace one-element array with flexible-array", replace the
1-element array with a proper flexible array member as defined by C99,
but without changing the structure size.

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). As with IRQs, leave a single element in
a union.

No binary changes appear in the .text nor .data sections.

Link: https://github.com/acpica/acpica/commit/8409bb86
Signed-off-by: Bob Moore <robert.moore@...el.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@...el.com>
---
 include/acpi/acrestyp.h | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/include/acpi/acrestyp.h b/include/acpi/acrestyp.h
index 77d735594ac2..52e82d65016b 100644
--- a/include/acpi/acrestyp.h
+++ b/include/acpi/acrestyp.h
@@ -150,7 +150,10 @@ struct acpi_resource_dma {
 	u8 bus_master;
 	u8 transfer;
 	u8 channel_count;
-	u8 channels[1];
+	union {
+		u8 channel;
+		ACPI_FLEX_ARRAY(u8, channels);
+	};
 };
 
 struct acpi_resource_start_dependent {
-- 
2.35.3





Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ