mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Arjan van de Ven <arjan@linux.intel.com>
To: Hiroshi Shimamoto <h-shimamoto@ct.jp.nec.com>
Cc: linux-kernel@vger.kernel.org, Ingo Molnar <mingo@elte.hu>
Subject: Re: [PATCH] latencytop: fix kernel panic and memory leak on proc
Date: Thu, 14 Feb 2008 16:42:16 -0800	[thread overview]
Message-ID: <20080214164216.45ebf51f@laptopd505.fenrus.org> (raw)
In-Reply-To: <47B4C5E7.5000802@ct.jp.nec.com>

On Thu, 14 Feb 2008 14:51:19 -0800
Hiroshi Shimamoto <h-shimamoto@ct.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@ct.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@ct.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@linux.intel.com
For development, discussion and tips for power savings, 
visit http://www.lesswatts.org

  reply	other threads:[~2008-02-15  0:48 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-02-14 22:51 Hiroshi Shimamoto
2008-02-15  0:42 ` Arjan van de Ven [this message]
2008-02-15  1:13   ` Ingo Molnar
2008-02-19 17:33     ` Hiroshi Shimamoto
2008-02-21  0:53     ` [PATCH] latencytop: change /proc task_struct access method Hiroshi Shimamoto

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20080214164216.45ebf51f@laptopd505.fenrus.org \
    --to=arjan@linux.intel.com \
    --cc=h-shimamoto@ct.jp.nec.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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®