[GIT PULL] strncpy-removal updates for v7.2-rc1
From: Kees Cook
Date: Thu Jun 18 2026 - 22:49:59 EST
Hi Linus,
Please pull the strncpy removal for v7.2-rc1. BPF's last usage removal
has landed, so here we go.
Thanks!
-Kees
The following changes since commit 9c87e61e3c5797277407ba5eae4eac8a52be3fa3:
Merge tag 'bpf-next-7.2' of git://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf-next (2026-06-17 09:18:14 +0100)
are available in the Git repository at:
https://git.kernel.org/pub/scm/linux/kernel/git/kees/linux.git tags/strncpy-removal-v7.2-rc1
for you to fetch changes up to 079a028d6327e68cfa5d38b36123637b321c19a7:
string: Remove strncpy() from the kernel (2026-06-18 16:39:31 -0700)
----------------------------------------------------------------
strncpy removal for v7.2-rc1
- Remove the per-arch strncpy implementations in alpha, m68k, powerpc,
x86, and xtensa
- Remove strncpy API
Over the last 6 years working on strncpy removal there were 362 commits
by 70 contributors. Folks with more than 1 commit were:
211 Justin Stitt <justinstitt@xxxxxxxxxx>
22 Xu Panda <xu.panda@xxxxxxxxxx>
21 Kees Cook <kees@xxxxxxxxxx>
17 Thorsten Blum <thorsten.blum@xxxxxxxxx>
12 Arnd Bergmann <arnd@xxxxxxxx>
4 Pranav Tyagi <pranav.tyagi03@xxxxxxxxx>
4 Lee Jones <lee@xxxxxxxxxx>
2 Steven Rostedt <rostedt@xxxxxxxxxxx>
2 Sam Ravnborg <sam@xxxxxxxxxxxx>
2 Marcelo Moreira <marcelomoreira1905@xxxxxxxxx>
2 Krzysztof Kozlowski <krzk@xxxxxxxxxx>
2 Kalle Valo <kvalo@xxxxxxxxxx>
2 Jaroslav Kysela <perex@xxxxxxxx>
2 Daniel Thompson <danielt@xxxxxxxxxx>
2 Andrew Lunn <andrew@xxxxxxx>
----------------------------------------------------------------
Kees Cook (6):
alpha: Remove arch-specific strncpy() implementation
m68k: Remove arch-specific strncpy() implementation
powerpc: Remove arch-specific strncpy() implementation
x86: Remove arch-specific strncpy() implementation
xtensa: Remove arch-specific strncpy() implementation
string: Remove strncpy() from the kernel
Documentation/process/deprecated.rst | 47 ++++++++-------
arch/alpha/include/asm/string.h | 2 -
arch/m68k/include/asm/string.h | 17 ------
arch/powerpc/boot/string.h | 1 -
arch/powerpc/include/asm/string.h | 2 -
arch/x86/include/asm/string_32.h | 3 -
arch/xtensa/include/asm/string.h | 25 --------
include/linux/fortify-string.h | 49 ----------------
include/linux/string.h | 3 -
arch/alpha/lib/strncpy.S | 83 ---------------------------
arch/alpha/lib/styncpy.S | 1 -
arch/powerpc/boot/string.S | 13 -----
arch/powerpc/lib/string.S | 22 -------
arch/x86/lib/string_32.c | 19 ------
drivers/misc/lkdtm/fortify.c | 2 +-
lib/string.c | 16 ------
lib/test_fortify/write_overflow-strncpy-src.c | 5 --
lib/test_fortify/write_overflow-strncpy.c | 5 --
lib/tests/fortify_kunit.c | 61 +-------------------
19 files changed, 28 insertions(+), 348 deletions(-)
delete mode 100644 arch/alpha/lib/strncpy.S
delete mode 100644 lib/test_fortify/write_overflow-strncpy-src.c
delete mode 100644 lib/test_fortify/write_overflow-strncpy.c
--
Kees Cook