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=-11.8 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, MENTIONS_GIT_HOSTING,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,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 AB8D8C433E1 for ; Mon, 1 Jun 2020 18:18:27 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 84DE4206E2 for ; Mon, 1 Jun 2020 18:18:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1591035507; bh=Udrk6PPQuINl5wAym9dvTVOSxHBGcsig6j241eC9viM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=aLmfydESXm88aUCuk5OyGFB5Dyw54jXoNTZPa4m4q97z9zLsh0+SpWWZpyjaMcTet NOg5oxwzSJlBKjJ6aI9vNOhw25VgVzNGElBE/w3e4aN7JtFhMu6T9KQvwb60Qh3+zu cOwegy7vAmo1iyp3P04WwW5RuD2JtXc5lSk/xuEA= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731907AbgFASSN (ORCPT ); Mon, 1 Jun 2020 14:18:13 -0400 Received: from mail.kernel.org ([198.145.29.99]:39784 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731073AbgFASSM (ORCPT ); Mon, 1 Jun 2020 14:18:12 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (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 373652065C; Mon, 1 Jun 2020 18:18:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1591035491; bh=Udrk6PPQuINl5wAym9dvTVOSxHBGcsig6j241eC9viM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ENBFAVVG0WFDbKhNtwLvLZIgrjSDVZJz3koqXlor+IaToN/iHhbDRoXMlgd+waUtV CQ44HYJTsZMncIuW+MkvZV05TwELqIwF/2xm+ClAZiowRrAc2yHje4hjgo6REFCVCD +9nwuKPBByZHq/rEwmMup024Y64PQMpHpPvmLILg= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Nathan Chancellor , Pablo Neira Ayuso Subject: [PATCH 5.6 176/177] netfilter: conntrack: Pass value of ctinfo to __nf_conntrack_update Date: Mon, 1 Jun 2020 19:55:14 +0200 Message-Id: <20200601174102.691484958@linuxfoundation.org> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200601174048.468952319@linuxfoundation.org> References: <20200601174048.468952319@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Nathan Chancellor commit 46c1e0621a72e0469ec4edfdb6ed4d387ec34f8a upstream. Clang warns: net/netfilter/nf_conntrack_core.c:2068:21: warning: variable 'ctinfo' is uninitialized when used here [-Wuninitialized] nf_ct_set(skb, ct, ctinfo); ^~~~~~ net/netfilter/nf_conntrack_core.c:2024:2: note: variable 'ctinfo' is declared here enum ip_conntrack_info ctinfo; ^ 1 warning generated. nf_conntrack_update was split up into nf_conntrack_update and __nf_conntrack_update, where the assignment of ctinfo is in nf_conntrack_update but it is used in __nf_conntrack_update. Pass the value of ctinfo from nf_conntrack_update to __nf_conntrack_update so that uninitialized memory is not used and everything works properly. Fixes: ee04805ff54a ("netfilter: conntrack: make conntrack userspace helpers work again") Link: https://github.com/ClangBuiltLinux/linux/issues/1039 Signed-off-by: Nathan Chancellor Signed-off-by: Pablo Neira Ayuso Signed-off-by: Greg Kroah-Hartman --- net/netfilter/nf_conntrack_core.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) --- a/net/netfilter/nf_conntrack_core.c +++ b/net/netfilter/nf_conntrack_core.c @@ -2015,11 +2015,11 @@ static void nf_conntrack_attach(struct s } static int __nf_conntrack_update(struct net *net, struct sk_buff *skb, - struct nf_conn *ct) + struct nf_conn *ct, + enum ip_conntrack_info ctinfo) { struct nf_conntrack_tuple_hash *h; struct nf_conntrack_tuple tuple; - enum ip_conntrack_info ctinfo; struct nf_nat_hook *nat_hook; unsigned int status; int dataoff; @@ -2144,7 +2144,7 @@ static int nf_conntrack_update(struct ne return 0; if (!nf_ct_is_confirmed(ct)) { - err = __nf_conntrack_update(net, skb, ct); + err = __nf_conntrack_update(net, skb, ct, ctinfo); if (err < 0) return err; }