lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [day] [month] [year] [list]
Date:	Thu, 25 Jan 2007 10:01:34 +0100
From:	Sébastien Dugué <sebastien.dugue@...l.net>
To:	Andrew Morton <akpm@...l.org>
Cc:	linux-kernel <linux-kernel@...r.kernel.org>,
	linux-aio <linux-aio@...ck.org>,
	Bharata B Rao <bharata@...ibm.com>,
	Christoph Hellwig <hch@...radead.org>,
	Suparna Bhattacharya <suparna@...ibm.com>,
	Ulrich Drepper <drepper@...hat.com>,
	Zach Brown <zach.brown@...cle.com>,
	Badari Pulavarty <pbadari@...ibm.com>,
	Jean Pierre Dion <jean-pierre.dion@...l.net>
Subject: [PATCH -mm] AIO - Comment aio_setup_sigevent() explaining why there
 is no task ref leak


  Here it is

On Thu, 25 Jan 2007 05:42:42 +0000 Christoph Hellwig <hch@...radead.org> wrote:

> On Wed, Jan 24, 2007 at 12:11:30PM +0100, S?bastien Dugu? wrote:
> > > > +	if (unlikely(!notify->sigq))
> > > > +		return -EAGAIN;
> > > 
> > > Did this just leak a ref on the task_struct?
> > > 
> > 
> >   No, the ref is released in really_put_req() when we dispose of
> > the iocb.
> 
> And the code really needs a comment explaining this.  I tripped over
> this before, and I think it's even already the second time Andrew
> stumbled over it.
> 

From: Sébastien Dugué <sebastien.dugue@...l.net>

  Add a comment explaining why there is no task ref leak in
aio_setup_sigevent().


 aio.c |    5 +++++
 1 file changed, 5 insertions(+)


Signed-off-by: Sébastien Dugué <sebastien.dugue@...l.net>

Index: linux-2.6.20-rc4-mm1/fs/aio.c
===================================================================
--- linux-2.6.20-rc4-mm1.orig/fs/aio.c	2007-01-17 08:59:16.000000000 +0100
+++ linux-2.6.20-rc4-mm1/fs/aio.c	2007-01-25 09:52:29.000000000 +0100
@@ -987,6 +987,11 @@ static long aio_setup_sigevent(struct ai
 	 */
 	notify->sigq = sigqueue_alloc();
 
+	/*
+	 * The task ref will be released in really_put_req()
+	 * when we dispose of the iocb later on in the submission
+	 * path.
+	 */
 	if (unlikely(!notify->sigq))
 		return -EAGAIN;
 
-
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

Powered by Openwall GNU/*/Linux Powered by OpenVZ