[PATCH v2 0/3] net: Finish up ->msg_control{,_user} split

From: Kevin Brodsky
Date: Thu Apr 13 2023 - 07:48:10 EST


Hi,

Commit 1f466e1f15cf ("net: cleanly handle kernel vs user buffers for
->msg_control") introduced the msg_control_user and
msg_control_is_user fields in struct msghdr, to ensure that user
pointers are represented as such. It also took care of converting most
users of struct msghdr::msg_control where user pointers are involved. It
did however miss a number of cases, and some code using msg_control
inappropriately has also appeared in the meantime.

This series is attempting to complete the split, by eliminating the
remaining cases where msg_control is used when in fact a user
pointer is stored in the union (patch 1).

It also addresses a couple of issues with msg_control_is_user: one where
it is not updated as it should (patch 2), and one where it is not
initialised (patch 3).

v1..v2:
* Split out the msg_control_is_user fixes into separate patches.

v1: https://lore.kernel.org/all/20230411122625.3902339-1-kevin.brodsky@xxxxxxx/

Thanks,
Kevin

Cc: Christoph Hellwig <hch@xxxxxx>
Cc: Eric Dumazet <edumazet@xxxxxxxxxx>
Cc: "David S. Miller" <davem@xxxxxxxxxxxxx>
Cc: Jakub Kicinski <kuba@xxxxxxxxxx>

Kevin Brodsky (3):
net: Ensure ->msg_control_user is used for user buffers
net/compat: Update msg_control_is_user when setting a kernel pointer
net/ipv6: Initialise msg_control_is_user

net/compat.c | 13 +++++++------
net/core/scm.c | 9 ++++++---
net/ipv4/tcp.c | 4 ++--
net/ipv6/ipv6_sockglue.c | 1 +
4 files changed, 16 insertions(+), 11 deletions(-)

--
2.38.1