]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
net: disallow ancillary data for __sys_{send,recv}msg_file()
authorJens Axboe <axboe@kernel.dk>
Tue, 26 Nov 2019 00:04:13 +0000 (17:04 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 4 Dec 2019 21:30:44 +0000 (22:30 +0100)
commitd6245944452ce4592ea975491f5e90e75b346bef
tree514e6d2aa169ebbfd39d106d1d24e7b3779b2596
parent78df03e4c892a09ebfd9045a427d656805964552
net: disallow ancillary data for __sys_{send,recv}msg_file()

[ Upstream commit d69e07793f891524c6bbf1e75b9ae69db4450953 ]

Only io_uring uses (and added) these, and we want to disallow the
use of sendmsg/recvmsg for anything but regular data transfers.
Use the newly added prep helper to split the msghdr copy out from
the core function, to check for msg_control and msg_controllen
settings. If either is set, we return -EINVAL.

Acked-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Sasha Levin <sashal@kernel.org>
net/socket.c