public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* Re: [PATCH] tracing: Keep index within map_pid_to_cmdline[]
  2009-06-16 18:01 [PATCH] tracing: Keep index within map_pid_to_cmdline[] Roel Kluin
@ 2009-06-16 16:13 ` Steven Rostedt
  0 siblings, 0 replies; 2+ messages in thread
From: Steven Rostedt @ 2009-06-16 16:13 UTC (permalink / raw)
  To: Roel Kluin; +Cc: LKML, Andrew Morton



On Tue, 16 Jun 2009, Roel Kluin wrote:

> Ensure that index `pid' remains within array map_pid_to_cmdline[]
> 
> Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
> ---
> diff --git a/kernel/trace/trace.c b/kernel/trace/trace.c
> index 8acd9b8..f359e9e 100644
> --- a/kernel/trace/trace.c
> +++ b/kernel/trace/trace.c
> @@ -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


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

* [PATCH] tracing: Keep index within map_pid_to_cmdline[]
@ 2009-06-16 18:01 Roel Kluin
  2009-06-16 16:13 ` Steven Rostedt
  0 siblings, 1 reply; 2+ messages in thread
From: Roel Kluin @ 2009-06-16 18:01 UTC (permalink / raw)
  To: rostedt; +Cc: LKML, Andrew Morton

Ensure that index `pid' remains within array map_pid_to_cmdline[]

Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
---
diff --git a/kernel/trace/trace.c b/kernel/trace/trace.c
index 8acd9b8..f359e9e 100644
--- a/kernel/trace/trace.c
+++ b/kernel/trace/trace.c
@@ -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;
 	}

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

end of thread, other threads:[~2009-06-16 16:13 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-06-16 18:01 [PATCH] tracing: Keep index within map_pid_to_cmdline[] Roel Kluin
2009-06-16 16:13 ` Steven Rostedt

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