From: Jens Axboe <[email protected]>
To: Pavel Begunkov <[email protected]>, [email protected]
Subject: Re: [PATCH 5.10] io_uring: fix files grab/cancel race
Date: Thu, 26 Nov 2020 08:50:42 -0700 [thread overview]
Message-ID: <[email protected]> (raw)
In-Reply-To: <687c411007d0ec6a2be092ddc0274046898e43b5.1606329549.git.asml.silence@gmail.com>
On 11/25/20 11:41 AM, Pavel Begunkov wrote:
> When one task is in io_uring_cancel_files() and another is doing
> io_prep_async_work() a race may happen. That's because after accounting
> a request inflight in first call to io_grab_identity() it still may fail
> and go to io_identity_cow(), which migh briefly keep dangling
> work.identity and not only.
>
> Grab files last, so io_prep_async_work() won't fail if it did get into
> ->inflight_list.
>
> note: the bug shouldn't exist after making io_uring_cancel_files() not
> poking into other tasks' requests.
Applied, thanks.
--
Jens Axboe
prev parent reply other threads:[~2020-11-26 15:50 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-11-25 18:41 [PATCH 5.10] io_uring: fix files grab/cancel race Pavel Begunkov
2020-11-26 15:50 ` Jens Axboe [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 \
[email protected] \
[email protected] \
[email protected] \
[email protected] \
/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