Received: by 2002:a05:6a10:2726:0:0:0:0 with SMTP id ib38csp2164221pxb; Fri, 25 Mar 2022 12:13:58 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzu36lXpLOYXoqCVtOs+J6dt7OVVkOJGmdG+iOM7PJetyVV53nGhTYfZ5rwSRehd6N9+F9j X-Received: by 2002:a17:90a:c791:b0:1c7:26eb:88dd with SMTP id gn17-20020a17090ac79100b001c726eb88ddmr26274746pjb.218.1648235638600; Fri, 25 Mar 2022 12:13:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1648235638; cv=none; d=google.com; s=arc-20160816; b=QaSrTpJT7hT4Xmz1hRxuoe6ZrIsBYyL92qL8lxOjFpxaN4/a8Hktp2O+MMsBNniMpn v9kXdF6IbsA4s5ArN9Sk23mIKc4AlU0cKKsQmfbpmY6xnQGJx4XdEdXRdrfQfBcBOIW2 vUXOe1KF7+Sz2JMVwJ/OQ5ypNHdiuzpTuKQJQBVLeAbFTx6li8e65yKcWZALgsUZBVUm 2a/CHc4ehUAshbThrg2NiADvYLbjMGuB8z+gWStNeLYPOVSeH6y5/sjzv2GiZ71OI3qF VFBzzsafreelwyZCGJBUzdcg8NvfvlF8GnkClcO8J1+XFCbvu6eqnDQPHcsknNr5Ec0r KV7w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=7+9dN7KaBzwzWZXJ3PMHK9A0Ps9/qVZ3FYD0We8cb4A=; b=Vdcq6ykNqMXYu8Ce9OWe11m9mqZBXSADFxBIaKiB5qYM4T6enTc5nHt2AHeLtXzWKQ Ij+8inHYbzflG1q04FWV31dTH8o2qk0kClJIeieFJafE4aOIddZSC2s/v8KpaJMxh/2k 6iVg8LyDNbhE0KGATQQpYmykPSIBUApZOHt55kOoS5qAu4K0Ey9vXlKO8DkPy4cNDnEm RUVlDteacbLfLshMI1opjxQL9OpUlMRkUQpanH7pGubTmHG9AbxIklxiNKEKWyKYQp2V t1yTiaGHCfUjknWKDZYu2tXkEO4DU2IbVfFeT9ioEOqUXpXONGTwMUM0jAc3yvLd505k Ew3w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=dm7Gax3O; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id ng4-20020a17090b1a8400b001c60191de56si3747274pjb.96.2022.03.25.12.13.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 25 Mar 2022 12:13:58 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=dm7Gax3O; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 7785F15CB61; Fri, 25 Mar 2022 11:18:37 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1346389AbiCYPcf (ORCPT + 99 others); Fri, 25 Mar 2022 11:32:35 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34308 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1377775AbiCYPYe (ORCPT ); Fri, 25 Mar 2022 11:24:34 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C93D5EA345; Fri, 25 Mar 2022 08:18:58 -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 dfw.source.kernel.org (Postfix) with ESMTPS id 382D46120F; Fri, 25 Mar 2022 15:18:58 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 46ED0C340F4; Fri, 25 Mar 2022 15:18:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1648221537; bh=PTLwgRVoX7LFx/af87eu6iYF3/F/FoghDkUX2TJuteM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=dm7Gax3OYsop7vmuOXDrfPzwAxOAlEOGTRSRwhUCd7Sw/xvpDwUaADnJ1ccvIj/d/ HQAp4+b41FGtllhqQBAsjZJo2da51t9qCvl+rtXT4e7x7QwcxLMiiGTOc3T3Zwcz6T SjpdufuZHRvTH5uwAQ7QV8uUHCL/yg68iHkOqs9c= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Pablo Neira Ayuso Subject: [PATCH 5.17 20/39] netfilter: nf_tables: initialize registers in nft_do_chain() Date: Fri, 25 Mar 2022 16:14:35 +0100 Message-Id: <20220325150420.822067034@linuxfoundation.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220325150420.245733653@linuxfoundation.org> References: <20220325150420.245733653@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-3.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Pablo Neira Ayuso commit 4c905f6740a365464e91467aa50916555b28213d upstream. Initialize registers to avoid stack leak into userspace. Fixes: 96518518cc41 ("netfilter: add nftables") Signed-off-by: Pablo Neira Ayuso Signed-off-by: Greg Kroah-Hartman --- net/netfilter/nf_tables_core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/net/netfilter/nf_tables_core.c +++ b/net/netfilter/nf_tables_core.c @@ -201,7 +201,7 @@ nft_do_chain(struct nft_pktinfo *pkt, vo const struct nft_rule_dp *rule, *last_rule; const struct net *net = nft_net(pkt); const struct nft_expr *expr, *last; - struct nft_regs regs; + struct nft_regs regs = {}; unsigned int stackptr = 0; struct nft_jumpstack jumpstack[NFT_JUMP_STACK_SIZE]; bool genbit = READ_ONCE(net->nft.gencursor);