]> www.infradead.org Git - users/hch/misc.git/commit
io_uring/net: don't alias send user pointer reads
authorPavel Begunkov <asml.silence@gmail.com>
Tue, 22 Oct 2024 14:43:14 +0000 (15:43 +0100)
committerJens Axboe <axboe@kernel.dk>
Tue, 29 Oct 2024 19:43:27 +0000 (13:43 -0600)
commit52838787350d4ea8132804940d5308d95ce5e035
treeddc25c24f0d979960168277f02a1ce8cd2808260
parentad438d070a3bf2a3ae45b59a885a5d7b0dbbc465
io_uring/net: don't alias send user pointer reads

We keep user pointers in an union, which could be a user buffer or a
user pointer to msghdr. What is confusing is that it potenitally reads
and assigns sqe->addr as one type but then uses it as another via the
union. Even more, it's not even consistent across copy and zerocopy
versions.

Make send and sendmsg setup helpers read sqe->addr and treat it as the
right type from the beginning. The end goal would be to get rid of
the use of struct io_sr_msg::umsg for send requests as we only need it
at the prep side.

Signed-off-by: Pavel Begunkov <asml.silence@gmail.com>
Link: https://lore.kernel.org/r/685d788605f5d78af18802fcabf61ba65cfd8002.1729607201.git.asml.silence@gmail.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
io_uring/net.c