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

Message ID 20230413114705.157046-1-kevin.brodsky@arm.com
Headers
Series net: Finish up ->msg_control{,_user} split |

Message

Kevin Brodsky April 13, 2023, 11:47 a.m. UTC
  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@arm.com/

Thanks,
Kevin

Cc: Christoph Hellwig <hch@lst.de>
Cc: Eric Dumazet <edumazet@google.com>
Cc: "David S. Miller" <davem@davemloft.net>
Cc: Jakub Kicinski <kuba@kernel.org>

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(-)
  

Comments

patchwork-bot+netdevbpf@kernel.org April 14, 2023, 10:30 a.m. UTC | #1
Hello:

This series was applied to netdev/net-next.git (main)
by David S. Miller <davem@davemloft.net>:

On Thu, 13 Apr 2023 12:47:02 +0100 you wrote:
> 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.
> 
> [...]

Here is the summary with links:
  - [v2,1/3] net: Ensure ->msg_control_user is used for user buffers
    https://git.kernel.org/netdev/net-next/c/c39ef2130491
  - [v2,2/3] net/compat: Update msg_control_is_user when setting a kernel pointer
    https://git.kernel.org/netdev/net-next/c/60daf8d40b80
  - [v2,3/3] net/ipv6: Initialise msg_control_is_user
    https://git.kernel.org/netdev/net-next/c/b6d85cf5bd14

You are awesome, thank you!