diff options
| author | Jens Axboe <axboe@kernel.dk> | 2026-02-24 11:36:09 -0700 |
|---|---|---|
| committer | Sasha Levin <sashal@kernel.org> | 2026-03-12 07:09:18 -0400 |
| commit | 10197d016d0f7ee33ba5d0a4e1e455b53cf427e3 (patch) | |
| tree | 5ad827542ba5a1611a3335104231dc4cefa84eae /io_uring | |
| parent | 7b37067241947ddb59ee3afda3acd6088de122f6 (diff) | |
io_uring/cmd_net: use READ_ONCE() for ->addr3 read
[ Upstream commit a46435537a844d0f7b4b620baf962cad136422de ]
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: 5d24321e4c15 ("io_uring: Introduce getsockname io_uring cmd")
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'io_uring')
| -rw-r--r-- | io_uring/cmd_net.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/io_uring/cmd_net.c b/io_uring/cmd_net.c index 3db34e2d22ee..17d499f68fe6 100644 --- a/io_uring/cmd_net.c +++ b/io_uring/cmd_net.c @@ -145,7 +145,7 @@ static int io_uring_cmd_getsockname(struct socket *sock, return -EINVAL; uaddr = u64_to_user_ptr(READ_ONCE(sqe->addr)); - ulen = u64_to_user_ptr(sqe->addr3); + ulen = u64_to_user_ptr(READ_ONCE(sqe->addr3)); peer = READ_ONCE(sqe->optlen); if (peer > 1) return -EINVAL; |
