From patchwork Wed Feb 21 19:07:48 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bethany Jamison X-Patchwork-Id: 1902381 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.ubuntu.com (client-ip=185.125.189.65; helo=lists.ubuntu.com; envelope-from=kernel-team-bounces@lists.ubuntu.com; receiver=patchwork.ozlabs.org) Received: from lists.ubuntu.com (lists.ubuntu.com [185.125.189.65]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4Tg5QT2S6Nz23d4 for ; Thu, 22 Feb 2024 06:08:16 +1100 (AEDT) Received: from localhost ([127.0.0.1] helo=lists.ubuntu.com) by lists.ubuntu.com with esmtp (Exim 4.86_2) (envelope-from ) id 1rcrwk-00053M-Kn; Wed, 21 Feb 2024 19:07:58 +0000 Received: from smtp-relay-internal-0.internal ([10.131.114.225] helo=smtp-relay-internal-0.canonical.com) by lists.ubuntu.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1rcrwf-00052w-5p for kernel-team@lists.ubuntu.com; Wed, 21 Feb 2024 19:07:53 +0000 Received: from mail-io1-f70.google.com (mail-io1-f70.google.com [209.85.166.70]) (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-internal-0.canonical.com (Postfix) with ESMTPS id 8D1C13F188 for ; Wed, 21 Feb 2024 19:07:52 +0000 (UTC) Received: by mail-io1-f70.google.com with SMTP id ca18e2360f4ac-7bfeb848712so267405139f.2 for ; Wed, 21 Feb 2024 11:07:52 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1708542471; x=1709147271; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=YWEvJGl/sLV8JKhVzQ1+LqlTVbO+cH+fZN/oMf7fk0A=; b=T3M8zUGOgOXBJoF/V0/hJe/u41EoDFlw7QnlBk6bu36GySTKY3LMSxxY/6GGhjFOIV 3F0Tgr28Sk6T5aFOR9qiENOVMKcI5pEJHPthzDvLr2knVcUmpqjOV277imbwsjiyFQFW 0yfn/zRHuhltQvYchSJBbSNOqMPQhYoyKbumfvIGYox4uTX97XZp/Nf8YBLUOQyUTUAA osga+T9/ZdWKbMTgwI2NxwhlvXldrRG0IPj/7VBxsqUBz6nHnMez7hlerphVcres0HUT TYOW3rmhnd6XC31i6Lerded1HQMRLnlyJBx858v8WZjU4tcIB7t78TcGh9MRvcTJ+6jZ ir9w== X-Gm-Message-State: AOJu0YyWuAsHajfFo/DNbjyGuLOz6Fr/d+0zYO1Ogxy0t5boRVertxjg KCMeLy/2Yqy5tKmYyif1eYTESRpzn7JYdPuG71QSrHgCWFCg9bALlCgemHFRb9DApKzHwCaPoH2 GRbcFdg2Op7qWt0Rva/IHMnUL24g330sX9R4ypMP1HrBTnIVDNc+0F2l5S00U2buRDBo9IzcKZf GdR1nmO4T9nA== X-Received: by 2002:a05:6602:58:b0:7c7:4266:8fae with SMTP id z24-20020a056602005800b007c742668faemr11777493ioz.7.1708542471126; Wed, 21 Feb 2024 11:07:51 -0800 (PST) X-Google-Smtp-Source: AGHT+IGitLR6R3c3bacNflJLxUDTO7bAFGrzHQdxBhIuQxJQVhdmEZTj1av5la0eeKj0xK/ibsKDPQ== X-Received: by 2002:a05:6602:58:b0:7c7:4266:8fae with SMTP id z24-20020a056602005800b007c742668faemr11777477ioz.7.1708542470746; Wed, 21 Feb 2024 11:07:50 -0800 (PST) Received: from smtp.gmail.com (104-218-69-129.dynamic.lnk.ne.allofiber.net. [104.218.69.129]) by smtp.gmail.com with ESMTPSA id l10-20020a056638144a00b004744de5c3f8sm218355jad.150.2024.02.21.11.07.50 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 21 Feb 2024 11:07:50 -0800 (PST) From: Bethany Jamison To: kernel-team@lists.ubuntu.com Subject: [SRU][Mantic][Jammy][PATCH 1/1] netfilter: nf_tables: check if catch-all set element is active in next generation Date: Wed, 21 Feb 2024 13:07:48 -0600 Message-Id: <20240221190748.53029-2-bethany.jamison@canonical.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240221190748.53029-1-bethany.jamison@canonical.com> References: <20240221190748.53029-1-bethany.jamison@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 When deactivating the catch-all set element, check the state in the next generation that represents this transaction. This bug uncovered after the recent removal of the element busy mark a2dd0233cbc4 ("netfilter: nf_tables: remove busy mark and gc batch API"). Fixes: aaa31047a6d2 ("netfilter: nftables: add catch-all set element support") Cc: stable@vger.kernel.org Reported-by: lonial con Signed-off-by: Pablo Neira Ayuso (cherry picked from commit b1db244ffd041a49ecc9618e8feb6b5c1afcdaa7) CVE-2024-1085 Signed-off-by: Bethany Jamison --- net/netfilter/nf_tables_api.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/netfilter/nf_tables_api.c b/net/netfilter/nf_tables_api.c index 6b9eea5cc58d4..9810d98860389 100644 --- a/net/netfilter/nf_tables_api.c +++ b/net/netfilter/nf_tables_api.c @@ -6419,7 +6419,7 @@ static int nft_setelem_catchall_deactivate(const struct net *net, list_for_each_entry(catchall, &set->catchall_list, list) { ext = nft_set_elem_ext(set, catchall->elem); - if (!nft_is_active(net, ext)) + if (!nft_is_active_next(net, ext)) continue; kfree(elem->priv);