diff options
| author | Danielle Ratson <danieller@nvidia.com> | 2026-08-03 14:25:03 +0300 |
|---|---|---|
| committer | Jakub Kicinski <kuba@kernel.org> | 2026-08-07 16:32:46 -0700 |
| commit | 18668f4747c9e159ef582046657ced5696a36265 (patch) | |
| tree | 0497b8df220e72956117b16ff0e0342a685effb4 /tools/perf/scripts/python/export-to-sqlite.py | |
| parent | 9dfa6cca8959dd203dc9de012126cf80bc4a680e (diff) | |
bridge: Validate NS/NA messages using ndisc_check_ns_na()
The bridge performs neighbor suppression by snooping NS/NA messages, but
previously only checked the ICMPv6 type and code. This leaves it open to
acting on malformed or spoofed packets that any RFC-compliant node should
reject.
Wire br_is_nd_neigh_msg() into the new ndisc_check_ns_na() helper, which
enforces the full RFC 4861 section 7.1.1/7.1.2 receive validation:
hop limit of 255, valid checksum, correct code, and type-specific rules
(NS target not multicast; NA solicited flag clear for multicast
destinations).
MLD messages are already validated by ipv6_mc_check_mld() before the
bridge acts on them; this brings NS/NA to the same standard.
As a side effect, the skb parameter of br_is_nd_neigh_msg() changes from
const to non-const, since ndisc_check_ns_na() may reallocate the skb head
via pskb_may_pull() and sets the transport header. The returned pointer is
now derived from skb_transport_header() rather than a direct cast.
Reviewed-by: Petr Machata <petrm@nvidia.com>
Acked-by: Nikolay Aleksandrov <razor@blackwall.org>
Signed-off-by: Danielle Ratson <danieller@nvidia.com>
Link: https://patch.msgid.link/20260803112505.613873-4-danieller@nvidia.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'tools/perf/scripts/python/export-to-sqlite.py')
0 files changed, 0 insertions, 0 deletions
