Received: by 2002:a05:7412:31a9:b0:e2:908c:2ebd with SMTP id et41csp4318159rdb; Thu, 14 Sep 2023 20:31:18 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGMLiqWc7/rwywHgIY1KVOz+HtZpL4BtzIqUODSo8VTBjXW2rJyS6Otthxln1njNO6XB6VS X-Received: by 2002:a05:6870:328f:b0:1d5:aa87:69fe with SMTP id q15-20020a056870328f00b001d5aa8769femr714361oac.32.1694748678424; Thu, 14 Sep 2023 20:31:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1694748678; cv=none; d=google.com; s=arc-20160816; b=Viov7TkMUzkaIGD9uRY4dbJDRjh5Ak7u0hJTEj5VaNqrULRiE9A5fnZI1YGb6Ijkir +qwpZOiZceJUkmUY8Axyb0swUYzSYldZB8C8W5+PHqdJHK+VepX5ZJnc17WfNCylwN4W HCqK5CDAv9wcpFA+nZJxWmwW7uxz8r4CZxARMPVZny/WG6OA4vxDc3rp6oxS1jlEimOF W4P8kYKVJAgf/KmICuZOyF/8nKhP2nRIpG3s1TPakjGvyi3E49utSQlfj8i4ZQsXaJ1I tEiQz4avq5Uy625zXEjpEQrBIUN7+7TMYCKfBaRq9jrotSNeIuvqPdU4naNcZepnZhFZ kpIw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:dkim-signature:date; bh=aZTgCiWE0chaqwM5saw2BuBDfsLuZ1U35lfHL2wRKK8=; fh=/++g1+M59rqnktyuV8qhxexuw6ZZRt85Q/hF1rG4mkU=; b=X0Xd/+kx0mQaqK6sgAzW2DMx2Ud/Rg9J/hUvJa+RhJd3dTSjWugRtmV28qQUZLAnxs gculFqp3RzQlVAmt8xHMwR08xe0nMeXfZcKi9kVxOpkLdo3I9IIWfoGRxnKKT5sPe8Pf lXy4ucG7w4DSsY0Acvkz4SrHguKH5VehtbO+SaNfxl+/XYQSUdfuZ+be27IsijMVQn52 LlHOUGx1E2c939egnteICPMPzrRkHucssK8rSdbMKG5pNhfQ+jO37m/AurxRdj8devyt IPlX4P2ESnqrTrTSyNNHW7JLQWUXL8Mt1lGV8qtWyZA06sJIZ8klk6+9WSvxqyp2GsST bpoA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b=bFLwUJkB; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.dev Return-Path: Received: from agentk.vger.email (agentk.vger.email. [2620:137:e000::3:2]) by mx.google.com with ESMTPS id a18-20020a63d212000000b005774d2f4ab5si2422868pgg.807.2023.09.14.20.31.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 14 Sep 2023 20:31:18 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) client-ip=2620:137:e000::3:2; Authentication-Results: mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b=bFLwUJkB; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.dev Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by agentk.vger.email (Postfix) with ESMTP id C32F2804C6D8; Thu, 14 Sep 2023 12:15:57 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S241501AbjINTPy (ORCPT + 99 others); Thu, 14 Sep 2023 15:15:54 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57396 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241250AbjINTPv (ORCPT ); Thu, 14 Sep 2023 15:15:51 -0400 Received: from out-213.mta1.migadu.com (out-213.mta1.migadu.com [95.215.58.213]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A9CD826B2 for ; Thu, 14 Sep 2023 12:15:47 -0700 (PDT) Date: Thu, 14 Sep 2023 15:15:41 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1694718945; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=aZTgCiWE0chaqwM5saw2BuBDfsLuZ1U35lfHL2wRKK8=; b=bFLwUJkB0zkmQGFVYoxn7V0I+LuYOiFMSNiaGXBAPlHCb8qVe/uKBQqwtUxszFnz4ORieC 08UGXIrHUScc4zDxeTzsNu88HRT6x+zzXRrC9I26tDGerefdVSeJFvNs2T5jJLvLpqnDLu jxDp99iIwtWKAvhIrSgi34Myij4d35Y= X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: Kent Overstreet To: Kees Cook Cc: Josh Poimboeuf , Randy Dunlap , Stephen Rothwell , Linux Next Mailing List , Linux Kernel Mailing List , Peter Zijlstra Subject: Re: linux-next: Tree for Sep 12 (bcachefs, objtool) Message-ID: <20230914191541.yo6riwrmntqchmgu@moria.home.lan> References: <20230912152645.0868a96a@canb.auug.org.au> <20230913210829.zkxv6qqlamymhatr@treble> <202309131758.208804F4@keescook> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <202309131758.208804F4@keescook> X-Migadu-Flow: FLOW_OUT 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 (agentk.vger.email [0.0.0.0]); Thu, 14 Sep 2023 12:15:58 -0700 (PDT) X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,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 agentk.vger.email On Wed, Sep 13, 2023 at 06:01:42PM -0700, Kees Cook wrote: > On Wed, Sep 13, 2023 at 11:08:29PM +0200, Josh Poimboeuf wrote: > > On Tue, Sep 12, 2023 at 04:36:55PM -0700, Randy Dunlap wrote: > > > > > > > > > On 9/11/23 22:26, Stephen Rothwell wrote: > > > > Hi all, > > > > > > > > Changes since 20230911: > > > > > > > > New tree: bcachefs > > > > > > > > The bcachefs tree gained a semantic conflict against Linus' tree for > > > > which I applied a patch. > > > > > > > > The wireless-next tree gaind a conflict against the wireless tree. > > > > > > > > Non-merge commits (relative to Linus' tree): 4095 > > > > 1552 files changed, 346893 insertions(+), 22945 deletions(-) > > > > > > > > ---------------------------------------------------------------------------- > > > > > > on x86_64: > > > > > > vmlinux.o: warning: objtool: bch2_dev_buckets_reserved.part.0() is missing an ELF size annotation > > > > Here ya go: > > > > ---8<--- > > > > From: Josh Poimboeuf > > Subject: [PATCH] bcachefs: Remove undefined behavior in bch2_dev_buckets_reserved() > > > > In general it's a good idea to avoid using bare unreachable() because it > > introduces undefined behavior in compiled code. In this case it even > > confuses GCC into emitting an empty unused > > bch2_dev_buckets_reserved.part.0() function. > > > > Use BUG() instead, which is nice and defined. While in theory it should > > never trigger, if something were to go awry and the BCH_WATERMARK_NR > > case were to actually hit, the failure mode is much more robust. > > > > Fixes the following warnings: > > > > vmlinux.o: warning: objtool: bch2_bucket_alloc_trans() falls through to next function bch2_reset_alloc_cursors() > > vmlinux.o: warning: objtool: bch2_dev_buckets_reserved.part.0() is missing an ELF size annotation > > > > Reported-by: Randy Dunlap > > Signed-off-by: Josh Poimboeuf > > --- > > fs/bcachefs/buckets.h | 2 +- > > 1 file changed, 1 insertion(+), 1 deletion(-) > > > > diff --git a/fs/bcachefs/buckets.h b/fs/bcachefs/buckets.h > > index f192809f50cf..0eff05c79c65 100644 > > --- a/fs/bcachefs/buckets.h > > +++ b/fs/bcachefs/buckets.h > > @@ -180,7 +180,7 @@ static inline u64 bch2_dev_buckets_reserved(struct bch_dev *ca, enum bch_waterma > > > > switch (watermark) { > > case BCH_WATERMARK_NR: > > - unreachable(); > > + BUG(); > > Linus gets really upset about new BUG() usage (takes out the entire > system): > https://docs.kernel.org/process/deprecated.html#bug-and-bug-on > > It'd be nicer to actually handle the impossible case. (WARN and return > 0?) No, I'm not going to be doing that. These are truly impossible cases, i.e. if we were writing code in a language with embedded correctness proofs this is something the compiler would be checking and proving. Changing all the BUG()s to WARNS() and writing error paths would mean etiher a shit ton of error paths that never get tested, or deleting a lot of a assertions, and I'm not doing either of those things.