Skip to content

Commit

Permalink
tls: rx: strp: set the skb->len of detached / CoW'ed skbs
Browse files Browse the repository at this point in the history
[ Upstream commit 210620a ]

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 <samiram@nvidia.com>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Reviewed-by: Simon Horman <simon.horman@corigine.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
  • Loading branch information
kuba-moo authored and gregkh committed Jun 5, 2023
1 parent e734a69 commit ecd9f6e
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions net/tls/tls_strp.c
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,8 @@ static struct sk_buff *tls_strp_msg_make_copy(struct tls_strparser *strp)
offset += skb_frag_size(frag);
}

skb->len = strp->stm.full_len;
skb->data_len = strp->stm.full_len;
skb_copy_header(skb, strp->anchor);
rxm = strp_msg(skb);
rxm->offset = 0;
Expand Down

0 comments on commit ecd9f6e

Please sign in to comment.