linux-acpi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Rafael J. Wysocki" <rjw@rjwysocki.net>
To: Linux ACPI <linux-acpi@vger.kernel.org>
Cc: LKML <linux-kernel@vger.kernel.org>,
	Bob Moore <robert.moore@intel.com>,
	Saket Dumbre <saket.dumbre@intel.com>
Subject: [PATCH v1 17/19] ACPICA: Apply ACPI_NONSTRING in more places
Date: Fri, 25 Apr 2025 21:31:05 +0200	[thread overview]
Message-ID: <3833065.MHq7AAxBmi@rjwysocki.net> (raw)
In-Reply-To: <12671029.O9o76ZdvQC@rjwysocki.net>

From: Ahmed Salem <x0rw3ll@gmail.com>

ACPICA commit 1035a3d453f7dd49a235a59ee84ebda9d2d2f41b

Add ACPI_NONSTRING for destination char arrays without a terminating NUL
character. This is a follow-up to commit 35ad99236f3a ("ACPICA: Apply
ACPI_NONSTRING") where not all instances received the same treatment, in
preparation for replacing strncpy() calls with memcpy()

Link: https://github.com/acpica/acpica/commit/1035a3d4
Signed-off-by: Ahmed Salem <x0rw3ll@gmail.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
---
 drivers/acpi/acpica/acdebug.h                            | 2 +-
 include/acpi/actbl.h                                     | 6 +++---
 tools/power/acpi/os_specific/service_layers/oslinuxtbl.c | 2 +-
 tools/power/acpi/tools/acpidump/apfiles.c                | 2 +-
 4 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/drivers/acpi/acpica/acdebug.h b/drivers/acpi/acpica/acdebug.h
index 911875c5a5f1..58842130ca47 100644
--- a/drivers/acpi/acpica/acdebug.h
+++ b/drivers/acpi/acpica/acdebug.h
@@ -37,7 +37,7 @@ struct acpi_db_argument_info {
 struct acpi_db_execute_walk {
 	u32 count;
 	u32 max_count;
-	char name_seg[ACPI_NAMESEG_SIZE + 1];
+	char name_seg[ACPI_NAMESEG_SIZE + 1] ACPI_NONSTRING;
 };
 
 #define PARAM_LIST(pl)                  pl
diff --git a/include/acpi/actbl.h b/include/acpi/actbl.h
index 2fc89704be17..74cc61e3ab09 100644
--- a/include/acpi/actbl.h
+++ b/include/acpi/actbl.h
@@ -66,12 +66,12 @@
  ******************************************************************************/
 
 struct acpi_table_header {
-	char signature[ACPI_NAMESEG_SIZE] __nonstring;	/* ASCII table signature */
+	char signature[ACPI_NAMESEG_SIZE] ACPI_NONSTRING;	/* ASCII table signature */
 	u32 length;		/* Length of table in bytes, including this header */
 	u8 revision;		/* ACPI Specification minor version number */
 	u8 checksum;		/* To make sum of entire table == 0 */
-	char oem_id[ACPI_OEM_ID_SIZE];	/* ASCII OEM identification */
-	char oem_table_id[ACPI_OEM_TABLE_ID_SIZE];	/* ASCII OEM table identification */
+	char oem_id[ACPI_OEM_ID_SIZE] ACPI_NONSTRING;	/* ASCII OEM identification */
+	char oem_table_id[ACPI_OEM_TABLE_ID_SIZE] ACPI_NONSTRING;	/* ASCII OEM table identification */
 	u32 oem_revision;	/* OEM revision number */
 	char asl_compiler_id[ACPI_NAMESEG_SIZE];	/* ASCII ASL compiler vendor ID */
 	u32 asl_compiler_revision;	/* ASL compiler version */
diff --git a/tools/power/acpi/os_specific/service_layers/oslinuxtbl.c b/tools/power/acpi/os_specific/service_layers/oslinuxtbl.c
index 9d70d8c945af..987a5d32f3b6 100644
--- a/tools/power/acpi/os_specific/service_layers/oslinuxtbl.c
+++ b/tools/power/acpi/os_specific/service_layers/oslinuxtbl.c
@@ -19,7 +19,7 @@ ACPI_MODULE_NAME("oslinuxtbl")
 typedef struct osl_table_info {
 	struct osl_table_info *next;
 	u32 instance;
-	char signature[ACPI_NAMESEG_SIZE];
+	char signature[ACPI_NAMESEG_SIZE] ACPI_NONSTRING;
 
 } osl_table_info;
 
diff --git a/tools/power/acpi/tools/acpidump/apfiles.c b/tools/power/acpi/tools/acpidump/apfiles.c
index 13817f9112c0..9fc927fcc22a 100644
--- a/tools/power/acpi/tools/acpidump/apfiles.c
+++ b/tools/power/acpi/tools/acpidump/apfiles.c
@@ -103,7 +103,7 @@ int ap_open_output_file(char *pathname)
 
 int ap_write_to_binary_file(struct acpi_table_header *table, u32 instance)
 {
-	char filename[ACPI_NAMESEG_SIZE + 16];
+	char filename[ACPI_NAMESEG_SIZE + 16] ACPI_NONSTRING;
 	char instance_str[16];
 	ACPI_FILE file;
 	acpi_size actual;
-- 
2.43.0





  parent reply	other threads:[~2025-04-25 19:34 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-04-25 19:19 [PATCH v1 00/19] ACPICA: ACPICA 20250404 Rafael J. Wysocki
2025-04-25 19:20 ` [PATCH v1 01/19] ACPICA: Drop stale comment about the header file content Rafael J. Wysocki
2025-04-25 19:21 ` [PATCH v1 02/19] ACPICA: Apply pack(1) to union aml_resource Rafael J. Wysocki
2025-04-30 18:48   ` Tamir Duberstein
2025-04-30 18:48   ` [PATCH 0/0] Cover letter only Tamir Duberstein
2025-04-30 18:52     ` Tamir Duberstein
2025-04-25 19:21 ` [PATCH v1 03/19] ACPICA: utilities: Fix overflow check in vsnprintf() Rafael J. Wysocki
2025-05-09 21:41   ` gldrk
2025-04-25 19:22 ` [PATCH v1 04/19] ACPICA: Interpret SIDP structures in DMAR Rafael J. Wysocki
2025-04-25 19:23 ` [PATCH v1 05/19] ACPICA: infrastructure: Add new header and ACPI_DMT_BUF26 types Rafael J. Wysocki
2025-04-25 19:24 ` [PATCH v1 06/19] ACPICA: actbl2.h: MRRM: Add typedef and other definitions Rafael J. Wysocki
2025-04-25 19:24 ` [PATCH v1 07/19] ACPICA: actbl2: Add definitions for RIMT Rafael J. Wysocki
2025-04-25 19:25 ` [PATCH v1 08/19] ACPICA: MRRM: Some cleanups Rafael J. Wysocki
2025-04-25 19:26 ` [PATCH v1 09/19] ACPICA: Utilities: Fix spelling mistake "Incremement" -> "Increment" Rafael J. Wysocki
2025-04-25 19:26 ` [PATCH v1 10/19] ACPICA: infrastructure: Add new DMT_BUF types and shorten a long name Rafael J. Wysocki
2025-04-25 19:27 ` [PATCH v1 11/19] ACPICA: actbl2.h: ERDT: Add typedef and other definitions Rafael J. Wysocki
2025-04-25 19:27 ` [PATCH v1 12/19] ACPICA: Introduce ACPI_NONSTRING Rafael J. Wysocki
2025-04-30 18:35   ` Kees Cook
2025-04-30 18:49     ` Rafael J. Wysocki
2025-04-25 19:28 ` [PATCH v1 13/19] ACPICA: Apply ACPI_NONSTRING Rafael J. Wysocki
2025-04-25 19:29 ` [PATCH v1 14/19] ACPICA: actbl2.h: ACPI 6.5: RAS2: Rename structure and field names of the RAS2 table Rafael J. Wysocki
2025-04-25 19:29 ` [PATCH v1 15/19] ACPICA: Adjust the position of code lines Rafael J. Wysocki
2025-04-25 19:30 ` [PATCH v1 16/19] ACPICA: Avoid sequence overread in call to strncmp() Rafael J. Wysocki
2025-04-25 19:31 ` Rafael J. Wysocki [this message]
2025-04-25 19:32 ` [PATCH v1 18/19] ACPICA: Replace strncpy() with memcpy() Rafael J. Wysocki
2025-05-07  5:42   ` kernel test robot
2025-04-25 19:33 ` [PATCH v1 19/19] ACPICA: Logfile: Changes for version 20250404 Rafael J. Wysocki

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=3833065.MHq7AAxBmi@rjwysocki.net \
    --to=rjw@rjwysocki.net \
    --cc=linux-acpi@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=robert.moore@intel.com \
    --cc=saket.dumbre@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).