Received: by 2002:a05:7412:31a9:b0:e2:908c:2ebd with SMTP id et41csp2494522rdb; Tue, 12 Sep 2023 03:53:28 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHNvQdJWFz/dJoBURAC4W9RnXYXfkVuVKWmd7505jFK1/955EBELrhUBcq/lB87dng3GvQ2 X-Received: by 2002:a17:902:ea0a:b0:1bf:13fa:e75 with SMTP id s10-20020a170902ea0a00b001bf13fa0e75mr15680462plg.51.1694516008102; Tue, 12 Sep 2023 03:53:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1694516008; cv=none; d=google.com; s=arc-20160816; b=Ktprf83nZYTxwn/00rr6BDVQQZblARQpLh/mtvQ0s0vsQnYHenS+YAfUgkEk84O9eW p/lGtYHrWwKD25egF/IIGP9lyPy34ZsIzbR2JKfdO1FRZDwmUO07c/d5OFCyrbdq4sIY 12bruDEqQlJ1l8z9cuQ4BwnW+glciGAAwo3RuCMqWbXAB7rwyMMjJf8OcTgCd8oV1haX 9I6FguWFSa5mNJCmWNOcPCOVCIzhNkPRV5i43sOw9rHNgYOVaeF2dSHpc0+muC1AP4UO OCI2nOSNVwBhUnADmJacs19hcTURXOfN7nWHffVQRgBcAShR14O96S9m7DfcvvwJDOQ/ GeeA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=wxy9GTJEwoZuFhQla68fXscBI7wuzV+USEK30MZVKVY=; fh=EIABXR+uq6grVOG8QntrNvwWJhR0nVIo49VcPvMWcu4=; b=cJPHX1hSWW6IUYDM5bZ5bQJRi1xnNAdxZYz7hUoK7iUzrwjl10BBDiatkbiKiuv3KP zh0zATu8SiBceeHR6e4x19/826S6/hrgY/VbeJrsd22TdjUlyM5qKaGZoo9PbNHxjlHg ihTzcOUvTzjsLxOLbMfhtPkUiRVfY6QlTyW86lG5agr+iaQHy+nmtmVTNe7TgD29Hask zu8r9g1k5aDVMIJt9LP0kEBvXNMnssFgNjkB5mfO5hyVZK3+4VUjxbGnIJVyCYR+D6/Q LSrzwgI1L9v2tr/w9iR6icKwN/gHVbo8rs2X7hhl/LfLRbdGfZiLek3ZLISyK/t+w7Ji WdZA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from lipwig.vger.email (lipwig.vger.email. [2620:137:e000::3:3]) by mx.google.com with ESMTPS id a15-20020a170902eccf00b001b890b3a512si8163781plh.615.2023.09.12.03.53.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 12 Sep 2023 03:53:28 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) client-ip=2620:137:e000::3:3; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by lipwig.vger.email (Postfix) with ESMTP id 6E58180F5F38; Tue, 12 Sep 2023 03:28:37 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at lipwig.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231560AbjILK2D (ORCPT + 99 others); Tue, 12 Sep 2023 06:28:03 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40794 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234111AbjILK1p (ORCPT ); Tue, 12 Sep 2023 06:27:45 -0400 Received: from Chamillionaire.breakpoint.cc (Chamillionaire.breakpoint.cc [IPv6:2a0a:51c0:0:237:300::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6DFEE1705; Tue, 12 Sep 2023 03:27:13 -0700 (PDT) Received: from fw by Chamillionaire.breakpoint.cc with local (Exim 4.92) (envelope-from ) id 1qg0bl-000440-S5; Tue, 12 Sep 2023 12:27:01 +0200 Date: Tue, 12 Sep 2023 12:27:01 +0200 From: Florian Westphal To: Linux regressions mailing list Cc: Pablo Neira Ayuso , Timo Sigurdsson , kadlec@netfilter.org, fw@strlen.de, davem@davemloft.net, edumazet@google.com, kuba@kernel.org, pabeni@redhat.com, netfilter-devel@vger.kernel.org, coreteam@netfilter.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, stable@vger.kernel.org, sashal@kernel.org, carnil@debian.org, 1051592@bugs.debian.org Subject: Re: Regression: Commit "netfilter: nf_tables: disallow rule addition to bound chain via NFTA_RULE_CHAIN_ID" breaks ruleset loading in linux-stable Message-ID: <20230912102701.GA13516@breakpoint.cc> References: <20230911213750.5B4B663206F5@dd20004.kasserver.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (lipwig.vger.email [0.0.0.0]); Tue, 12 Sep 2023 03:28:37 -0700 (PDT) X-Spam-Status: No, score=-0.8 required=5.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lipwig.vger.email Linux regression tracking (Thorsten Leemhuis) wrote: > On 12.09.23 00:57, Pablo Neira Ayuso wrote: > > Userspace nftables v1.0.6 generates incorrect bytecode that hits a new > > kernel check that rejects adding rules to bound chains. The incorrect > > bytecode adds the chain binding, attach it to the rule and it adds the > > rules to the chain binding. I have cherry-picked these three patches > > for nftables v1.0.6 userspace and your ruleset restores fine. > > [...] > > Hmmmm. Well, this sounds like a kernel regression to me that normally > should be dealt with on the kernel level, as users after updating the > kernel should never have to update any userspace stuff to continue what > they have been doing before the kernel update. This is a combo of a userspace bug and this new sanity check that rejects the incorrect ordering (adding rules to the already-bound anonymous chain). nf_tables uses a transaction allor-nothing model, this means that any error that occurs during a transaction has to be reverse/undo all the pending changes. This has caused a myriad of bugs already. So while this can be theoretically fixed in the kernel I don't see a sane way to do it. Error unwinding / recovery from deeply nested errors is already too complex for my taste. > Can't the kernel somehow detect the incorrect bytecode and do the right > thing(tm) somehow? Theoretically yes, but I don't feel competent enough to do it, just look at all the UaF bugs of the past month.