Thread (3 messages) 3 messages, 3 authors, 29d ago

Re: [PATCH v2 net] bonding: use skb_cow_head() in bond_do_alb_xmit() and rlb_arp_xmit()

From: Nikolay Aleksandrov <razor@blackwall.org>
Date: 2026-09-04 06:06:57

On 03/09/2026 17:39, Eric Dumazet wrote:
In bond_do_alb_xmit() and rlb_arp_xmit(), make sure to unclone
skb head via skb_cow_head() before modifying the source MAC address
(Ethernet header and ARP payload) to avoid silent corruption if
the skb is shared or cloned. Avoid caching the header pointers
across skb_cow_head().

In rlb_arp_xmit(), only modify arp->mac_src if it differs from
tx_slave->dev->dev_addr to avoid an unnecessary copy and head
reallocation.

Also, we should not assume mac header is set in output path.

Use skb_eth_hdr() instead of eth_hdr() to fix the issue,
and remove now redundant skb_reset_mac_header() calls.

Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2")
Signed-off-by: Eric Dumazet <redacted>
Reviewed-by: Hangbin Liu <redacted>
Cc: Jay Vosburgh <jv@jvosburgh.net>
---
v2: Use ether_addr_equal_64bits() per Sashiko AI agent feedback
v1: https://lore.kernel.org/netdev/20260902125809.2910366-1-edumazet@google.com/ (local)

  drivers/net/bonding/bond_alb.c | 19 ++++++++++++-------
  1 file changed, 12 insertions(+), 7 deletions(-)
Reviewed-by: Nikolay Aleksandrov <razor@blackwall.org>
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help