Commit f1c35114 authored by Jens Axboe's avatar Jens Axboe Committed by sanglipeng
Browse files

io_uring/net: save msghdr->msg_control for retries

stable inclusion
from stable-v5.10.186
commit 5fdea4468f57db3fc304e366d03d7214ca3a209e
category: bugfix
bugzilla: https://gitee.com/openeuler/kernel/issues/I8L5XP

Reference: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=5fdea4468f57db3fc304e366d03d7214ca3a209e

--------------------------------

Commit cac9e441 upstream.

If the application sets ->msg_control and we have to later retry this
command, or if it got queued with IOSQE_ASYNC to begin with, then we
need to retain the original msg_control value. This is due to the net
stack overwriting this field with an in-kernel pointer, to copy it
in. Hitting that path for the second time will now fail the copy from
user, as it's attempting to copy from a non-user address.

Cc: stable@vger.kernel.org # 5.10+
Link: https://github.com/axboe/liburing/issues/880


Reported-and-tested-by: default avatarMarek Majkowski <marek@cloudflare.com>
Signed-off-by: default avatarJens Axboe <axboe@kernel.dk>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: default avatarsanglipeng <sanglipeng1@jd.com>
parent bec7ea1a
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment