From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: Paolo Abeni <pabeni@redhat.com>
Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
"David S. Miller" <davem@davemloft.net>,
David Ahern <dsahern@kernel.org>,
Eric Dumazet <edumazet@google.com>,
Jakub Kicinski <kuba@kernel.org>, Simon Horman <horms@kernel.org>,
stable <stable@kernel.org>
Subject: Re: [PATCH net] ipv4: clamp MCAST_MSFILTER getsockopt to optlen, not gf_numsrc
Date: Thu, 23 Apr 2026 17:06:42 +0200 [thread overview]
Message-ID: <2026042344-ferry-mystify-74ee@gregkh> (raw)
In-Reply-To: <a8634793-e905-4298-bf48-ba9a2e9c3eee@redhat.com>
On Thu, Apr 23, 2026 at 04:29:06PM +0200, Paolo Abeni wrote:
> On 4/23/26 4:18 PM, Greg Kroah-Hartman wrote:
> > On Thu, Apr 23, 2026 at 03:57:55PM +0200, Paolo Abeni wrote:
> >> On 4/20/26 9:26 PM, Greg Kroah-Hartman wrote:
> >>> @@ -1486,8 +1491,12 @@ static int compat_ip_get_mcast_msfilter(struct sock *sk, sockptr_t optval,
> >>> gf.gf_interface = gf32.gf_interface;
> >>> gf.gf_fmode = gf32.gf_fmode;
> >>> num = gf.gf_numsrc = gf32.gf_numsrc;
> >>> - gf.gf_group = gf32.gf_group;
> >>>
> >>> + if (num > (len - size0) / sizeof(struct sockaddr_storage))
> >>> + num = (len - size0) / sizeof(struct sockaddr_storage);
> >>> + gf.gf_numsrc = num;
> >>
> >> Since this is exactly the same code added above, likely a common helper
> >> would be useful.
> >
> > Useful where else?
>
> Just in these 2 functions, to avoid duplicating the logic.
>
> Not a big deal, but it would feel nicer. Also the
>
> gf.gf_group = gf32.gf_group;
>
> statement is moved around but such change is not needed, right?
It's just moved down, I inserted the check/assignment before that line,
and git diff shows that as remove/add for some reason :(
thansk,
greg k-h
prev parent reply other threads:[~2026-04-23 15:06 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-04-20 19:26 [PATCH net] ipv4: clamp MCAST_MSFILTER getsockopt to optlen, not gf_numsrc Greg Kroah-Hartman
2026-04-23 13:57 ` Paolo Abeni
2026-04-23 14:18 ` Greg Kroah-Hartman
2026-04-23 14:29 ` Paolo Abeni
2026-04-23 15:06 ` Greg Kroah-Hartman [this message]
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=2026042344-ferry-mystify-74ee@gregkh \
--to=gregkh@linuxfoundation.org \
--cc=davem@davemloft.net \
--cc=dsahern@kernel.org \
--cc=edumazet@google.com \
--cc=horms@kernel.org \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=stable@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
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