mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH linux-next] fs/proc/kcore.c: Use strscpy() instead of strlcpy()
@ 2022-10-20  9:20 cuijinpeng666
  2022-10-20  9:49 ` Greg KH
  0 siblings, 1 reply; 2+ messages in thread
From: cuijinpeng666 @ 2022-10-20  9:20 UTC (permalink / raw)
  To: akpm, liushixin2, deller, cui.jinpeng2
  Cc: guoren, wangkefeng.wang, jakobkoschel, linux-kernel,
	linux-fsdevel, Zeal Robot

From: Jinpeng Cui <cui.jinpeng2@zte.com.cn>

The implementation of strscpy() is more robust and safer.

Reported-by: Zeal Robot <zealci@zte.com.cn>
Signed-off-by: Jinpeng Cui <cui.jinpeng2@zte.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


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH linux-next] fs/proc/kcore.c: Use strscpy() instead of strlcpy()
  2022-10-20  9:20 [PATCH linux-next] fs/proc/kcore.c: Use strscpy() instead of strlcpy() cuijinpeng666
@ 2022-10-20  9:49 ` Greg KH
  0 siblings, 0 replies; 2+ messages in thread
From: Greg KH @ 2022-10-20  9:49 UTC (permalink / raw)
  To: cuijinpeng666
  Cc: akpm, liushixin2, deller, cui.jinpeng2, guoren, wangkefeng.wang,
	jakobkoschel, linux-kernel, linux-fsdevel, Zeal Robot

On Thu, Oct 20, 2022 at 09:20:44AM +0000, cuijinpeng666@gmail.com wrote:
> From: Jinpeng Cui <cui.jinpeng2@zte.com.cn>
> 
> The implementation of strscpy() is more robust and safer.
> 
> Reported-by: Zeal Robot <zealci@zte.com.cn>
> Signed-off-by: Jinpeng Cui <cui.jinpeng2@zte.com.cn>


Please ignore based on this response:
	https://lore.kernel.org/r/Y1EVnZS9BalesrC1@kroah.com


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2022-10-20  9:49 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-10-20  9:20 [PATCH linux-next] fs/proc/kcore.c: Use strscpy() instead of strlcpy() cuijinpeng666
2022-10-20  9:49 ` Greg KH

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®