From nobody Fri Dec 19 07:48:06 2025 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 32DE5C54EE9 for ; Tue, 13 Sep 2022 14:10:50 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232774AbiIMOKs (ORCPT ); Tue, 13 Sep 2022 10:10:48 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50618 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232659AbiIMOJP (ORCPT ); Tue, 13 Sep 2022 10:09:15 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CF5615AA22; Tue, 13 Sep 2022 07:09:00 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id F1899B80EFA; Tue, 13 Sep 2022 14:08:58 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 4B541C433C1; Tue, 13 Sep 2022 14:08:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1663078137; bh=TP1PAUh22etwcVEsjLpwRR+RTa1C6UM/k0FrZreC9Q0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=plxs2MEg1+QjfXuGZJv5xkzRBvdtTaX/05eALV3dGZrSIy34l9+oHDIBcAdNVuN15 8E+izwFVIcSyHYtHYnaGxsGkNJKm90qv9UrKw1/jgaSLPZD7BmqnrFZYwz+J1U9BRo BETTRQFaLMPsAzbue/wliaCWfim98BepeJosniz8= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Li Zhong , "David S. Miller" , Sasha Levin Subject: [PATCH 5.19 027/192] net/core/skbuff: Check the return value of skb_copy_bits() Date: Tue, 13 Sep 2022 16:02:13 +0200 Message-Id: <20220913140411.264395978@linuxfoundation.org> X-Mailer: git-send-email 2.37.3 In-Reply-To: <20220913140410.043243217@linuxfoundation.org> References: <20220913140410.043243217@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" From: lily [ Upstream commit c624c58e08b15105662b9ab9be23d14a6b945a49 ] skb_copy_bits() could fail, which requires a check on the return value. Signed-off-by: Li Zhong Signed-off-by: David S. Miller Signed-off-by: Sasha Levin --- net/core/skbuff.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/net/core/skbuff.c b/net/core/skbuff.c index bebf58464d667..4b2b07a9422cf 100644 --- a/net/core/skbuff.c +++ b/net/core/skbuff.c @@ -4179,9 +4179,8 @@ struct sk_buff *skb_segment(struct sk_buff *head_skb, SKB_GSO_CB(nskb)->csum_start =3D skb_headroom(nskb) + doffset; } else { - skb_copy_bits(head_skb, offset, - skb_put(nskb, len), - len); + if (skb_copy_bits(head_skb, offset, skb_put(nskb, len), len)) + goto err; } continue; } --=20 2.35.1