This is a note to let you know that I've just added the patch titled io_uring: ensure that send/sendmsg and recv/recvmsg check sqe->ioprio to the 5.18-stable tree which can be found at: http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary The filename of the patch is: io_uring-ensure-that-send-sendmsg-and-recv-recvmsg-check-sqe-ioprio.patch and it can be found in the queue-5.18 subdirectory. If you, or anyone else, feels it should not be added to the stable tree, please let <stable@xxxxxxxxxxxxxxx> know about it. >From foo@baz Mon Jul 4 03:23:34 PM CEST 2022 From: Jens Axboe <axboe@xxxxxxxxx> Date: Thu, 30 Jun 2022 14:38:45 -0600 Subject: io_uring: ensure that send/sendmsg and recv/recvmsg check sqe->ioprio From: Jens Axboe <axboe@xxxxxxxxx> commit 73911426aaaadbae54fa72359b33a7b6a56947db upstream. All other opcodes correctly check if this is set and -EINVAL if it is and they don't support that field, for some reason the these were forgotten. This was unified a bit differently in the upstream tree, but had the same effect as making sure we error on this field. Rather than have a painful backport of the upstream commit, just fixup the mentioned opcodes. Signed-off-by: Jens Axboe <axboe@xxxxxxxxx> Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx> --- fs/io_uring.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) --- a/fs/io_uring.c +++ b/fs/io_uring.c @@ -5254,7 +5254,7 @@ static int io_sendmsg_prep(struct io_kio if (unlikely(req->ctx->flags & IORING_SETUP_IOPOLL)) return -EINVAL; - if (unlikely(sqe->addr2 || sqe->file_index)) + if (unlikely(sqe->addr2 || sqe->file_index || sqe->ioprio)) return -EINVAL; sr->umsg = u64_to_user_ptr(READ_ONCE(sqe->addr)); @@ -5467,7 +5467,7 @@ static int io_recvmsg_prep(struct io_kio if (unlikely(req->ctx->flags & IORING_SETUP_IOPOLL)) return -EINVAL; - if (unlikely(sqe->addr2 || sqe->file_index)) + if (unlikely(sqe->addr2 || sqe->file_index || sqe->ioprio)) return -EINVAL; sr->umsg = u64_to_user_ptr(READ_ONCE(sqe->addr)); Patches currently in stable-queue which might be from axboe@xxxxxxxxx are queue-5.18/io_uring-ensure-that-send-sendmsg-and-recv-recvmsg-check-sqe-ioprio.patch queue-5.18/lib-sbitmap-fix-invalid-loop-in-__sbitmap_queue_get_batch.patch