From: Jeff Moyer <jmoyer@redhat.com>
To: Al Viro <viro@ZenIV.linux.org.uk>
Cc: Linus Torvalds <torvalds@linux-foundation.org>,
Benjamin LaHaise <bcrl@kvack.org>,
linux-kernel@vger.kernel.org, linux-aio@kvack.org
Subject: Re: [PATCH] aio: fix io_setup/io_destroy race
Date: Wed, 07 Mar 2012 13:16:18 -0500 [thread overview]
Message-ID: <x49obs8uvil.fsf@segfault.boston.devel.redhat.com> (raw)
In-Reply-To: <20120307051634.GR23916@ZenIV.linux.org.uk> (Al Viro's message of "Wed, 7 Mar 2012 05:16:35 +0000")
Al Viro <viro@ZenIV.linux.org.uk> writes:
> Have ioctx_alloc() return an extra reference, so that caller would drop it
> on success and not bother with re-grabbing it on failure exit. The current
> code is obviously broken - io_destroy() from another thread that managed
> to guess the address io_setup() would've returned would free ioctx right
> under us; gets especially interesting if aio_context_t * we pass to
> io_setup() points to PROT_READ mapping, so put_user() fails and we end
> up doing io_destroy() on kioctx another thread has just got freed...
Al, you certainly are creative. ;-) I agree with the problem and the
fix. It would be nice, though if you had added comments.
I ran xfstests ./check -g aio, and there were no problems.
Reviewed-by: Jeff Moyer <jmoyer@redhat.com>
next prev parent reply other threads:[~2012-03-07 18:16 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-03-07 5:16 Al Viro
2012-03-07 16:50 ` Benjamin LaHaise
2012-03-07 18:16 ` Jeff Moyer [this message]
2012-03-08 17:51 ` [PATCH] aio: fix the "too late munmap()" race Al Viro
2012-03-08 18:15 ` Jeff Moyer
2012-03-10 2:13 ` Benjamin LaHaise
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=x49obs8uvil.fsf@segfault.boston.devel.redhat.com \
--to=jmoyer@redhat.com \
--cc=bcrl@kvack.org \
--cc=linux-aio@kvack.org \
--cc=linux-kernel@vger.kernel.org \
--cc=torvalds@linux-foundation.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Powered by JetHome