Received: by 2002:a05:6a10:2726:0:0:0:0 with SMTP id ib38csp2187356pxb; Fri, 25 Mar 2022 12:39:07 -0700 (PDT) X-Google-Smtp-Source: ABdhPJynbloRs8Okm9ReqcU2C6m51cUvMgeze2eDWV08ZJ7tG/Ys+Dq2m3nUxN24axZ7yp4YUm+U X-Received: by 2002:a63:3185:0:b0:382:623b:3c84 with SMTP id x127-20020a633185000000b00382623b3c84mr885385pgx.479.1648237147499; Fri, 25 Mar 2022 12:39:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1648237147; cv=none; d=google.com; s=arc-20160816; b=mxjwcOeiJadlT+aiD+8c833drRI+Mc00ReV42pHdxqOWiOTrJx5UwPtZc2kWNRPBdX KEp+cP3WD3rJqNHEPUpxyrn36JT+0wTNHiG+EJ7Q/eCEV5RSPSxLTiGtOpD40HK/f/8n JG5770pDzxhi0WZ9rZv0Pje0dDZfgiozNLBUTMeWYmwqN5qNVQvSJCR+fOOLesPoRWKP NcchjeUZc7zdutq6ZCNb8+Qn3uO8CBMcZCMljhz/EzFgBgyJlnrOmJAvHGNtzNXR+arW dT1Za7YUgMc7uzZQo93aLucoATgw6iDzUb/KPESJ1sroiPszUfRyqi4KvuXKKqcuTcMy Fstg== 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=NH8tZR5jU+8Ayv5HZhx78fA/FwYnQCnEAAy1Li10DEc=; b=CNP14B1siiNMjr+G4mexwDYZPoHb6y/dF80iVr24DuH2iTf9SepSAhU/x/ipm3ITxL FCwKtp6atOOhlLKNisu4hh8PxQ/+iwQFX8jjg64LGcUtu/lVh+A9rL/zAJWJTKYDeKy8 36Zr6XRu14VyCMyknaMRV7SamiZpXQEk0cpSqUme3KfLaB1Q1T9dlnLgoL8t3D3bTpVz bsMh6/GnOASz45oNojkSEYyVPpw4+m84aiuEziRrGoG/BJhzWCaM9nWvGUH9qAjUOsqu fXlPu/FBgLnksc2EOvVIaNIBkpAxNjM2tTkhfI0PI41Na3OH+ORd1GgXDSWg3OYgxbdz BjYA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=RVg0Prln; 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 b9-20020a170902d40900b00153b691f326si2851212ple.364.2022.03.25.12.39.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 25 Mar 2022 12:39:07 -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=RVg0Prln; 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 40D69277955; Fri, 25 Mar 2022 11:30:07 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1376752AbiCYPNV (ORCPT + 99 others); Fri, 25 Mar 2022 11:13:21 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43816 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1359787AbiCYPKg (ORCPT ); Fri, 25 Mar 2022 11:10:36 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EFE8C6273; Fri, 25 Mar 2022 08:08:06 -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 C390E61C1A; Fri, 25 Mar 2022 15:08:05 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id D47BDC340E9; Fri, 25 Mar 2022 15:08:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1648220885; bh=KFdJg0u0Ss3Tzkf16u9n79i+nKiZd4QsLL/5VaEmHS4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=RVg0PrlnkAUGtyOTEKDYRs9pdtyq5fmxcEw5GBN6XJJDgT8a3AuxJnW7ckH+ejGHA K7ZNo1q8Vou4FuV6R8WXz8Jn0W3UP6LLy+P7RRpQN+mTPCpCMUsAqHhtCSJQDghJGA aEocbyAyatVZsoILjihyq8D3VN7caok8cCKDkQQI= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Pablo Neira Ayuso Subject: [PATCH 5.4 21/29] netfilter: nf_tables: initialize registers in nft_do_chain() Date: Fri, 25 Mar 2022 16:05:01 +0100 Message-Id: <20220325150419.196662736@linuxfoundation.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220325150418.585286754@linuxfoundation.org> References: <20220325150418.585286754@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 @@ -153,7 +153,7 @@ nft_do_chain(struct nft_pktinfo *pkt, vo struct nft_rule *const *rules; const struct nft_rule *rule; 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);