Received: by 2002:a25:683:0:0:0:0:0 with SMTP id 125csp669444ybg; Mon, 1 Jun 2020 11:14:08 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxOR4f3IN1DFl76knulHbzXbUImaNMO2o7lNO66PYf6sWH8KQoShnfDANxbQRMDiFb+TfP0 X-Received: by 2002:aa7:cdcb:: with SMTP id h11mr22238094edw.218.1591035248562; Mon, 01 Jun 2020 11:14:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1591035248; cv=none; d=google.com; s=arc-20160816; b=H6n69O02L+V8SkcL+X9puDVafnWdLeIVzLHttk86Nz4vl/rvzIMPJAVETcSDM+qI4Y e046xhRkgOkbTtRHhNhtaEPqVC42JgkG4Y87Jmx6SObwTxWq+uOo3QhVB22DY0PHetAe bxleEMx9W8/Bq994TVQ0PtD18iy9d83h5ShkfaWOAUzC5BceFNrnqIQbALLSwczDYHR6 uyevDLFwE/5Op8aVwVZymcAW4wEd7SByCAuOLlkaRzOMrQ18k7YAlHXbfsy5zjS+xGS1 0BaYH5YXqmmLCBL/v0nDiTeBiBCEjNwZ1yO11xgS2lZJbiQVoRN+q7fklIu25NDbpi2R Q9Ug== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=j0RlPj7mf521nUOtVR/3YeZ+Ppz5NG29GH66yCnIkRo=; b=xaSxnJTBVUmFkbvvQNvZ5/tID8NQg5+ZzRVmgmA9+3dOe6RfrBHIg5D50/pYNiU77r E0odM4QZW1O6sPkWljwt1cn9rNmiYeJFfwlaaugDoybe747zOjSx7L47pjduzw/fXnUn hPbkqDcBuo9mCKqIBFo1u79yGhuUhpyctgeIjbHQbEbVXbBPtAawx8C7f7ZTk7C0NM4e HZ69JYIWDKCl4vHaxROd8T7A7jOxwabEdYCVMZ+9MEKXFxQeLdx5uY7KJD7heTnNN8EG IomIHu/BsFn6C2vAmP63rNqa6jfQDuPNsOgWKJrwngQ0yCSxbbVVa9xoFv9Jb/s4PXFJ HPBw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=LMeEMaNx; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id a14si74610edv.549.2020.06.01.11.13.45; Mon, 01 Jun 2020 11:14:08 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=LMeEMaNx; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729705AbgFASL3 (ORCPT + 99 others); Mon, 1 Jun 2020 14:11:29 -0400 Received: from mail.kernel.org ([198.145.29.99]:58386 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729108AbgFASLQ (ORCPT ); Mon, 1 Jun 2020 14:11:16 -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 6790B206E2; Mon, 1 Jun 2020 18:11:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1591035075; bh=9zuuffeI7sKuAZyAqKZVUFU8nDeJiIG7ehz5hVmqyOo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=LMeEMaNxUU3SjMARFpBYq7p2m/gbCVGQwDCJaZOjqHqA71DpwNmqCu3kjdEFYS5Mp WTRQBmfpysybDCHVwb6+X2YMLw9+4xfYwVTcLWlNbrjhU0FO6/Sw7hMbDHXonW3wVS gxsaMytkJIqx7rY1W5phknmBPlyPKAzNKtvWUnhY= 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.4 140/142] netfilter: conntrack: Pass value of ctinfo to __nf_conntrack_update Date: Mon, 1 Jun 2020 19:54:58 +0200 Message-Id: <20200601174052.199090805@linuxfoundation.org> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200601174037.904070960@linuxfoundation.org> References: <20200601174037.904070960@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@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 @@ -1880,11 +1880,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; @@ -2009,7 +2009,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; }