From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 9A2DA1607A9 for ; Fri, 5 Apr 2024 09:39:28 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712309968; cv=none; b=lEbm4kKCSIqC2BlXVZrz45eL9c6y721M3OHGYw6r18FoU8lz7Ta0e4UmHHmA4z7paWVwq41zJJFhSIkQW28QYUsqLJIhKSS3nXyG2uzw5qYZg18wl3L+lGReExXgecJfZiMuW//fdlNdItGHgjdFAqODvB+lu7e1ci5v688Zp+I= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712309968; c=relaxed/simple; bh=siJbvucdlQB8rk2wkm2AUA+EF7iZ4F/R7S3B3/vNc1E=; h=Subject:To:Cc:From:Date:Message-ID:MIME-Version:Content-Type; b=Vg8DMOUNQT1EfjK1VYQPpED89mYqVRXcg712axYmkZnRqY/cWCFnHXrbhAegyEHKBVX2DWMmnPes4PwPD4/Q7e3UU4D8ijhvPW/mLt3YtiC0d451DSRqLKLonLvlPeD1Lqga0GdXHYyOtacF8Y7BnWkZSsUL5hbiBddexoIYSaE= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=LPHxZ0Ts; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="LPHxZ0Ts" Received: by smtp.kernel.org (Postfix) with ESMTPSA id C7388C433C7; Fri, 5 Apr 2024 09:39:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1712309968; bh=siJbvucdlQB8rk2wkm2AUA+EF7iZ4F/R7S3B3/vNc1E=; h=Subject:To:Cc:From:Date:From; b=LPHxZ0Ts2q0JE/PUGZjbX14E1INRVpU+vAPC+xgDzVa4qs+Ur7YMVg1MuyJKrYv1t tqRnlzfceqndNt/OddLIaWxaM/fVVwoxCpg1GOQ3cKjCsbKM1FBTDdnmSRebzH5HdQ zyb2M+0R+0l/RyAoSuFlkDIgU4SOwv/JS8r4yxUM= Subject: FAILED: patch "[PATCH] netfilter: nf_tables: discard table flag update with pending" failed to apply to 5.4-stable tree To: pablo@netfilter.org Cc: From: Date: Fri, 05 Apr 2024 11:39:15 +0200 Message-ID: <2024040515-cornbread-bottling-0651@gregkh> Precedence: bulk X-Mailing-List: stable@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=ANSI_X3.4-1968 Content-Transfer-Encoding: 8bit The patch below does not apply to the 5.4-stable tree. If someone wants it applied there, or to any other stable or longterm tree, then please email the backport, including the original git commit id to . To reproduce the conflict and resubmit, you may use the following commands: git fetch https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/ linux-5.4.y git checkout FETCH_HEAD git cherry-pick -x 1bc83a019bbe268be3526406245ec28c2458a518 # git commit -s git send-email --to '' --in-reply-to '2024040515-cornbread-bottling-0651@gregkh' --subject-prefix 'PATCH 5.4.y' HEAD^.. Possible dependencies: thanks, greg k-h ------------------ original commit in Linus's tree ------------------ >From 1bc83a019bbe268be3526406245ec28c2458a518 Mon Sep 17 00:00:00 2001 From: Pablo Neira Ayuso Date: Wed, 3 Apr 2024 19:35:30 +0200 Subject: [PATCH] netfilter: nf_tables: discard table flag update with pending basechain deletion Hook unregistration is deferred to the commit phase, same occurs with hook updates triggered by the table dormant flag. When both commands are combined, this results in deleting a basechain while leaving its hook still registered in the core. Fixes: 179d9ba5559a ("netfilter: nf_tables: fix table flag updates") Signed-off-by: Pablo Neira Ayuso diff --git a/net/netfilter/nf_tables_api.c b/net/netfilter/nf_tables_api.c index e02d0ae4f436..d89d77946719 100644 --- a/net/netfilter/nf_tables_api.c +++ b/net/netfilter/nf_tables_api.c @@ -1209,10 +1209,11 @@ static bool nft_table_pending_update(const struct nft_ctx *ctx) return true; list_for_each_entry(trans, &nft_net->commit_list, list) { - if ((trans->msg_type == NFT_MSG_NEWCHAIN || - trans->msg_type == NFT_MSG_DELCHAIN) && - trans->ctx.table == ctx->table && - nft_trans_chain_update(trans)) + if (trans->ctx.table == ctx->table && + ((trans->msg_type == NFT_MSG_NEWCHAIN && + nft_trans_chain_update(trans)) || + (trans->msg_type == NFT_MSG_DELCHAIN && + nft_is_base_chain(trans->ctx.chain)))) return true; }