[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20221020092044.399139-1-cui.jinpeng2@zte.com.cn>
Date: Thu, 20 Oct 2022 09:20:44 +0000
From: cuijinpeng666@...il.com
To: akpm@...ux-foundation.org, liushixin2@...wei.com, deller@....de,
cui.jinpeng2@....com.cn
Cc: guoren@...nel.org, wangkefeng.wang@...wei.com,
jakobkoschel@...il.com, linux-kernel@...r.kernel.org,
linux-fsdevel@...r.kernel.org, Zeal Robot <zealci@....com.cn>
Subject: [PATCH linux-next] fs/proc/kcore.c: Use strscpy() instead of strlcpy()
From: Jinpeng Cui <cui.jinpeng2@....com.cn>
The implementation of strscpy() is more robust and safer.
Reported-by: Zeal Robot <zealci@....com.cn>
Signed-off-by: Jinpeng Cui <cui.jinpeng2@....com.cn>
---
fs/proc/kcore.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/fs/proc/kcore.c b/fs/proc/kcore.c
index 71157ee35c1a..47b9ac9229dd 100644
--- a/fs/proc/kcore.c
+++ b/fs/proc/kcore.c
@@ -421,7 +421,7 @@ read_kcore(struct file *file, char __user *buffer, size_t buflen, loff_t *fpos)
char *notes;
size_t i = 0;
- strlcpy(prpsinfo.pr_psargs, saved_command_line,
+ strscpy(prpsinfo.pr_psargs, saved_command_line,
sizeof(prpsinfo.pr_psargs));
notes = kzalloc(notes_len, GFP_KERNEL);
--
2.25.1
Powered by blists - more mailing lists