]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
io_uring/uring_cmd: use cached cmd_op in io_uring_cmd_sock()
authorJens Axboe <axboe@kernel.dk>
Thu, 23 Jan 2025 00:29:31 +0000 (17:29 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 8 Feb 2025 09:02:17 +0000 (10:02 +0100)
commita089eada0b02d9eb7398ee49a9164eae4a1491c9
tree289338125a117734026381566378798e7f13a2a8
parent0184d8a3b94fc24262f08cd4165e7a02864b365c
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@google.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Sasha Levin <sashal@kernel.org>
io_uring/uring_cmd.c