summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJakub Kicinski <kuba@kernel.org>2023-05-16 18:50:37 -0700
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2023-06-05 09:26:17 +0200
commitecd9f6ed9ed2d4c9f11f67245b780bdde3942d81 (patch)
treeb3f6dc981f2428e54237a7e90517d7488561c1c9
parente734a693a24c735e484eb52d29b002006aa629d5 (diff)
downloadlinux-ecd9f6ed9ed2d4c9f11f67245b780bdde3942d81.tar.gz
linux-ecd9f6ed9ed2d4c9f11f67245b780bdde3942d81.tar.bz2
linux-ecd9f6ed9ed2d4c9f11f67245b780bdde3942d81.zip
tls: rx: strp: set the skb->len of detached / CoW'ed skbs
[ Upstream commit 210620ae44a83f25220450bbfcc22e6fe986b25f ] 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: 84c61fe1a75b ("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>
-rw-r--r--net/tls/tls_strp.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/net/tls/tls_strp.c b/net/tls/tls_strp.c
index 955ac3e0bf4d..24016c865e00 100644
--- a/net/tls/tls_strp.c
+++ b/net/tls/tls_strp.c
@@ -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;