From: Christoph Hellwig <hch@lst•de>
To: Kevin Brodsky <kevin.brodsky@arm•com>
Cc: netdev@vger•kernel.org, linux-kernel@vger•kernel.org,
Christoph Hellwig <hch@lst•de>,
Eric Dumazet <edumazet@google•com>,
"David S. Miller" <davem@davemloft•net>,
Jakub Kicinski <kuba@kernel•org>
Subject: Re: [PATCH] net: Finish up ->msg_control{,_user} split
Date: Wed, 12 Apr 2023 17:25:48 +0200 [thread overview]
Message-ID: <20230412152548.GA26786@lst.de> (raw)
In-Reply-To: <20230411122625.3902339-1-kevin.brodsky@arm.com>
On Tue, Apr 11, 2023 at 01:26:25PM +0100, Kevin Brodsky wrote:
> This patch is attempting to complete the split. Most issues are about
> msg_control being used when in fact a user pointer is stored in the
> union; msg_control_user is now used instead. An exception is made
> for null checks, as it should be safe to use msg_control
> unconditionally for that purpose.
So all of the fixes looks good to me.
> Additionally, a special situation in
> cmsghdr_from_user_compat_to_kern() is addressed. There the input
> struct msghdr holds a user pointer (msg_control_user), but a kernel
> pointer is stored in msg_control when returning. msg_control_is_user
> is now updated accordingly.
But this is a small isolated real bugfix. So I'd suggest to split
this into a simple and easily backportable patch, and do the rest
in another.
> diff --git a/net/ipv6/ipv6_sockglue.c b/net/ipv6/ipv6_sockglue.c
> index 2917dd8d198c..ae818ff46224 100644
> --- a/net/ipv6/ipv6_sockglue.c
> +++ b/net/ipv6/ipv6_sockglue.c
> @@ -716,6 +716,7 @@ int do_ipv6_setsockopt(struct sock *sk, int level, int optname,
> goto done;
>
> msg.msg_controllen = optlen;
> + msg.msg_control_is_user = false;
And this is another one that has a real effect.
next prev parent reply other threads:[~2023-04-12 15:25 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-04-11 12:26 [PATCH] net: Finish up ->msg_control{,_user} split Kevin Brodsky
2023-04-12 15:25 ` Christoph Hellwig [this message]
2023-04-13 8:34 ` Kevin Brodsky
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20230412152548.GA26786@lst.de \
--to=hch@lst$(echo .)de \
--cc=davem@davemloft$(echo .)net \
--cc=edumazet@google$(echo .)com \
--cc=kevin.brodsky@arm$(echo .)com \
--cc=kuba@kernel$(echo .)org \
--cc=linux-kernel@vger$(echo .)kernel.org \
--cc=netdev@vger$(echo .)kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox