Skip to content

Commit 210620a

Browse files
kuba-moodavem330
authored andcommitted
tls: rx: strp: set the skb->len of detached / CoW'ed skbs
alloc_skb_with_frags() fills in page frag sizes but does not set skb->len and skb->data_len. Set those correctly otherwise device offload will most likely generate an empty skb and hit the BUG() at the end of __skb_nsg(). Fixes: 84c61fe ("tls: rx: do not use the standard strparser") Tested-by: Shai Amiram <[email protected]> Signed-off-by: Jakub Kicinski <[email protected]> Reviewed-by: Simon Horman <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent b3a03b5 commit 210620a

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

net/tls/tls_strp.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,8 @@ static struct sk_buff *tls_strp_msg_make_copy(struct tls_strparser *strp)
5656
offset += skb_frag_size(frag);
5757
}
5858

59+
skb->len = strp->stm.full_len;
60+
skb->data_len = strp->stm.full_len;
5961
skb_copy_header(skb, strp->anchor);
6062
rxm = strp_msg(skb);
6163
rxm->offset = 0;

0 commit comments

Comments
 (0)