diff mbox series

[net] bonding: Return pointer to data after pull on skb

Message ID 20231010163933.GA534@incl (mailing list archive)
State Accepted
Commit d93f3f992780af4a21e6c1ab86946b7c5602f1b9
Delegated to: Netdev Maintainers
Headers show
Series [net] bonding: Return pointer to data after pull on skb | expand

Checks

Context Check Description
netdev/series_format success Single patches do not need cover letters
netdev/tree_selection success Clearly marked for net
netdev/fixes_present success Fixes tag present in non-next series
netdev/header_inline success No static functions without inline keyword in header files
netdev/build_32bit success Errors and warnings before: 1363 this patch: 1363
netdev/cc_maintainers fail 2 blamed authors not CCed: gal@nvidia.com saeedm@nvidia.com; 2 maintainers not CCed: gal@nvidia.com saeedm@nvidia.com
netdev/build_clang success Errors and warnings before: 1387 this patch: 1387
netdev/verify_signedoff success Signed-off-by tag matches author and committer
netdev/deprecated_api success None detected
netdev/check_selftest success No net selftest shell script
netdev/verify_fixes success Fixes tag looks correct
netdev/build_allmodconfig_warn success Errors and warnings before: 1387 this patch: 1387
netdev/checkpatch success total: 0 errors, 0 warnings, 0 checks, 8 lines checked
netdev/kdoc success Errors and warnings before: 0 this patch: 0
netdev/source_inline success Was 0 now: 0

Commit Message

Jiri Wiesner Oct. 10, 2023, 4:39 p.m. UTC
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")
Signed-off-by: Jiri Wiesner <jwiesner@suse.de>
---
 drivers/net/bonding/bond_main.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Jay Vosburgh Oct. 10, 2023, 6:45 p.m. UTC | #1
Jiri Wiesner <jwiesner@suse.de> 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).

Acked-by: Jay Vosburgh <jay.vosburgh@canonical.com>

>Fixes: 429e3d123d9a ("bonding: Fix extraction of ports from the packet headers")
>Signed-off-by: Jiri Wiesner <jwiesner@suse.de>
>---
> drivers/net/bonding/bond_main.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
>diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c
>index ed7212e61c54..51d47eda1c87 100644
>--- a/drivers/net/bonding/bond_main.c
>+++ b/drivers/net/bonding/bond_main.c
>@@ -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;
> }
>-- 
>2.35.3
>
>
>-- 
>Jiri Wiesner
>SUSE Labs
>
Jiri Pirko Oct. 11, 2023, 4:16 p.m. UTC | #2
Tue, Oct 10, 2023 at 06:39:33PM CEST, jwiesner@suse.de 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")
>Signed-off-by: Jiri Wiesner <jwiesner@suse.de>

Reviewed-by: Jiri Pirko <jiri@nvidia.com>
patchwork-bot+netdevbpf@kernel.org Oct. 13, 2023, 10:30 a.m. UTC | #3
Hello:

This patch was applied to netdev/net.git (main)
by David S. Miller <davem@davemloft.net>:

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!
diff mbox series

Patch

diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c
index ed7212e61c54..51d47eda1c87 100644
--- a/drivers/net/bonding/bond_main.c
+++ b/drivers/net/bonding/bond_main.c
@@ -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;
 }