From: Jiri Slaby <jirislaby@kernel.org>
To: "Rafael J. Wysocki" <rafael@kernel.org>,
Linux ACPI <linux-acpi@vger.kernel.org>
Cc: Thomas Renninger <trenn@suse.com>,
LKML <linux-kernel@vger.kernel.org>,
Saket Dumbre <saket.dumbre@intel.com>,
Kees Cook <kees@kernel.org>,
"Chmielewski, Pawel" <pawel.chmielewski@intel.com>
Subject: Re: [PATCH v1] ACPICA: Unbreak tools build after switching over to strscpy_pad()
Date: Tue, 23 Jun 2026 06:02:42 +0200 [thread overview]
Message-ID: <d9379a5b-0b82-4df1-a034-03f82bb0e3da@kernel.org> (raw)
In-Reply-To: <12923581.O9o76ZdvQC@rafael.j.wysocki>
On 22. 06. 26, 20:23, Rafael J. Wysocki wrote:
> From: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
>
> Commit 97f7d3f9c9ac ("ACPICA: Replace strncpy() with strscpy_pad() in
> acpi_ut_safe_strncpy()") switched over the ACPICA code in the kernel to
> using strscpy_pad() instead of a combination of strncpy() and manual
> NUL-termination of the destination string, but it overlooked the fact
> that tools also use the code in question and strscpy_pad() is not
> defined in those builds.
>
> Address that by using the original ACPICA code in non-kernel builds.
>
> Fixes: 97f7d3f9c9ac ("ACPICA: Replace strncpy() with strscpy_pad() in acpi_ut_safe_strncpy()")
> Reported-by: Jiri Slaby <jirislaby@kernel.org>
> Closes: https://lore.kernel.org/all/79e9e913-0fb1-4110-804b-c3b5d0edafe4@kernel
> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
> ---
> drivers/acpi/acpica/utnonansi.c | 10 ++++++++++
> 1 file changed, 9 insertions(+)
>
> --- a/drivers/acpi/acpica/utnonansi.c
> +++ b/drivers/acpi/acpica/utnonansi.c
> @@ -168,7 +168,17 @@ void acpi_ut_safe_strncpy(char *dest, ch
Hmm, how could this become 17, provided you are adding 9 lines to 7
lines? Fixed to 16 and applied -- testing.
> {
> /* Always terminate destination string */
>
> +#ifdef __KERNEL__
> strscpy_pad(dest, source, dest_size);
> +#else
> + /*
> + * strscpy_pad() is not defined in ACPICA tools builds, so use strncpy()
> + * and directly NUL-terminate the destination string in that case.
> + */
> + strncpy(dest, source, dest_size);
> + dest[dest_size - 1] = 0;
> +#endif
> }
>
> #endif
>
>
>
--
js
suse labs
next prev parent reply other threads:[~2026-06-23 4:02 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-06-22 18:23 [PATCH v1] ACPICA: Unbreak tools build after switching over to strscpy_pad() Rafael J. Wysocki
2026-06-23 4:02 ` Jiri Slaby [this message]
2026-06-23 10:49 ` Rafael J. Wysocki
2026-06-23 19:28 ` Kees Cook
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=d9379a5b-0b82-4df1-a034-03f82bb0e3da@kernel.org \
--to=jirislaby@kernel.org \
--cc=kees@kernel.org \
--cc=linux-acpi@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=pawel.chmielewski@intel.com \
--cc=rafael@kernel.org \
--cc=saket.dumbre@intel.com \
--cc=trenn@suse.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