FAILED: patch "[PATCH] batman-adv: retrieve ethhdr after potential skb realloc on RX" failed to apply to 6.12-stable tree
Subsystems (2)
[email protected]
maintainerThe patch below does not apply to the 6.12-stable tree.
If someone wants it applied there, or to any other stable or longterm tree, then please email the backport, including the original git commit id to <[email protected]>.
To reproduce the conflict and resubmit, you may use the following commands:
git fetch https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/ linux-6.12.y
git checkout FETCH_HEAD
git cherry-pick -x 035e1fed892d3d06002a73ff73668f618a514644
# <resolve conflicts, build, test, etc.>
git commit -s
git send-email --to '<[email protected]>' --in-reply-to '2026072056-gothic-untreated-85a2@gregkh' --subject-prefix 'PATCH 6.12.y' 'HEAD^..'
Possible dependencies:
thanks,
greg k-h
------------------ original commit in Linus's tree ------------------
From 035e1fed892d3d06002a73ff73668f618a514644 Mon Sep 17 00:00:00 2001
From: Sven Eckelmann <[email protected]>
Date: Sun, 28 Jun 2026 06:44:13 +0200
Subject: [PATCH] batman-adv: retrieve ethhdr after potential skb realloc on RX
pskb_may_pull() in batadv_interface_rx() could reallocate the buffer behind the skb. Variables which were pointing to the old buffer need to be reassigned to avoid an use-after-free.
This was done correctly for the VLAN header but missed for the ethernet header which is later used for the TT and AP isolation handling.
net/batman-adv/mesh-interface.c +1 -0
@@ -434,6 +434,7 @@ void batadv_interface_rx(struct net_device *mesh_iface,if (!pskb_may_pull (skb,VLAN_ETH_HLEN )) goto dropped; + ethhdr =eth_hdr (skb); vhdr =skb_vlan_eth_hdr (skb);/* drop batman-in-batman packets to prevent loops */
Sven Eckelmann
maintainerPATCH 1/1 batman-adv: retrieve ethhdr after potential skb realloc on RX
commit 035e1fed892d3d06002a73ff73668f618a514644 upstream.
pskb_may_pull() in batadv_interface_rx() could reallocate the buffer behind the skb. Variables which were pointing to the old buffer need to be reassigned to avoid an use-after-free.
This was done correctly for the VLAN header but missed for the ethernet header which is later used for the TT and AP isolation handling.
--- net/batman-adv/soft-interface.c | 1 + 1 file changed, 1 insertion(+)
net/batman-adv/soft-interface.c +1 -0
@@ -445,6 +445,7 @@ void batadv_interface_rx(struct net_device *soft_iface,if (!pskb_may_pull (skb,VLAN_ETH_HLEN )) goto dropped; + ethhdr =eth_hdr (skb); vhdr =skb_vlan_eth_hdr (skb);/* drop batman-in-batman packets to prevent loops */
Signature · 1 line
2.47.3
Re: [PATCH 6.12.y] batman-adv: retrieve ethhdr after potential skb realloc on RX
Quoted 3 lines
pskb_may_pull()inbatadv_interface_rx()could reallocate the buffer behind the skb. Variables which were pointing to the old buffer need to be reassigned to avoid an use-after-free.
Queued for 6.12, thanks.
Signature · 2 lines
Thanks, Sasha