linux/net/bridge
Danielle Ratson 67b14d6e36 bridge: Linearize skb once the ND message type is validated
br_nd_send() parses ND options from ns->opt[] and therefore needs the skb
to be linear. Commit a01aee7caf ("bridge: br_nd_send: linearize skb
before parsing ND options") ensured that by linearizing inside
br_nd_send() itself.

Move the linearization up into br_is_nd_neigh_msg(), right after
ndisc_check_ns_na() has validated the message as an NS/NA. This makes a
linear buffer a property of every recognized ND message, so that this and
any future ND message handling operate on a linear skb and cannot
reintroduce that class of bug by forgetting to linearize.

Since the skb is now linear by the time br_nd_send() runs, drop the
linearization there and derive ns from the transport header set by
ndisc_check_ns_na(), instead of recomputing it from the network header.

If linearization fails under memory pressure, br_is_nd_neigh_msg() returns
NULL and the packet falls back to normal forwarding rather than being
suppressed.

Reviewed-by: Petr Machata <petrm@nvidia.com>
Signed-off-by: Danielle Ratson <danieller@nvidia.com>
Acked-by: Nikolay Aleksandrov <razor@blackwall.org>
Link: https://patch.msgid.link/20260803112505.613873-5-danieller@nvidia.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2026-08-07 16:32:46 -07:00
..
netfilter Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2026-08-06 11:53:47 -07:00
br_arp_nd_proxy.c bridge: Linearize skb once the ND message type is validated 2026-08-07 16:32:46 -07:00
br_cfm_netlink.c bridge: cfm: reject invalid CCM interval at configuration time 2026-06-11 15:16:12 -07:00
br_cfm.c bridge: cfm: reject invalid CCM interval at configuration time 2026-06-11 15:16:12 -07:00
br_device.c bridge: Use direct pointer in br_is_nd_neigh_msg() 2026-08-07 16:32:46 -07:00
br_fdb.c net: bridge: use atomic ops to read/change p->flags (I) 2026-06-12 18:03:46 -07:00
br_forward.c net: bridge: use atomic ops to read/change p->flags (I) 2026-06-12 18:03:46 -07:00
br_if.c bridge: stp: Fix a potential use-after-free when deleting a bridge 2026-06-30 15:14:35 +02:00
br_input.c bridge: Use direct pointer in br_is_nd_neigh_msg() 2026-08-07 16:32:46 -07:00
br_ioctl.c bridge: provide lockless access to p->config_pending 2026-06-05 17:46:18 -07:00
br_mdb.c Convert remaining multi-line kmalloc_obj/flex GFP_KERNEL uses 2026-02-22 08:26:33 -08:00
br_mrp_netlink.c net: bridge: use atomic ops to read/change p->flags (II) 2026-06-12 18:03:46 -07:00
br_mrp_switchdev.c
br_mrp.c net: bridge: mrp: fix uninitialised bytes on the wire 2026-07-31 16:31:16 -07:00
br_mst.c net: bridge: fix MST static key usage 2025-11-06 07:32:17 -08:00
br_multicast_eht.c treewide: Replace kmalloc with kmalloc_obj for non-scalar types 2026-02-21 01:02:28 -08:00
br_multicast.c Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2026-07-30 12:53:19 -07:00
br_netfilter_hooks.c netfilter: br_netfilter: Reallocate headroom if necessary in neigh_hh_bridge() 2026-05-16 13:22:50 +02:00
br_netfilter_ipv6.c netfilter: remove nf_ipv6_ops and use direct function calls 2026-03-29 11:21:24 -07:00
br_netlink_tunnel.c net: bridge: vlan: fix vlan range dumps starting with pvid 2026-07-22 10:23:18 -07:00
br_netlink.c net: bridge: use atomic ops to read/change p->flags (III) 2026-06-12 18:03:46 -07:00
br_nf_core.c bridge: netfilter: Fix forwarding of fragmented packets 2025-05-16 16:02:06 -07:00
br_private_cfm.h
br_private_mcast_eht.h
br_private_mrp.h
br_private_stp.h
br_private_tunnel.h bridge: always declare tunnel functions 2023-05-17 21:28:58 -07:00
br_private.h bridge: Validate NS/NA messages using ndisc_check_ns_na() 2026-08-07 16:32:46 -07:00
br_stp_bpdu.c net: bridge: use atomic ops to read/change p->flags (III) 2026-06-12 18:03:46 -07:00
br_stp_if.c bridge: provide lockless access to p->config_pending 2026-06-05 17:46:18 -07:00
br_stp_timer.c bridge: add a READ_ONCE() in br_timer_value() 2026-06-05 17:46:16 -07:00
br_stp.c bridge: stp: Fix a potential use-after-free when deleting a bridge 2026-06-30 15:14:35 +02:00
br_switchdev.c net: bridge: use atomic ops to read/change p->flags (III) 2026-06-12 18:03:46 -07:00
br_sysfs_br.c mm.git review status for linus..mm-nonmm-stable 2026-02-12 12:13:01 -08:00
br_sysfs_if.c bridge: use atomic ops to read/change p->flags in sysfs 2026-06-12 18:03:45 -07:00
br_vlan_options.c net: bridge: vlan: fix vlan range dumps starting with pvid 2026-07-22 10:23:18 -07:00
br_vlan_tunnel.c bridge: fix C-VLAN preservation in 802.1ad vlan_tunnel egress 2026-01-04 09:45:35 -08:00
br_vlan.c net: bridge: vlan: fix vlan range dumps starting with pvid 2026-07-22 10:23:18 -07:00
br.c net: remove unused ATM protocols and legacy ATM device drivers 2026-04-23 12:21:14 -07:00
Kconfig ipv6: convert CONFIG_IPV6 to built-in only and clean up Kconfigs 2026-03-29 11:21:22 -07:00
Makefile netfilter: add option for GCOV profiling 2026-05-24 22:55:47 +02:00