From 20039e646de3301537a2fe909a4687ea3ed46918 Mon Sep 17 00:00:00 2001 From: Lee Jones Date: Tue, 26 Mar 2024 09:26:45 +0000 Subject: [PATCH] ANDROID: debug_kinfo: Replace strlcpy() with compatible and safer variant strscpy() strlcpy() has now been formally removed from the kernel due to the risks it poses. Fixes the following build error: drivers/android/debug_kinfo.c:161:2: error: call to undeclared library function 'strlcpy' with type 'unsigned long (char *, const char *, unsigned long)'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration] 161 | strlcpy(info->last_uts_release, init_utsname()->release, sizeof(info->last_uts_release)); | ^ Fixes: d26270061ae6 ("string: Remove strlcpy()") Signed-off-by: Lee Jones Change-Id: Ib2b863c07676495626dd03af762ddb201d326127 --- drivers/android/debug_kinfo.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/android/debug_kinfo.c b/drivers/android/debug_kinfo.c index b1359154c396..770b69a867cd 100644 --- a/drivers/android/debug_kinfo.c +++ b/drivers/android/debug_kinfo.c @@ -158,7 +158,7 @@ static int debug_kinfo_probe(struct platform_device *pdev) info->_markers_pa = (u64)__pa_symbol((volatile void *)kallsyms_markers); info->thread_size = THREAD_SIZE; info->swapper_pg_dir_pa = (u64)__pa_symbol(swapper_pg_dir); - strlcpy(info->last_uts_release, init_utsname()->release, sizeof(info->last_uts_release)); + strscpy(info->last_uts_release, init_utsname()->release, sizeof(info->last_uts_release)); info->enabled_modules_tree_lookup = IS_ENABLED(CONFIG_MODULES_TREE_LOOKUP); info->mod_kallsyms_offset = offsetof(struct module, kallsyms);