Skip to contentSkip to conversation

bonding: Return pointer to data after pull on skb

PATCH Applied Jiri Wiesner 4 participants 4 messages Oct 10, 2023 – Oct 13, 2023

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 bonding: Return pointer to data after pull on skb

Since 429e3d123d9a ("bonding: Fix extraction of ports from the packet headers"), header offsets used to compute a hash in bond_xmit_hash() are relative to skb->data and not skb->head. If the tail of the header buffer of an skb really needs to be advanced and the operation is successful, the pointer to the data must be returned (and not a pointer to the head of the buffer).

Fixes 429e3d123d9a ("bonding: Fix extraction of ports from the packet headers")
---
 drivers/net/bonding/bond_main.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/bonding/bond_main.c +1 -1
index ed7212e61c54..51d47eda1c87 100644
@@ -4023,7 +4023,7 @@ static inline const void *bond_pull_data(struct sk_buff *skb,
 	if (likely(n <= hlen))
 		return data;
 	else if (skb && likely(pskb_may_pull(skb, n)))
-		return skb->head;
+		return skb->data;
 
 	return NULL;
 }
Signature · 6 lines
2.35.3


-- 
Jiri Wiesner
SUSE Labs
Acked-by on v1 1/1
#1 lore raw
Quoted 6 lines · Jiri Wiesner

Since 429e3d123d9a ("bonding: Fix extraction of ports from the packet headers"), header offsets used to compute a hash in bond_xmit_hash() are relative to skb->data and not skb->head. If the tail of the header buffer of an skb really needs to be advanced and the operation is successful, the pointer to the data must be returned (and not a pointer to the head of the buffer).

Quoted 27 lines
Fixes 429e3d123d9a ("bonding: Fix extraction of ports from the packet headers")

---
drivers/net/bonding/bond_main.c | 2 +-

1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/bonding/bond_main.c +1 -1
index ed7212e61c54..51d47eda1c87 100644
@@ -4023,7 +4023,7 @@ static inline const void *bond_pull_data(struct sk_buff *skb,
 	if (likely(n <= hlen))
 		return data;
 	else if (skb && likely(pskb_may_pull(skb, n)))
-		return skb->head;
+		return skb->data;
 
 	return NULL;
 }
Signature · 6 lines
2.35.3


-- 
Jiri Wiesner
SUSE Labs
Reviewed-by on v1 1/1
#2 lore raw
In reply to Jiri Wiesner
Quoted 9 lines · Tue, Oct 10, 2023 at 06:39:33PM CEST, [email protected] wrote:

Since 429e3d123d9a ("bonding: Fix extraction of ports from the packet headers"), header offsets used to compute a hash in bond_xmit_hash() are relative to skb->data and not skb->head. If the tail of the header buffer of an skb really needs to be advanced and the operation is successful, the pointer to the data must be returned (and not a pointer to the head of the buffer).

Fixes 429e3d123d9a ("bonding: Fix extraction of ports from the packet headers")
#3 lore raw
In reply to Jiri Wiesner
This patch was applied to netdev/net.git (main) by David S. Miller <[email protected]>:

Hello:

This patch was applied to netdev/net.git (main)
by David S. Miller <[email protected]>:

Quoted 8 lines · On Tue, 10 Oct 2023 18:39:33 +0200 you wrote:

Since 429e3d123d9a ("bonding: Fix extraction of ports from the packet headers"), header offsets used to compute a hash in bond_xmit_hash() are relative to skb->data and not skb->head. If the tail of the header buffer of an skb really needs to be advanced and the operation is successful, the pointer to the data must be returned (and not a pointer to the head of the buffer).

[...]

Here is the summary with links:
- [net] bonding: Return pointer to data after pull on skb

    https://git.kernel.org/netdev/net/c/d93f3f992780

You are awesome, thank you!

Signature · 2 lines
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html