[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20080214164216.45ebf51f@laptopd505.fenrus.org>
Date: Thu, 14 Feb 2008 16:42:16 -0800
From: Arjan van de Ven <arjan@...ux.intel.com>
To: Hiroshi Shimamoto <h-shimamoto@...jp.nec.com>
Cc: linux-kernel@...r.kernel.org, Ingo Molnar <mingo@...e.hu>
Subject: Re: [PATCH] latencytop: fix kernel panic and memory leak on proc
On Thu, 14 Feb 2008 14:51:19 -0800
Hiroshi Shimamoto <h-shimamoto@...jp.nec.com> wrote:
> Hi,
>
> I posted 2 patches to fix kernel panic and memory leak.
> http://lkml.org/lkml/2008/2/14/282
> http://lkml.org/lkml/2008/2/14/283
>
> But, I think this patch is better than old ones.
>
> ---
> From: Hiroshi Shimamoto <h-shimamoto@...jp.nec.com>
>
> Reading /proc/<pid>/latency or /proc/<pid>/task/<tid>/latency could
> cause NULL pointer dereference.
>
> In lstats_open(), get_proc_task() can return NULL, in which case the
> kernel will oops at lstats_show_proc() because m->private is NULL.
>
> This can be reproduced by the follwoing script.
> while :
> do
> bash -c 'ls > ls.$$' &
> pid=$!
> cat /proc/$pid/latency &
> cat /proc/$pid/latency &
> cat /proc/$pid/latency &
> cat /proc/$pid/latency
> done
>
> And the task struct which gotten by get_proc_task() is never put.
> put_task_struct() should be called.
>
> This patch changes the private is used to store inode, and the task
> struct will be gotten and putted in read or write function.
>
> Signed-off-by: Hiroshi Shimamoto <h-shimamoto@...jp.nec.com>
Fine with me; Ingo please merge
Thanks for working on this!
--
If you want to reach me at my work email, use arjan@...ux.intel.com
For development, discussion and tips for power savings,
visit http://www.lesswatts.org
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists