mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH linux-next] clocksource: Use strscpy() instead of strlcpy()
@ 2022-10-20  9:13 cuijinpeng666
  2022-10-20  9:49 ` Greg KH
  0 siblings, 1 reply; 2+ messages in thread
From: cuijinpeng666 @ 2022-10-20  9:13 UTC (permalink / raw)
  To: jstultz, tglx; +Cc: sboyd, linux-kernel, Jinpeng Cui, Zeal Robot

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

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

Reported-by: Zeal Robot <zaelci@zte.com.cn>
Signed-off-by: Jinpeng Cui <cui.jinpeng2@zte.com.cn>
---
 kernel/time/clocksource.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/kernel/time/clocksource.c b/kernel/time/clocksource.c
index dcaf38c06216..a3e7edfbb3c2 100644
--- a/kernel/time/clocksource.c
+++ b/kernel/time/clocksource.c
@@ -1461,7 +1461,7 @@ static int __init boot_override_clocksource(char* str)
 {
 	mutex_lock(&clocksource_mutex);
 	if (str)
-		strlcpy(override_name, str, sizeof(override_name));
+		strscpy(override_name, str, sizeof(override_name));
 	mutex_unlock(&clocksource_mutex);
 	return 1;
 }
-- 
2.25.1


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

* Re: [PATCH linux-next] clocksource: Use strscpy() instead of strlcpy()
  2022-10-20  9:13 [PATCH linux-next] clocksource: 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: jstultz, tglx, sboyd, linux-kernel, Jinpeng Cui, Zeal Robot

On Thu, Oct 20, 2022 at 09:13:12AM +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 <zaelci@zte.com.cn>
> Signed-off-by: Jinpeng Cui <cui.jinpeng2@zte.com.cn>
> ---
>  kernel/time/clocksource.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)


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:13 [PATCH linux-next] clocksource: 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®