[PATCH net-queue] i40e: Fix incorrect skb reserved size on rx

Subsystems: intel ethernet drivers, networking drivers, the rest

STALE2970d

5 messages, 3 authors, 2018-06-14 · open the first message on its own page

[PATCH net-queue] i40e: Fix incorrect skb reserved size on rx

From: Toshiaki Makita <hidden>
Date: 2018-06-13 08:10:58

i40e_build_skb() reserves I40E_SKB_PAD + (xdp->data -
xdp->data_hard_start) but obviously I40E_SKB_PAD is unnecessary here
and mac_header/data feilds in skb becomes incorrect, and breaks normal
skb receive path as well as XDP receive path.

Fixes: cc5b114dcf98 ("bpf, i40e: add meta data support")
Signed-off-by: Toshiaki Makita <redacted>
---
 drivers/net/ethernet/intel/i40e/i40e_txrx.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/ethernet/intel/i40e/i40e_txrx.c b/drivers/net/ethernet/intel/i40e/i40e_txrx.c
index 8ffb7454e67c..6d59f51f1730 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_txrx.c
+++ b/drivers/net/ethernet/intel/i40e/i40e_txrx.c
@@ -2124,7 +2124,7 @@ static struct sk_buff *i40e_build_skb(struct i40e_ring *rx_ring,
 		return NULL;
 
 	/* update pointers within the skb to store the data */
-	skb_reserve(skb, I40E_SKB_PAD + (xdp->data - xdp->data_hard_start));
+	skb_reserve(skb, xdp->data - xdp->data_hard_start);
 	__skb_put(skb, xdp->data_end - xdp->data);
 	if (metasize)
 		skb_metadata_set(skb, metasize);
-- 
2.14.2

Re: [PATCH net-queue] i40e: Fix incorrect skb reserved size on rx

From: Daniel Borkmann <daniel@iogearbox.net>
Date: 2018-06-13 09:06:22

On 06/13/2018 10:08 AM, Toshiaki Makita wrote:
i40e_build_skb() reserves I40E_SKB_PAD + (xdp->data -
xdp->data_hard_start) but obviously I40E_SKB_PAD is unnecessary here
and mac_header/data feilds in skb becomes incorrect, and breaks normal
skb receive path as well as XDP receive path.

Fixes: cc5b114dcf98 ("bpf, i40e: add meta data support")
Signed-off-by: Toshiaki Makita <redacted>
Thanks Toshiaki, I sent a complete fix yesterday here:

https://lkml.org/lkml/2018/6/12/843

Cheers,
Daniel

Re: [PATCH net-queue] i40e: Fix incorrect skb reserved size on rx

From: Toshiaki Makita <hidden>
Date: 2018-06-14 00:26:05

On 2018/06/13 18:06, Daniel Borkmann wrote:
On 06/13/2018 10:08 AM, Toshiaki Makita wrote:
quoted
i40e_build_skb() reserves I40E_SKB_PAD + (xdp->data -
xdp->data_hard_start) but obviously I40E_SKB_PAD is unnecessary here
and mac_header/data feilds in skb becomes incorrect, and breaks normal
skb receive path as well as XDP receive path.

Fixes: cc5b114dcf98 ("bpf, i40e: add meta data support")
Signed-off-by: Toshiaki Makita <redacted>
Thanks Toshiaki, I sent a complete fix yesterday here:

https://lkml.org/lkml/2018/6/12/843
Oh I was not aware of it. Thanks, let's go with your patch.

-- 
Toshiaki Makita

RE: [Intel-wired-lan] [PATCH net-queue] i40e: Fix incorrect skb reserved size on rx

From: Malek, Patryk <hidden>
Date: 2018-06-14 09:15:02

On 2018/06/13 18:06, Daniel Borkmann wrote:
quoted
On 06/13/2018 10:08 AM, Toshiaki Makita wrote:
quoted
i40e_build_skb() reserves I40E_SKB_PAD + (xdp->data -
xdp->data_hard_start) but obviously I40E_SKB_PAD is unnecessary
here
quoted
quoted
and mac_header/data feilds in skb becomes incorrect, and breaks
Shouldn't this be fields instead of feilds?

Re: [Intel-wired-lan] [PATCH net-queue] i40e: Fix incorrect skb reserved size on rx

From: Toshiaki Makita <hidden>
Date: 2018-06-14 09:22:11

On 2018/06/14 18:14, Malek, Patryk wrote:
quoted
On 2018/06/13 18:06, Daniel Borkmann wrote:
quoted
On 06/13/2018 10:08 AM, Toshiaki Makita wrote:
quoted
i40e_build_skb() reserves I40E_SKB_PAD + (xdp->data -
xdp->data_hard_start) but obviously I40E_SKB_PAD is unnecessary
here
quoted
quoted
and mac_header/data feilds in skb becomes incorrect, and breaks
Shouldn't this be fields instead of feilds?
Thanks, but this is now superseded by Daniel's patch so dropped I think.
http://patchwork.ozlabs.org/patch/928778/

-- 
Toshiaki Makita
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help