Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

io_uring/uring_cmd: use cached cmd_op in io_uring_cmd_sock()

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: 8e9fad0e70b7b ("io_uring: Add io_uring command support for sockets")
Link: https://lore.kernel.org/r/20250121-uring-sockcmd-fix-v1-1-add742802a29@google.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>

+1 -1
+1 -1
io_uring/uring_cmd.c
··· 350 350 if (!prot || !prot->ioctl) 351 351 return -EOPNOTSUPP; 352 352 353 - switch (cmd->sqe->cmd_op) { 353 + switch (cmd->cmd_op) { 354 354 case SOCKET_URING_OP_SIOCINQ: 355 355 ret = prot->ioctl(sk, SIOCINQ, &arg); 356 356 if (ret)