summaryrefslogtreecommitdiffstats
path: root/lib/string.c
diff options
context:
space:
mode:
authorKees Cook <keescook@chromium.org>2024-01-18 21:31:55 +0100
committerKees Cook <keescook@chromium.org>2024-01-19 20:59:11 +0100
commitd26270061ae66b915138af7cd73ca6f8b85e6b44 (patch)
treeefd84b38f392f32f691e6f98173b90cbbd0e0106 /lib/string.c
parentbcachefs: Replace strlcpy() with strscpy() (diff)
downloadlinux-d26270061ae66b915138af7cd73ca6f8b85e6b44.tar.xz
linux-d26270061ae66b915138af7cd73ca6f8b85e6b44.zip
string: Remove strlcpy()
With all the users of strlcpy() removed[1] from the kernel, remove the API, self-tests, and other references. Leave mentions in Documentation (about its deprecation), and in checkpatch.pl (to help migrate host-only tools/ usage). Long live strscpy(). Link: https://github.com/KSPP/linux/issues/89 [1] Cc: Azeem Shaikh <azeemshaikh38@gmail.com> Cc: Andrew Morton <akpm@linux-foundation.org> Cc: Andy Whitcroft <apw@canonical.com> Cc: Joe Perches <joe@perches.com> Cc: Dwaipayan Ray <dwaipayanray1@gmail.com> Cc: Lukas Bulwahn <lukas.bulwahn@gmail.com> Cc: linux-hardening@vger.kernel.org Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com> Signed-off-by: Kees Cook <keescook@chromium.org>
Diffstat (limited to 'lib/string.c')
-rw-r--r--lib/string.c15
1 files changed, 0 insertions, 15 deletions
diff --git a/lib/string.c b/lib/string.c
index be26623953d2..6891d15ce991 100644
--- a/lib/string.c
+++ b/lib/string.c
@@ -103,21 +103,6 @@ char *strncpy(char *dest, const char *src, size_t count)
EXPORT_SYMBOL(strncpy);
#endif
-#ifndef __HAVE_ARCH_STRLCPY
-size_t strlcpy(char *dest, const char *src, size_t size)
-{
- size_t ret = strlen(src);
-
- if (size) {
- size_t len = (ret >= size) ? size - 1 : ret;
- __builtin_memcpy(dest, src, len);
- dest[len] = '\0';
- }
- return ret;
-}
-EXPORT_SYMBOL(strlcpy);
-#endif
-
#ifndef __HAVE_ARCH_STRSCPY
ssize_t strscpy(char *dest, const char *src, size_t count)
{