From: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
To: Andrew Morton <akpm@linux-foundation.org>,
Andre Goddard Rosa <andre.goddard@gmail.com>
Cc: kosaki.motohiro@jp.fujitsu.com,
Alexander Viro <viro@zeniv.linux.org.uk>,
Roland McGrath <roland@redhat.com>, WANG Cong <amwang@redhat.com>,
linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] binfmt_elf: plug a memory leak situation on dump_seek()
Date: Wed, 3 Mar 2010 11:02:08 +0900 (JST) [thread overview]
Message-ID: <20100303105911.D63A.A69D9226@jp.fujitsu.com> (raw)
In-Reply-To: <20100302124206.4e0a42b4.akpm@linux-foundation.org>
> On Fri, 26 Feb 2010 00:54:40 -0300
> Andr__ Goddard Rosa <andre.goddard@gmail.com> wrote:
>
> > Signed-off-by: Andr__ Goddard Rosa <andre.goddard@gmail.com>
> > ---
> > fs/binfmt_elf.c | 10 +++++++---
> > 1 files changed, 7 insertions(+), 3 deletions(-)
> >
> > diff --git a/fs/binfmt_elf.c b/fs/binfmt_elf.c
> > index fd5b2ea..13b0845 100644
> > --- a/fs/binfmt_elf.c
> > +++ b/fs/binfmt_elf.c
> > @@ -1096,6 +1096,8 @@ static int dump_write(struct file *file, const void *addr, int nr)
> >
> > static int dump_seek(struct file *file, loff_t off)
> > {
> > + int ret = 1;
> > +
> > if (file->f_op->llseek && file->f_op->llseek != no_llseek) {
> > if (file->f_op->llseek(file, off, SEEK_CUR) < 0)
> > return 0;
> > @@ -1107,13 +1109,15 @@ static int dump_seek(struct file *file, loff_t off)
> > unsigned long n = off;
> > if (n > PAGE_SIZE)
> > n = PAGE_SIZE;
> > - if (!dump_write(file, buf, n))
> > - return 0;
> > + if (!dump_write(file, buf, n)) {
> > + ret = 0;
> > + break;
> > + }
> > off -= n;
> > }
> > free_page((unsigned long)buf);
> > }
> > - return 1;
> > + return ret;
> > }
>
> Please don't send unchangelogged patches.
>
> Explain the leak.
>
> Explain the user impact (ie: how it is triggered).
>
> Explain how the patch fixes it.
>
> Thanks.
Hi Andre,
plus, can you please rebase this patch onto -mmotm tree? it have lots elf core dump related
fix and it is going to be merged at this merge window, maybe.
I think your patch is correct. but I hope to avoid patch confliction.
Thanks.
next prev parent reply other threads:[~2010-03-03 2:02 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-02-26 3:54 André Goddard Rosa
2010-03-02 20:42 ` Andrew Morton
2010-03-03 2:02 ` KOSAKI Motohiro [this message]
2010-03-03 2:17 ` André Goddard Rosa
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=20100303105911.D63A.A69D9226@jp.fujitsu.com \
--to=kosaki.motohiro@jp.fujitsu.com \
--cc=akpm@linux-foundation.org \
--cc=amwang@redhat.com \
--cc=andre.goddard@gmail.com \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=roland@redhat.com \
--cc=viro@zeniv.linux.org.uk \
/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®