mirror of
git://git.kernel.org/pub/scm/linux/kernel/git/xiang/erofs.git
synced 2026-10-31 22:34:33 +01:00
io_uring: prevent opcode speculation
sqe->opcode is used for different tables, make sure we santitise it
against speculations.
Cc: [email protected]
Fixes: d3656344fe ("io_uring: add lookup table for various opcode needs")
Signed-off-by: Pavel Begunkov <[email protected]>
Reviewed-by: Li Zetao <[email protected]>
Link: https://lore.kernel.org/r/7eddbf31c8ca0a3947f8ed98271acc2b4349c016.1739568408.git.asml.silence@gmail.com
Signed-off-by: Jens Axboe <[email protected]>
This commit is contained in:
1 parent
13918315c5
commit
1e988c3fe1
1 file changed
+2
@@ -2045,6 +2045,8 @@ static int io_init_req(struct io_ring_ctx *ctx, struct io_kiocb *req,
|
||||
req->opcode = 0;
|
||||
return io_init_fail_req(req, -EINVAL);
|
||||
}
|
||||
opcode = array_index_nospec(opcode, IORING_OP_LAST);
|
||||
|
||||
def = &io_issue_defs[opcode];
|
||||
if (unlikely(sqe_flags & ~SQE_COMMON_FLAGS)) {
|
||||
/* enforce forwards compatibility on users */
|
||||
|
||||
Reference in new issue
Block a user