tracing: Keep index within map_pid_to_cmdline[]
PATCH 1/1 tracing: Keep index within map_pid_to_cmdline[]
Ensure that index `pid' remains within array map_pid_to_cmdline[]
Signed-off-by Roel Kluin <[email protected]>
---
kernel/trace/trace.c +1 -1
@@ -803,7 +803,7 @@ void trace_find_cmdline(int pid, char comm[])return ; } -if (pid >PID_MAX_DEFAULT ) { +if (pid >PID_MAX_DEFAULT || pid <0 ) {strcpy (comm,"<...>" );return ; }
Steven Rostedt
maintainerQuoted 9 lines · Roel Kluin
Ensure that index `pid' remains within array map_pid_to_cmdline[]
Signed-off-by Roel Kluin <[email protected]>---
kernel/trace/trace.c +0
-0
kernel/trace/trace.c void trace_find_cmdline(int pid, char comm[]) · line 809
Quoted 8 lines
kernel/trace/trace.c +1
-1@@ -803,7 +803,7 @@ void trace_find_cmdline(int pid, char comm[])return ; } -if (pid >PID_MAX_DEFAULT ) { +if (pid >PID_MAX_DEFAULT || pid <0 ) {strcpy (comm,"<...>" );return ; }
Did you ever hit a case where pid was < 0? Or is this just a "safety patch"?
-- Steve