All of lore.kernel.org
 help / color / mirror / Atom feed
From: Greg KH <greg@kroah.com>
To: Oleg Nesterov <oleg@redhat.com>
Cc: akpm@linux-foundation.org, linux-fsdevel@vger.kernel.org,
	stable@kernel.org, andi@firstfloor.org, viro@zeniv.linux.org.uk,
	corbet@lwn.net
Subject: Re: [stable] [patch for 2.6.29? 1/3] pipe_rdwr_fasync: fix the error handling to prevent the leak/crash
Date: Thu, 12 Mar 2009 22:02:56 -0700	[thread overview]
Message-ID: <20090313050256.GG6321@kroah.com> (raw)
In-Reply-To: <20090304205128.GA19304@redhat.com>

On Wed, Mar 04, 2009 at 09:51:28PM +0100, Oleg Nesterov wrote:
> On 03/04, Andrew Morton wrote:
> >
> > From: Oleg Nesterov <oleg@redhat.com>
> >
> > If the second fasync_helper() fails, pipe_rdwr_fasync() returns the error
> > but leaves the file on ->fasync_readers.
> >
> > This was always wrong, but since 233e70f4228e78eb2f80dc6650f65d3ae3dbf17c
> > "saner FASYNC handling on file close" we have the new problem.  Because in
> > this case setfl() doesn't set FASYNC bit, __fput() will not do
> > ->fasync(0), and we leak fasync_struct with ->fa_file pointing to the
> > freed file.
> >
> > Signed-off-by: Oleg Nesterov <oleg@redhat.com>
> > Cc: Al Viro <viro@ZenIV.linux.org.uk>
> > Cc: Andi Kleen <andi@firstfloor.org>
> > Cc: Jonathan Corbet <corbet@lwn.net>
> > Cc: <stable@kernel.org>		[2.6.28.x]
> > Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
> 
> Just in case...
> 
> This bug is minor. fasync_helper() can only fail if
> kmem_cache_alloc(fasync_cache, GFP_KERNEL) fails, this should "never" happen.
> 
> Perhaps -stable doesn't need this fix.

Can't hurt, right?

thanks,

greg k-h

      reply	other threads:[~2009-03-13  5:13 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-03-04 20:12 [patch for 2.6.29? 1/3] pipe_rdwr_fasync: fix the error handling to prevent the leak/crash akpm
2009-03-04 20:51 ` Oleg Nesterov
2009-03-13  5:02   ` Greg KH [this message]

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=20090313050256.GG6321@kroah.com \
    --to=greg@kroah.com \
    --cc=akpm@linux-foundation.org \
    --cc=andi@firstfloor.org \
    --cc=corbet@lwn.net \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=oleg@redhat.com \
    --cc=stable@kernel.org \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.