linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Eric Biggers <ebiggers@kernel.org>
To: Benjamin LaHaise <bcrl@kvack.org>,
	Alexander Viro <viro@zeniv.linux.org.uk>
Cc: Ramji Jiyani <ramjiyani@google.com>,
	arnd@arndb.de, hch@lst.de, kernel-team@android.com,
	linux-aio@kvack.org, linux-arch@vger.kernel.org,
	linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org,
	oleg@redhat.com, Jeff Moyer <jmoyer@redhat.com>,
	stable@vger.kernel.org
Subject: Re: [PATCH v5] aio: Add support for the POLLFREE
Date: Tue, 23 Nov 2021 11:49:54 -0800	[thread overview]
Message-ID: <YZ1F4qmBJ42VpZp3@gmail.com> (raw)
In-Reply-To: <20211027011834.2497484-1-ramjiyani@google.com>

On Wed, Oct 27, 2021 at 01:18:34AM +0000, Ramji Jiyani wrote:
> Add support for the POLLFREE flag to force complete iocb inline in
> aio_poll_wake(). A thread may use it to signal it's exit and/or request
> to cleanup while pending poll request. In this case, aio_poll_wake()
> needs to make sure it doesn't keep any reference to the queue entry
> before returning from wake to avoid possible use after free via
> poll_cancel() path.
> 
> UAF issue was found during binder and aio interactions in certain
> sequence of events [1].
> 
> The POLLFREE flag is no more exclusive to the epoll and is being
> shared with the aio. Remove comment from poll.h to avoid confusion.
> 
> [1] https://lore.kernel.org/r/CAKUd0B_TCXRY4h1hTztfwWbNSFQqsudDLn2S_28csgWZmZAG3Q@mail.gmail.com/
> 
> Fixes: af5c72b1fc7a ("Fix aio_poll() races")
> Signed-off-by: Ramji Jiyani <ramjiyani@google.com>
> Reviewed-by: Jeff Moyer <jmoyer@redhat.com>
> Reviewed-by: Christoph Hellwig <hch@lst.de>
> Cc: stable@vger.kernel.org # 4.19+
> ---

Looks good, feel free to add:

	Reviewed-by: Eric Biggers <ebiggers@google.com>

I'm still not 100% happy with the commit message, but it's good enough.
The actual code looks correct.

Who is going to take this patch?  This is an important fix; it shouldn't be
sitting ignored for months.  get_maintainer.pl shows:

$ ./scripts/get_maintainer.pl fs/aio.c
Benjamin LaHaise <bcrl@kvack.org> (supporter:AIO)
Alexander Viro <viro@zeniv.linux.org.uk> (maintainer:FILESYSTEMS (VFS and infrastructure))
linux-aio@kvack.org (open list:AIO)
linux-fsdevel@vger.kernel.org (open list:FILESYSTEMS (VFS and infrastructure))
linux-kernel@vger.kernel.org (open list)

- Eric

  reply	other threads:[~2021-11-23 19:50 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-10-27  1:18 [PATCH v5] aio: Add support for the POLLFREE Ramji Jiyani
2021-11-23 19:49 ` Eric Biggers [this message]
2021-11-23 23:23   ` Eric Biggers

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=YZ1F4qmBJ42VpZp3@gmail.com \
    --to=ebiggers@kernel.org \
    --cc=arnd@arndb.de \
    --cc=bcrl@kvack.org \
    --cc=hch@lst.de \
    --cc=jmoyer@redhat.com \
    --cc=kernel-team@android.com \
    --cc=linux-aio@kvack.org \
    --cc=linux-arch@vger.kernel.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=oleg@redhat.com \
    --cc=ramjiyani@google.com \
    --cc=stable@vger.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).