Re: [stable] [patch for 2.6.29? 1/3] pipe_rdwr_fasync: fix the error handling to prevent the leak/crash

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, Mar 04, 2009 at 09:51:28PM +0100, Oleg Nesterov wrote:
> On 03/04, Andrew Morton wrote:
> >
> > From: Oleg Nesterov <oleg@xxxxxxxxxx>
> >
> > 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@xxxxxxxxxx>
> > Cc: Al Viro <viro@xxxxxxxxxxxxxxxxxx>
> > Cc: Andi Kleen <andi@xxxxxxxxxxxxxx>
> > Cc: Jonathan Corbet <corbet@xxxxxxx>
> > Cc: <stable@xxxxxxxxxx>		[2.6.28.x]
> > Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx>
> 
> 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
--
To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Ext4 Filesystem]     [Union Filesystem]     [Filesystem Testing]     [Ceph Users]     [Ecryptfs]     [AutoFS]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux Cachefs]     [Reiser Filesystem]     [Linux RAID]     [Samba]     [Device Mapper]     [CEPH Development]
  Powered by Linux