From patchwork Tue Sep 29 10:59:36 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 263410 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=unavailable 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 C010CC4727C for ; Tue, 29 Sep 2020 11:04:05 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 7EFC921924 for ; Tue, 29 Sep 2020 11:04:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1601377445; bh=t+hjMmfyg01UEJQInIr+fsuyXy/91PgQueFshlKGzlA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=u3Oofkdaz4LVmTNpnZ7PGURPXAsUKWWNtTtKrADJyUOcT4yg2KGpscdlvHLr0MM3+ U4ObxjwABVQuCqkb30MIC56zYcDv232uJm7Kk6XJkTxJyQMGdvretKzMlXhfEeHdJV kod8JPSsrPqeyMoKa0kKL+33mjSY9a986tWX1N6I= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728533AbgI2LD6 (ORCPT ); Tue, 29 Sep 2020 07:03:58 -0400 Received: from mail.kernel.org ([198.145.29.99]:39798 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728515AbgI2LDx (ORCPT ); Tue, 29 Sep 2020 07:03:53 -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 600A021734; Tue, 29 Sep 2020 11:03:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1601377433; bh=t+hjMmfyg01UEJQInIr+fsuyXy/91PgQueFshlKGzlA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=KBRKwrpXeP5cunpJRqFfQsBCm4WtnFE6Qs2moyy62czkFxlKbxkhj8ehJ3CiLLihp /99r/CLUXlw9RMcTT4uhMkawQMsaZmaoIYakC0Eqzc/bpLQx9wBVUtCK8Vecx8mWYl iwiEuKal+yrIpjDtiAdxqbnrempLIDnVxEQE+UQA= 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.4 09/85] net: add __must_check to skb_put_padto() Date: Tue, 29 Sep 2020 12:59:36 +0200 Message-Id: <20200929105928.681246288@linuxfoundation.org> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20200929105928.198942536@linuxfoundation.org> References: <20200929105928.198942536@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 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 @@ -2651,7 +2651,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;