Skip to content

Commit a089ead

Browse files
axboegregkh
authored andcommitted
io_uring/uring_cmd: use cached cmd_op in io_uring_cmd_sock()
[ Upstream commit d58d82b ] io_uring_cmd_sock() does a normal read of cmd->sqe->cmd_op, where it really should be using a READ_ONCE() as ->sqe may still be pointing to the original SQE. Since the prep side already does this READ_ONCE() and stores it locally, use that value rather than re-read it. Fixes: 8e9fad0 ("io_uring: Add io_uring command support for sockets") Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Jens Axboe <[email protected]> Signed-off-by: Sasha Levin <[email protected]>
1 parent 0184d8a commit a089ead

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

io_uring/uring_cmd.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -362,7 +362,7 @@ int io_uring_cmd_sock(struct io_uring_cmd *cmd, unsigned int issue_flags)
362362
if (!prot || !prot->ioctl)
363363
return -EOPNOTSUPP;
364364

365-
switch (cmd->sqe->cmd_op) {
365+
switch (cmd->cmd_op) {
366366
case SOCKET_URING_OP_SIOCINQ:
367367
ret = prot->ioctl(sk, SIOCINQ, &arg);
368368
if (ret)

0 commit comments

Comments
 (0)