Skip to content

Commit a464355

Browse files
committed
io_uring/cmd_net: use READ_ONCE() for ->addr3 read
Any SQE read should use READ_ONCE(), to ensure the result is read once and only once. Doesn't really matter for this case, but it's better to keep these 100% consistent and always use READ_ONCE() for the prep side of SQE handling. Fixes: 5d24321 ("io_uring: Introduce getsockname io_uring cmd") Signed-off-by: Jens Axboe <axboe@kernel.dk>
1 parent ea129e5 commit a464355

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

io_uring/cmd_net.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ static int io_uring_cmd_getsockname(struct socket *sock,
146146
return -EINVAL;
147147

148148
uaddr = u64_to_user_ptr(READ_ONCE(sqe->addr));
149-
ulen = u64_to_user_ptr(sqe->addr3);
149+
ulen = u64_to_user_ptr(READ_ONCE(sqe->addr3));
150150
peer = READ_ONCE(sqe->optlen);
151151
if (peer > 1)
152152
return -EINVAL;

0 commit comments

Comments
 (0)