From: Greg Kroah-Hartman Date: Mon, 16 May 2022 21:13:20 +0000 (+0200) Subject: 5.10-stable patches X-Git-Tag: v4.9.315~3 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=7b4187904ba10c6975426d19257f64a3decb737c;p=thirdparty%2Fkernel%2Fstable-queue.git 5.10-stable patches added patches: io_uring-always-use-original-task-when-preparing-req-identity.patch --- diff --git a/queue-5.10/io_uring-always-use-original-task-when-preparing-req-identity.patch b/queue-5.10/io_uring-always-use-original-task-when-preparing-req-identity.patch new file mode 100644 index 00000000000..c7734bd59d8 --- /dev/null +++ b/queue-5.10/io_uring-always-use-original-task-when-preparing-req-identity.patch @@ -0,0 +1,35 @@ +From foo@baz Mon May 16 11:05:51 PM CEST 2022 +Date: Mon, 16 May 2022 23:05:51 +0200 +From: Jens Axboe +Subject: io_uring: always use original task when preparing req identity + +From: Jens Axboe + +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. + +Reported-by: Kyle Zeng +Signed-off-by: Jens Axboe +Signed-off-by: Greg Kroah-Hartman +--- + fs/io_uring.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/fs/io_uring.c ++++ b/fs/io_uring.c +@@ -1156,7 +1156,7 @@ static inline void __io_req_init_async(s + */ + static inline void io_req_init_async(struct io_kiocb *req) + { +- struct io_uring_task *tctx = current->io_uring; ++ struct io_uring_task *tctx = req->task->io_uring; + + if (req->flags & REQ_F_WORK_INITIALIZED) + return; diff --git a/queue-5.10/series b/queue-5.10/series index 861d7e21afd..7f575b4ad13 100644 --- a/queue-5.10/series +++ b/queue-5.10/series @@ -64,3 +64,4 @@ arm-memremap-don-t-abuse-pfn_valid-to-ensure-presence-of-linear-map.patch ping-fix-address-binding-wrt-vrf.patch usb-gadget-uvc-rename-function-to-be-more-consistent.patch usb-gadget-uvc-allow-for-application-to-cleanly-shutdown.patch +io_uring-always-use-original-task-when-preparing-req-identity.patch