From patchwork Thu Apr 7 14:19:13 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thadeu Lima de Souza Cascardo X-Patchwork-Id: 1614523 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=canonical.com header.i=@canonical.com header.a=rsa-sha256 header.s=20210705 header.b=LuvRylq3; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.ubuntu.com (client-ip=91.189.94.19; helo=huckleberry.canonical.com; envelope-from=kernel-team-bounces@lists.ubuntu.com; receiver=) Received: from huckleberry.canonical.com (huckleberry.canonical.com [91.189.94.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by bilbo.ozlabs.org (Postfix) with ESMTPS id 4KZ3RS4JqYz9sGH for ; Fri, 8 Apr 2022 00:19:32 +1000 (AEST) Received: from localhost ([127.0.0.1] helo=huckleberry.canonical.com) by huckleberry.canonical.com with esmtp (Exim 4.86_2) (envelope-from ) id 1ncSyt-0008Dp-OH; Thu, 07 Apr 2022 14:19:27 +0000 Received: from smtp-relay-canonical-1.internal ([10.131.114.174] helo=smtp-relay-canonical-1.canonical.com) by huckleberry.canonical.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1ncSys-0008DC-4c for kernel-team@lists.ubuntu.com; Thu, 07 Apr 2022 14:19:26 +0000 Received: from quatroqueijos.. (unknown [179.93.182.122]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by smtp-relay-canonical-1.canonical.com (Postfix) with ESMTPSA id EB05A3F117 for ; Thu, 7 Apr 2022 14:19:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=canonical.com; s=20210705; t=1649341165; bh=oSJVVMxuJkiK9j/Tumw2EPN1Bg5nuv8PHb1iCGIn59c=; h=From:To:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=LuvRylq32FGllFrcYto06Jw01QDuS7VsQoUnOOrpMp4D4Ap2zkaTpbiXNBEE5JZvK xR2efCMAacDm/lY0nxzIJ3xPizxeLg9gSCyk1hhLGQRWGttx/Vskp4Wrq69eOxptAl KtmqxoPbVyy0Nn+kazBjC8yer4PoaJkKQvZzPSXzYnsZ8ve9MOkJVavclRR0O5GYCb cghY04mEAmy6tPHi49iOeH0r03t/WBQidc+ANMCpKjUlPuLKQn+NFAOX1U1lpfUSrm q/YWM4tIcUpg8SnEr31Txq/oiqtFRwG/1Akl5vRhABLRKsprwQ05dOniWGRvG8DlF2 7whoWa86qofwA== From: Thadeu Lima de Souza Cascardo To: kernel-team@lists.ubuntu.com Subject: [SRU Focal/Jammy 1/1] netfilter: nf_tables: initialize registers in nft_do_chain() Date: Thu, 7 Apr 2022 11:19:13 -0300 Message-Id: <20220407141913.363116-2-cascardo@canonical.com> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20220407141913.363116-1-cascardo@canonical.com> References: <20220407141913.363116-1-cascardo@canonical.com> MIME-Version: 1.0 X-BeenThere: kernel-team@lists.ubuntu.com X-Mailman-Version: 2.1.20 Precedence: list List-Id: Kernel team discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: kernel-team-bounces@lists.ubuntu.com Sender: "kernel-team" From: Pablo Neira Ayuso Initialize registers to avoid stack leak into userspace. Fixes: 96518518cc41 ("netfilter: add nftables") Signed-off-by: Pablo Neira Ayuso (cherry picked from commit 4c905f6740a365464e91467aa50916555b28213d) CVE-2022-1016 Signed-off-by: Thadeu Lima de Souza Cascardo --- net/netfilter/nf_tables_core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/netfilter/nf_tables_core.c b/net/netfilter/nf_tables_core.c index 866cfba04d6c..907e848dbc17 100644 --- a/net/netfilter/nf_tables_core.c +++ b/net/netfilter/nf_tables_core.c @@ -162,7 +162,7 @@ nft_do_chain(struct nft_pktinfo *pkt, void *priv) 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);