]> www.infradead.org Git - users/jedix/linux-maple.git/commit
io_uring/net: verify msghdr before copying iovec
authorPavel Begunkov <asml.silence@gmail.com>
Wed, 26 Feb 2025 11:41:18 +0000 (11:41 +0000)
committerJens Axboe <axboe@kernel.dk>
Thu, 27 Feb 2025 14:27:55 +0000 (07:27 -0700)
commit00a9143d9872d9913a14ef1116b140ff346acd3e
tree9ce44401471ef5f3e78e963759413115c1034612
parenta223e96f7305fc482b4b41424e53d12ef693793d
io_uring/net: verify msghdr before copying iovec

Normally, net/ would verify msghdr before importing iovec, for example
see copy_msghdr_from_user(), which further assumed by __copy_msghdr()
validating msg->msg_iovlen.

io_uring does it in reverse order, which is fine, but it'll be more
convenient for flip it so that the iovec business is done at the end and
eventually can be nicely pulled out of msghdr parsing section and
thought as a sepaarate step. That also makes structure accesses more
localised, which should be better for caches.

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