From: Petr Machata <petrm@nvidia.com>
To: Nikolay Aleksandrov <razor@blackwall.org>
Cc: Danielle Ratson <danieller@nvidia.com>,
"netdev@vger.kernel.org" <netdev@vger.kernel.org>,
"dsahern@kernel.org" <dsahern@kernel.org>,
"Ido Schimmel" <idosch@nvidia.com>,
"davem@davemloft.net" <davem@davemloft.net>,
"edumazet@google.com" <edumazet@google.com>,
"kuba@kernel.org" <kuba@kernel.org>,
"pabeni@redhat.com" <pabeni@redhat.com>,
"horms@kernel.org" <horms@kernel.org>, "ja@ssi.bg" <ja@ssi.bg>,
"Petr Machata" <petrm@nvidia.com>, "fw@strlen.de" <fw@strlen.de>,
"kuniyu@google.com" <kuniyu@google.com>,
"bridge@lists.linux.dev" <bridge@lists.linux.dev>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH net-next 0/5] bridge: Validate and clean up IPv6 neighbour suppression
Date: Thu, 23 Jul 2026 11:49:31 +0200 [thread overview]
Message-ID: <871pcu8265.fsf@nvidia.com> (raw)
In-Reply-To: <d27e9e6d-351f-45e6-914b-3189fb6d3fd7@blackwall.org>
Nikolay Aleksandrov <razor@blackwall.org> writes:
> On 23/07/2026 09:40, Danielle Ratson wrote:
>>> -----Original Message-----
>>> From: Nikolay Aleksandrov <razor@blackwall.org>
>>> Sent: Monday, 20 July 2026 12:31
>>> To: Danielle Ratson <danieller@nvidia.com>; netdev@vger.kernel.org
>>> Cc: dsahern@kernel.org; Ido Schimmel <idosch@nvidia.com>;
>>> davem@davemloft.net; edumazet@google.com; kuba@kernel.org;
>>> pabeni@redhat.com; horms@kernel.org; ja@ssi.bg; Petr Machata
>>> <petrm@nvidia.com>; fw@strlen.de; kuniyu@google.com;
>>> bridge@lists.linux.dev; linux-kernel@vger.kernel.org
>>> Subject: Re: [PATCH net-next 0/5] bridge: Validate and clean up IPv6
>>> neighbour suppression
>>>
>>> On 19/07/2026 16:34, Danielle Ratson wrote:
>>>> The bridge implements IPv6 neighbour suppression by snooping Neighbour
>>>> Solicitation and Neighbour Advertisement messages, but it previously
>>>> only checked the ICMPv6 type and code before acting on them. This
>>>> leaves it open to acting on malformed or spoofed packets that any RFC
>>>> 4861 compliant node should reject, and the option parsing in
>>>> br_nd_send() open-codes a loop that has historically been a source of bugs.
>>>>
>>>> This series hardens and cleans up that path:
>>>>
>>>> Add ndisc_check_ns_na(), a standalone NS/NA validator modeled after
>>>> ipv6_mc_check_mld(), implementing the RFC 4861 section 7.1.1 / 7.1.2
>>>> mandatory receive checks (hop limit, checksum, code, length, target
>>>> and option validation). Wire the bridge into it so NS/NA messages are
>>>> validated to the same standard MLD already enjoys.
>>>>
>>>> Replace the manual ND option parsing loop in br_nd_send() with
>>>> ndisc_parse_options() and ndisc_opt_addr_data(), and linearize the skb
>>>> once it has been validated as an NS/NA message so that this and any
>>>> future ND message handling operate on a linear buffer. The first patch
>>>> is a small preparatory cleanup that drops the now-unnecessary
>>>> skb_header_pointer() fallback from br_is_nd_neigh_msg().
>>>>
>>>> No functional change is intended for well-formed packets.
>>>>
>>>> Patchset overview:
>>>> Patch #1: drop the skb_header_pointer() fallback.
>>>> Patches #2-#3: add ndisc_check_ns_na() and validate NS/NA with it.
>>>> Patch #4: linearize once the ND message type is validated.
>>>> Patch #5: parse options via ndisc_parse_options().
>>>>
>>>> Danielle Ratson (5):
>>>> bridge: Use direct pointer in br_is_nd_neigh_msg()
>>>> ipv6: ndisc: Add ndisc_check_ns_na() validation helper
>>>> bridge: Validate NS/NA messages using ndisc_check_ns_na()
>>>> bridge: Linearize skb once the ND message type is validated
>>>> bridge: Use ndisc_parse_options() to parse ND options in
>>>> br_nd_send()
>>>>
>>>> include/net/ndisc.h | 2 +
>>>> net/bridge/br_arp_nd_proxy.c | 54 +++++-----
>>>> net/bridge/br_device.c | 4 +-
>>>> net/bridge/br_input.c | 4 +-
>>>> net/bridge/br_private.h | 2 +-
>>>> net/ipv6/Makefile | 2 +-
>>>> net/ipv6/ndisc.c | 1 +
>>>> net/ipv6/ndisc_snoop.c | 190
>>> +++++++++++++++++++++++++++++++++++
>>>> 8 files changed, 224 insertions(+), 35 deletions(-)
>>>> create mode 100644 net/ipv6/ndisc_snoop.c
>>>>
>>>
>>> Nice set, but I'm curious - any reason not to use EXPORT_SYMBOL_GPL()
>>> instead?
>>>
>> I guess you are referring to ndisc_parse_options and ndisc_check_ns_na?
>> The reason is basically that other sibling functions used EXPORT_SYMBOL() rather than EXPORT_SYMBOL_GPL() (ndisc_send_skb, ndisc_ns_create, and the ndisc_check_ns_na() equivalent in mld, ipv6_mc_check_mld()).
>> However, ndisc_send_na() for example is newer and uses EXPORT_SYMBOL_GPL(). So it might make sense to use that in ndisc_parse_options(), if you prefer.
>>
>
> Yep, I was referring to those newly exported symbols.
> Personally I'd always go for the _GPL variant when possible, but it's not a
> strong preference, more a personal one. I was just curious if there was some
> particular reason not to be. :)
Yeah, I missed this during the review.
I'm in favor of GPL as well.
prev parent reply other threads:[~2026-07-23 9:51 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-19 13:34 [PATCH net-next 0/5] bridge: Validate and clean up IPv6 neighbour suppression Danielle Ratson
2026-07-19 13:34 ` [PATCH net-next 1/5] bridge: Use direct pointer in br_is_nd_neigh_msg() Danielle Ratson
2026-07-20 8:58 ` Nikolay Aleksandrov
2026-07-19 13:34 ` [PATCH net-next 2/5] ipv6: ndisc: Add ndisc_check_ns_na() validation helper Danielle Ratson
2026-07-20 9:13 ` Nikolay Aleksandrov
2026-07-19 13:34 ` [PATCH net-next 3/5] bridge: Validate NS/NA messages using ndisc_check_ns_na() Danielle Ratson
2026-07-20 9:14 ` Nikolay Aleksandrov
2026-07-19 13:34 ` [PATCH net-next 4/5] bridge: Linearize skb once the ND message type is validated Danielle Ratson
2026-07-20 9:26 ` Nikolay Aleksandrov
2026-07-19 13:34 ` [PATCH net-next 5/5] bridge: Use ndisc_parse_options() to parse ND options in br_nd_send() Danielle Ratson
2026-07-20 9:27 ` Nikolay Aleksandrov
2026-07-20 9:31 ` [PATCH net-next 0/5] bridge: Validate and clean up IPv6 neighbour suppression Nikolay Aleksandrov
2026-07-23 6:40 ` Danielle Ratson
2026-07-23 9:20 ` Nikolay Aleksandrov
2026-07-23 9:49 ` Petr Machata [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=871pcu8265.fsf@nvidia.com \
--to=petrm@nvidia.com \
--cc=bridge@lists.linux.dev \
--cc=danieller@nvidia.com \
--cc=davem@davemloft.net \
--cc=dsahern@kernel.org \
--cc=edumazet@google.com \
--cc=fw@strlen.de \
--cc=horms@kernel.org \
--cc=idosch@nvidia.com \
--cc=ja@ssi.bg \
--cc=kuba@kernel.org \
--cc=kuniyu@google.com \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=razor@blackwall.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.