Unverified Commit 8c45ad1b authored by openeuler-ci-bot's avatar openeuler-ci-bot Committed by Gitee
Browse files

!15595 io_uring: prevent opcode speculation

parents ddce4568 9c3e4274
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -7196,6 +7196,8 @@ static int io_init_req(struct io_ring_ctx *ctx, struct io_kiocb *req,
	if (!io_check_restriction(ctx, req, sqe_flags))
		return -EACCES;

	req->opcode = array_index_nospec(req->opcode, IORING_OP_LAST);

	if ((sqe_flags & IOSQE_BUFFER_SELECT) &&
	    !io_op_defs[req->opcode].buffer_select)
		return -EOPNOTSUPP;