Skip to contentSkip to conversation

Revert "ACPICA: Replace strncpy() with strscpy_pad() in acpi_ut_safe_strncpy()"

PATCH In review Thomas Renninger 3 participants 7 messages Jun 17 – Jun 22

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Revert "ACPICA: Replace strncpy() with strscpy_pad() in acpi_ut_safe_strncpy()"

This reverts commit 97f7d3f9c9acb70d4eef7bcdef3218823d142733.

acpica has it's own safe strncpy function: acpi_ut_safe_strncpy and must not use kernel's strscpy_pad.

---
 drivers/acpi/acpica/utnonansi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/acpi/acpica/utnonansi.c +2 -1
index 3a7952be6545..ff0802ace19b 100644
@@ -168,7 +168,8 @@ void acpi_ut_safe_strncpy(char *dest, char *source, acpi_size dest_size)
 {
 	/* Always terminate destination string */
 
-	strscpy_pad(dest, source, dest_size);
+	strncpy(dest, source, dest_size);
+	dest[dest_size - 1] = 0;
 }
 
 #endif
Signature · 1 line
2.54.0
#1 lore raw
Quoted 6 lines · Thomas Renninger

This reverts commit 97f7d3f9c9acb70d4eef7bcdef3218823d142733.

acpica has it's own safe strncpy function: acpi_ut_safe_strncpy and must not use kernel's strscpy_pad.

Quoted 9 lines
---
  drivers/acpi/acpica/utnonansi.c | 3 ++-
  1 file changed, 2 insertions(+), 1 deletion(-)
drivers/acpi/acpica/utnonansi.c +0 -0
index 3a7952be6545..ff0802ace19b 100644

drivers/acpi/acpica/utnonansi.c void acpi_ut_safe_strncpy(char *dest, char *source, acpi_size dest_size) · line 175

Quoted 9 lines
drivers/acpi/acpica/utnonansi.c +2 -1
@@ -168,7 +168,8 @@ void acpi_ut_safe_strncpy(char *dest, char *source, acpi_size dest_size)
  {
  	/* Always terminate destination string */
 
-	strscpy_pad(dest, source, dest_size);
+	strncpy(dest, source, dest_size);
+	dest[dest_size - 1] = 0;
  }
 
  #endif

thanks,

Signature · 2 lines
js
suse labs
#2 lore raw

PATCH 1/1 Revert "ACPICA: Replace strncpy() with strscpy_pad() in acpi_ut_safe_strncpy()"

In reply to Thomas Renninger

This reverts commit 97f7d3f9c9acb70d4eef7bcdef3218823d142733.

acpica has it's own safe strncpy function: acpi_ut_safe_strncpy and must not use kernel's strscpy_pad.

---
 drivers/acpi/acpica/utnonansi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/acpi/acpica/utnonansi.c +2 -1
index 3a7952be6545..ff0802ace19b 100644
@@ -168,7 +168,8 @@ void acpi_ut_safe_strncpy(char *dest, char *source, acpi_size dest_size)
 {
 	/* Always terminate destination string */
 
-	strscpy_pad(dest, source, dest_size);
+	strncpy(dest, source, dest_size);
+	dest[dest_size - 1] = 0;
 }
 
 #endif
Signature · 1 line
2.54.0
maintainer Applied
#3 lore raw
Quoted 9 lines · Thomas Renninger

This reverts commit 97f7d3f9c9acb70d4eef7bcdef3218823d142733.

acpica has it's own safe strncpy function: acpi_ut_safe_strncpy and must not use kernel's strscpy_pad.

Applied as 7.2-rc material, but I wrote a new changelog for it.

Thanks!

Quoted 19 lines
---
 drivers/acpi/acpica/utnonansi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/acpi/acpica/utnonansi.c +2 -2
index 3a7952be6545..ff0802ace19b 100644
@@ -168,7 +168,8 @@ void acpi_ut_safe_strncpy(char *dest, char *source, acpi_size dest_size)
 {
        /* Always terminate destination string */
 
-       strscpy_pad(dest, source, dest_size);
+       strncpy(dest, source, dest_size);
+       dest[dest_size - 1] = 0;
 }
 
 #endif
--
#4 lore raw
Quoted 5 lines · Rafael J. Wysocki
Quoted 3 lines · Thomas Renninger

This reverts commit 97f7d3f9c9acb70d4eef7bcdef3218823d142733.

Quoted 8 lines
Quoted 6 lines

acpica has it's own safe strncpy function: acpi_ut_safe_strncpy and must not use kernel's strscpy_pad.

Applied as 7.2-rc material, but I wrote a new changelog for it.

And dropped because of

https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=1a3746ccbb0a97bed3c06ccde6b880013b1dddc1

The acpidump build breakage will need to be addressed in a different way.

I'll take care of this next week unless someone beats me to it.

Quoted 19 lines
Quoted 19 lines
---
 drivers/acpi/acpica/utnonansi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/acpi/acpica/utnonansi.c +2 -2
index 3a7952be6545..ff0802ace19b 100644
@@ -168,7 +168,8 @@ void acpi_ut_safe_strncpy(char *dest, char *source, acpi_size dest_size)
 {
        /* Always terminate destination string */
 
-       strscpy_pad(dest, source, dest_size);
+       strncpy(dest, source, dest_size);
+       dest[dest_size - 1] = 0;
 }
 
 #endif
--
#5 lore raw
Quoted 14 lines · On Sonntag, 21. Juni 2026 19:38:06 Mitteleuropäische Sommerzeit Rafael J.…
Quoted 6 lines · Rafael J. Wysocki
Quoted 5 lines · Thomas Renninger

This reverts commit 97f7d3f9c9acb70d4eef7bcdef3218823d142733.

acpica has it's own safe strncpy function: acpi_ut_safe_strncpy and must not use kernel's strscpy_pad.

Quoted 6 lines
Quoted 4 lines

Closes:
https://lore.kernel.org/all/79e9e913-0fb1-4110-804b-c3b5d0edafe4@kernel
.org Reported-and-tested-by: Jiri Slaby <[email protected]>

Applied as 7.2-rc material, but I wrote a new changelog for it.

Quoted 8 lines

And dropped because of

https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?i
d=1a3746ccbb0a97bed3c06ccde6b880013b1dddc1

The acpidump build breakage will need to be addressed in a different way.

I'll take care of this next week unless someone beats me to it.

In case you agree with, you might want to take this one:
https://github.com/acpica/acpica/pull/1203/changes

Robert seem to have retired (his mail came back)? Please advise if one (I) still have to add/push someone so that this all gets synced from acpica down to the kernel.

Thanks,

Thomas

#6 lore raw
Quoted 22 lines · Thomas Renninger
Quoted 19 lines · On Sonntag, 21. Juni 2026 19:38:06 Mitteleuropäische Sommerzeit Rafael J.…
Quoted 6 lines · Rafael J. Wysocki
Quoted 5 lines · Thomas Renninger

This reverts commit 97f7d3f9c9acb70d4eef7bcdef3218823d142733.

acpica has it's own safe strncpy function: acpi_ut_safe_strncpy and must not use kernel's strscpy_pad.

Quoted 6 lines
Quoted 4 lines

Closes:
https://lore.kernel.org/all/79e9e913-0fb1-4110-804b-c3b5d0edafe4@kernel
.org Reported-and-tested-by: Jiri Slaby <[email protected]>

Applied as 7.2-rc material, but I wrote a new changelog for it.

And dropped because of

https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?i
d=1a3746ccbb0a97bed3c06ccde6b880013b1dddc1

Quoted 6 lines
Quoted 3 lines

The acpidump build breakage will need to be addressed in a different way.

I'll take care of this next week unless someone beats me to it.

In case you agree with, you might want to take this one:
https://github.com/acpica/acpica/pull/1203/changes

This hasn't been merged yet though AFAICS.

Quoted 1 line

Robert seem to have retired (his mail came back)?

Yes, he has.

Quoted 3 lines

Please advise if one (I)
still have to add/push someone so that this all gets synced from acpica down to the kernel.

Saket is the new upstream ACPICA maintainer, but the overall process has not changed. That is, as a rule, changes are made to the upstream ACPICA first and from there, they are propagated to the kernel more-or-less automatically.

Commit 97f7d3f9c9acb70 was an exception because ACPICA users other than the Linux kernel still use strncpy() and have no plans to switch over away from it (AFAIK).