* [PATCH v5.10 1/1] io_uring: Use original task for req identity in io_identity_cow()
@ 2022-07-19 11:52 Lee Jones
2022-07-20 12:48 ` Jens Axboe
0 siblings, 1 reply; 3+ messages in thread
From: Lee Jones @ 2022-07-19 11:52 UTC (permalink / raw)
To: lee
Cc: stable, Jens Axboe, Pavel Begunkov, Alexander Viro, io-uring,
linux-fsdevel
This issue is conceptually identical to the one fixed in 29f077d07051
("io_uring: always use original task when preparing req identity"), so
rather than reinvent the wheel, I'm shamelessly quoting the commit
message from that patch - thanks Jens:
"If the ring is setup with IORING_SETUP_IOPOLL and we have more than
one task doing submissions on a ring, we can up in a situation where
we assign the context from the current task rather than the request
originator.
Always use req->task rather than assume it's the same as current.
No upstream patch exists for this issue, as only older kernels with
the non-native workers have this problem."
Cc: Jens Axboe <[email protected]>
Cc: Pavel Begunkov <[email protected]>
Cc: Alexander Viro <[email protected]>
Cc: [email protected]
Cc: [email protected]
Fixes: 5c3462cfd123b ("io_uring: store io_identity in io_uring_task")
Signed-off-by: Lee Jones <[email protected]>
---
fs/io_uring.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/fs/io_uring.c b/fs/io_uring.c
index 023c3eb34dcca..a952288b2ab8e 100644
--- a/fs/io_uring.c
+++ b/fs/io_uring.c
@@ -1325,7 +1325,7 @@ static void io_req_clean_work(struct io_kiocb *req)
*/
static bool io_identity_cow(struct io_kiocb *req)
{
- struct io_uring_task *tctx = current->io_uring;
+ struct io_uring_task *tctx = req->task->io_uring;
const struct cred *creds = NULL;
struct io_identity *id;
--
2.37.0.170.g444d1eabd0-goog
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH v5.10 1/1] io_uring: Use original task for req identity in io_identity_cow()
2022-07-19 11:52 [PATCH v5.10 1/1] io_uring: Use original task for req identity in io_identity_cow() Lee Jones
@ 2022-07-20 12:48 ` Jens Axboe
2022-07-23 13:54 ` Greg KH
0 siblings, 1 reply; 3+ messages in thread
From: Jens Axboe @ 2022-07-20 12:48 UTC (permalink / raw)
To: Lee Jones; +Cc: stable, Pavel Begunkov, Alexander Viro, io-uring, linux-fsdevel
On 7/19/22 5:52 AM, Lee Jones wrote:
> This issue is conceptually identical to the one fixed in 29f077d07051
> ("io_uring: always use original task when preparing req identity"), so
> rather than reinvent the wheel, I'm shamelessly quoting the commit
> message from that patch - thanks Jens:
>
> "If the ring is setup with IORING_SETUP_IOPOLL and we have more than
> one task doing submissions on a ring, we can up in a situation where
> we assign the context from the current task rather than the request
> originator.
>
> Always use req->task rather than assume it's the same as current.
>
> No upstream patch exists for this issue, as only older kernels with
> the non-native workers have this problem."
Greg, can you pick this one up for 5.10-stable? Thanks!
--
Jens Axboe
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH v5.10 1/1] io_uring: Use original task for req identity in io_identity_cow()
2022-07-20 12:48 ` Jens Axboe
@ 2022-07-23 13:54 ` Greg KH
0 siblings, 0 replies; 3+ messages in thread
From: Greg KH @ 2022-07-23 13:54 UTC (permalink / raw)
To: Jens Axboe
Cc: Lee Jones, stable, Pavel Begunkov, Alexander Viro, io-uring,
linux-fsdevel
On Wed, Jul 20, 2022 at 06:48:09AM -0600, Jens Axboe wrote:
> On 7/19/22 5:52 AM, Lee Jones wrote:
> > This issue is conceptually identical to the one fixed in 29f077d07051
> > ("io_uring: always use original task when preparing req identity"), so
> > rather than reinvent the wheel, I'm shamelessly quoting the commit
> > message from that patch - thanks Jens:
> >
> > "If the ring is setup with IORING_SETUP_IOPOLL and we have more than
> > one task doing submissions on a ring, we can up in a situation where
> > we assign the context from the current task rather than the request
> > originator.
> >
> > Always use req->task rather than assume it's the same as current.
> >
> > No upstream patch exists for this issue, as only older kernels with
> > the non-native workers have this problem."
>
> Greg, can you pick this one up for 5.10-stable? Thanks!
Now queued up, thanks.
greg k-h
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2022-07-23 13:55 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-07-19 11:52 [PATCH v5.10 1/1] io_uring: Use original task for req identity in io_identity_cow() Lee Jones
2022-07-20 12:48 ` Jens Axboe
2022-07-23 13:54 ` Greg KH
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox