Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

tracing: Replace deprecated strncpy() with strscpy() for stack_trace_filter_buf

strncpy() is deprecated for NUL-terminated destination buffers and must
be replaced by strscpy().

See issue: https://github.com/KSPP/linux/issues/90

Link: https://lore.kernel.org/20250507133837.19640-1-devaanshk840@gmail.com
Signed-off-by: Devaansh Kumar <devaanshk840@gmail.com>
Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>

authored by

Devaansh Kumar and committed by
Steven Rostedt (Google)
73207746 6e3b3aca

+1 -1
+1 -1
kernel/trace/trace_stack.c
··· 542 542 int len; 543 543 544 544 if ((len = str_has_prefix(str, "_filter="))) 545 - strncpy(stack_trace_filter_buf, str + len, COMMAND_LINE_SIZE); 545 + strscpy(stack_trace_filter_buf, str + len); 546 546 547 547 stack_tracer_enabled = 1; 548 548 return 1;