| From 036b5f25ab2930091c39768a5c19dda0cbc63a50 Mon Sep 17 00:00:00 2001 |
| From: Sasha Levin <sashal@kernel.org> |
| Date: Fri, 28 Mar 2025 23:11:50 +0000 |
| Subject: io_uring/msg: initialise msg request opcode |
| |
| From: Pavel Begunkov <asml.silence@gmail.com> |
| |
| [ Upstream commit 9cc0bbdaba2a66ad90bc6ce45163b7745baffe98 ] |
| |
| It's risky to have msg request opcode set to garbage, so at least |
| initialise it to nop. Later we might want to add a user inaccessible |
| opcode for such cases. |
| |
| Signed-off-by: Pavel Begunkov <asml.silence@gmail.com> |
| Link: https://lore.kernel.org/r/9afe650fcb348414a4529d89f52eb8969ba06efd.1743190078.git.asml.silence@gmail.com |
| Signed-off-by: Jens Axboe <axboe@kernel.dk> |
| Signed-off-by: Sasha Levin <sashal@kernel.org> |
| --- |
| io_uring/msg_ring.c | 1 + |
| 1 file changed, 1 insertion(+) |
| |
| diff --git a/io_uring/msg_ring.c b/io_uring/msg_ring.c |
| index 7e6f68e911f10..f844ab24cda42 100644 |
| --- a/io_uring/msg_ring.c |
| +++ b/io_uring/msg_ring.c |
| @@ -93,6 +93,7 @@ static int io_msg_remote_post(struct io_ring_ctx *ctx, struct io_kiocb *req, |
| kmem_cache_free(req_cachep, req); |
| return -EOWNERDEAD; |
| } |
| + req->opcode = IORING_OP_NOP; |
| req->cqe.user_data = user_data; |
| io_req_set_res(req, res, cflags); |
| percpu_ref_get(&ctx->refs); |
| -- |
| 2.39.5 |
| |