Patch "io_uring/uring_cmd: use cached cmd_op in io_uring_cmd_sock()" has been added to the 6.12-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a note to let you know that I've just added the patch titled

    io_uring/uring_cmd: use cached cmd_op in io_uring_cmd_sock()

to the 6.12-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     io_uring-uring_cmd-use-cached-cmd_op-in-io_uring_cmd.patch
and it can be found in the queue-6.12 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.



commit 755748f55974709ced84df67dc3e9859b45c5060
Author: Jens Axboe <axboe@xxxxxxxxx>
Date:   Wed Jan 22 17:29:31 2025 -0700

    io_uring/uring_cmd: use cached cmd_op in io_uring_cmd_sock()
    
    [ Upstream commit d58d82bd0efd6c8edd452fc2f6c6dd052ec57cb2 ]
    
    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@xxxxxxxxxx
    Signed-off-by: Jens Axboe <axboe@xxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/io_uring/uring_cmd.c b/io_uring/uring_cmd.c
index 883510a3e8d07..874f9e2defd58 100644
--- a/io_uring/uring_cmd.c
+++ b/io_uring/uring_cmd.c
@@ -340,7 +340,7 @@ int io_uring_cmd_sock(struct io_uring_cmd *cmd, unsigned int issue_flags)
 	if (!prot || !prot->ioctl)
 		return -EOPNOTSUPP;
 
-	switch (cmd->sqe->cmd_op) {
+	switch (cmd->cmd_op) {
 	case SOCKET_URING_OP_SIOCINQ:
 		ret = prot->ioctl(sk, SIOCINQ, &arg);
 		if (ret)




[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux