From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B11A2FBE8 for ; Thu, 1 Jun 2023 13:27:43 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 3D290C433EF; Thu, 1 Jun 2023 13:27:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1685626063; bh=HvYB3sTj+zEtPV5oF6dRSGstJrS4nBdZFsPZM6m4bRM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=wmNzemlARxV5sT5K4noCsCGFHjWN8TUzR9Bfp0UWMafC26xk/P1JmMDzI4Erfmrfg HPo56rXsPC6kDiLQ/HxjTsWTHAMqcPsqD5Lt7+80t/Kk26F8tOG3bNhwbzNtiegIgX bK+vmaQBOT8O6AIu/XXs/tTRZEIsWJwYeCHc8hcI= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Shai Amiram , Jakub Kicinski , Simon Horman , "David S. Miller" , Sasha Levin Subject: [PATCH 6.1 07/42] tls: rx: strp: set the skb->len of detached / CoWed skbs Date: Thu, 1 Jun 2023 14:21:16 +0100 Message-Id: <20230601131939.380726740@linuxfoundation.org> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230601131939.051934720@linuxfoundation.org> References: <20230601131939.051934720@linuxfoundation.org> User-Agent: quilt/0.67 Precedence: bulk X-Mailing-List: patches@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit From: Jakub Kicinski [ 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 Signed-off-by: Jakub Kicinski Reviewed-by: Simon Horman Signed-off-by: David S. Miller Signed-off-by: Sasha Levin --- net/tls/tls_strp.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/net/tls/tls_strp.c b/net/tls/tls_strp.c index 955ac3e0bf4d3..24016c865e004 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; -- 2.39.2