From: Greg KH <gregkh@linuxfoundation.org>
To: Jens Axboe <axboe@kernel.dk>
Cc: forza@tnonline.net, stable@vger.kernel.org
Subject: Re: FAILED: patch "[PATCH] io_uring: fix race in unified task_work running" failed to apply to 5.13-stable tree
Date: Mon, 2 Aug 2021 13:37:25 +0200 [thread overview]
Message-ID: <YQfY9Uh0wfIWqwcE@kroah.com> (raw)
In-Reply-To: <e3a7acb2-41ad-8c7b-c3d2-8f8d5b40f250@kernel.dk>
On Sat, Jul 31, 2021 at 08:44:33AM -0600, Jens Axboe wrote:
> On 7/31/21 12:43 AM, gregkh@linuxfoundation.org wrote:
> >
> > The patch below does not apply to the 5.13-stable tree.
> > If someone wants it applied there, or to any other stable or longterm
> > tree, then please email the backport, including the original git commit
> > id to <stable@vger.kernel.org>.
>
> Here's a tested 5.13-stable port.
>
> From: Jens Axboe <axboe@kernel.dk>
> Subject: io_uring: fix race in unified task_work running
>
> commit 110aa25c3ce417a44e35990cf8ed22383277933a upstream.
>
> We use a bit to manage if we need to add the shared task_work, but
> a list + lock for the pending work. Before aborting a current run
> of the task_work we check if the list is empty, but we do so without
> grabbing the lock that protects it. This can lead to races where
> we think we have nothing left to run, where in practice we could be
> racing with a task adding new work to the list. If we do hit that
> race condition, we could be left with work items that need processing,
> but the shared task_work is not active.
>
> Ensure that we grab the lock before checking if the list is empty,
> so we know if it's safe to exit the run or not.
>
> Link: https://lore.kernel.org/io-uring/c6bd5987-e9ae-cd02-49d0-1b3ac1ef65b1@tnonline.net/
> Cc: stable@vger.kernel.org # 5.11+
> Reported-by: Forza <forza@tnonline.net>
> Tested-by: Forza <forza@tnonline.net>
Now queued up, thanks!
greg k-h
prev parent reply other threads:[~2021-08-02 11:37 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-07-31 6:43 FAILED: patch "[PATCH] io_uring: fix race in unified task_work running" failed to apply to 5.13-stable tree gregkh
2021-07-31 14:44 ` Jens Axboe
2021-08-02 11:37 ` Greg KH [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 \
--in-reply-to=YQfY9Uh0wfIWqwcE@kroah.com \
--to=gregkh@linuxfoundation.org \
--cc=axboe@kernel.dk \
--cc=forza@tnonline.net \
--cc=stable@vger.kernel.org \
/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