From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.7 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,UNWANTED_LANGUAGE_BODY,URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id D5EFDC4741F for ; Tue, 29 Sep 2020 11:07:02 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 87B5221D43 for ; Tue, 29 Sep 2020 11:07:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1601377622; bh=Id1n6rf2mWSjm9sPa5X++geLufjs9SgNuL3/iStXyaY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=NGxNNLNyhIS7AFJPdgKiPMUW9SqjsKxncg+upi9rtQMt5rWbTapdqJNMShLelLvTB hcbadzzf51qyJwYZwm0Mg1sk5WWZMb8nsvhGb63h5u/+pnIKv20R4wXaO1t9xVHQmg tx94dmip1Jn3ZknQUqntYQhP0NKriokBVwM5UjUk= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728344AbgI2LHB (ORCPT ); Tue, 29 Sep 2020 07:07:01 -0400 Received: from mail.kernel.org ([198.145.29.99]:44842 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728552AbgI2LHA (ORCPT ); Tue, 29 Sep 2020 07:07:00 -0400 Received: from localhost (83-86-74-64.cable.dynamic.v4.ziggo.nl [83.86.74.64]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 0F1FE21941; Tue, 29 Sep 2020 11:06:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1601377619; bh=Id1n6rf2mWSjm9sPa5X++geLufjs9SgNuL3/iStXyaY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=VR14s7OmYADZZ7vqByfU96H/327enHGIEd+ns/tipNtiorjjYe3Z8dBq+35uYa8F7 L3jzcAUHawSBoNmn9LeTIaVeuKdhmixgVxDytQeu+GZC5I37O6uo/FAQjaX3m1K/ke pJGpiE8CerWB/MOmKNtgE/qRqA7l/Wg5L8wbu5mI= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Eric Dumazet , "David S. Miller" Subject: [PATCH 4.9 012/121] net: add __must_check to skb_put_padto() Date: Tue, 29 Sep 2020 12:59:16 +0200 Message-Id: <20200929105930.790779331@linuxfoundation.org> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20200929105930.172747117@linuxfoundation.org> References: <20200929105930.172747117@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Eric Dumazet [ Upstream commit 4a009cb04aeca0de60b73f37b102573354214b52 ] skb_put_padto() and __skb_put_padto() callers must check return values or risk use-after-free. Signed-off-by: Eric Dumazet Signed-off-by: David S. Miller Signed-off-by: Greg Kroah-Hartman --- include/linux/skbuff.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/include/linux/skbuff.h +++ b/include/linux/skbuff.h @@ -2795,7 +2795,7 @@ static inline int skb_padto(struct sk_bu * is untouched. Otherwise it is extended. Returns zero on * success. The skb is freed on error. */ -static inline int skb_put_padto(struct sk_buff *skb, unsigned int len) +static inline int __must_check skb_put_padto(struct sk_buff *skb, unsigned int len) { unsigned int size = skb->len;