From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 92CBA606A32C for ; Fri, 4 Dec 2026 23:49:40 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=bombadil.20210309 header.b=caXc2exQ; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=eqI++S5Z DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:In-Reply-To:Content-Type: MIME-Version:References:Message-ID:Subject:Cc:To:From:Date:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Unsubscribe-Post:List-Owner; bh=3MlylO08OQSvlmz9rCnPK2ODQgOLxGiKXL8VBk7VQs4=; b=caXc2exQRLg0Ha3YxvOlL90j8j j9DVwQHjN8soYO+zHKlKn+MunxOTkSRsNXfaD2hi9sFOQCvRWu8doXCib/5pCvHPY0kll2l4Bl9Z0 X3BeEBU/YLC9bLVpb7IDo0Pgrzpqfi0QhYmE7tGU/sGGcIxk19dzQTI5MubnC4tZebCOjGjVzCuee 6VpO1mWQYVma4WGmncP9DZ2RM5NQer7bz9ZZRtosUi7eni77Q6YSW3RkriWSl+5SreMiNLbgPL0+W 2Czqs5a4IgHbB5chXULzdCtg/bNuiVKkme8u5waDZAp18C7NRW/ysmbws+pXT5hTIckFph4uClgve zsY0g9vQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.100.1 #2 (Red Hat Linux)) id 1xZd1s-00000001lf1-1zgi; Fri, 04 Dec 2026 23:49:30 +0000 Received: from sea.source.kernel.org ([172.234.252.31]) by bombadil.infradead.org with esmtps (Exim 4.100.1 #2 (Red Hat Linux)) id 1xZd1p-00000001lei-15Nx; Fri, 04 Dec 2026 23:49:27 +0000 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) by sea.source.kernel.org (Postfix) with ESMTP id B6BE7442B3; Fri, 4 Dec 2026 23:49:24 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 938641F00936; Fri, 4 Dec 2026 23:49:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796428164; bh=3MlylO08OQSvlmz9rCnPK2ODQgOLxGiKXL8VBk7VQs4=; h=Date:From:To:Cc:Subject:References:In-Reply-To; b=eqI++S5Z1JUgSL/TIONBwK/BBAQCNoA5kYVZ9lPeZr/hEjlBkNCUkr30lvha5bu2k ntqiG/X2KejwIO30VXV9LN7l0pmSOiFgb1EjIJz4+wOZN3xFuORPQ8uHXjLxlWWXGo tQvDvM3YpEwDyUup73wMeBpVUg50rWnAyd01heLxCPTx2tZpKCIiPCcaBJTWHXAiQb ml02IBIQkvbMkcRfQGP9YWTFpcBgLPSm6iGhvCR27kKgeo44p99HuxBXJJCWwxBsFN Afg2hHUA525VcGr6aNiJM9Em7VcH5HPyeZLybbiCUGelHx2b/C8MirADQNtHnju/8g 7imtR1cKBm9mA== Date: Fri, 4 Dec 2026 15:49:24 -0800 From: Kees Cook To: Ben Cressey Cc: Junhui Liu , Manivannan Sadhasivam , Nobuhiro Iwamatsu , Michal Simek , Stephen Boyd , Brian Masney , Jerome Brunet , Paul Walmsley , Samuel Holland , Emil Renner Berthing , Hal Feng , Nathan Chancellor , Nick Desaulniers , Bill Wendling , Justin Stitt , "Gustavo A. R. Silva" , linux-arm-kernel@lists.infradead.org, linux-clk@vger.kernel.org, linux-riscv@lists.infradead.org, llvm@lists.linux.dev, linux-hardening@vger.kernel.org, Harry Austen , Changhuang Liang , stable@vger.kernel.org Subject: Re: [PATCH 00/11] clk: Set __counted_by counts before filling the arrays Message-ID: <202612041547.9D0124861D@keescook> References: <20261203-clk-onecell-count-order-v1-0-2b0e4e8d9ea6@cressey.dev> X-Archived-By: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20261203-clk-onecell-count-order-v1-0-2b0e4e8d9ea6@cressey.dev> X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" X-Spam-Status: No, score=-6.3 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS autolearn=no autolearn_force=no version=4.0.1 X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-26) on aws-us-west-2-korg-listserv-alma10-1 On Thu, Dec 03, 2026 at 04:15:38PM -0800, Ben Cressey wrote: > Ten clk drivers access an array annotated with __counted_by while its > count is still zero. CONFIG_UBSAN_BOUNDS reports those accesses, and > CONFIG_UBSAN_TRAP can stop the boot or the probe on them. In v7.4-rc5, > this affects Clang 20 and 21, where CONFIG_CC_HAS_BROKEN_COUNTED_BY_REF > keeps the flex allocators from setting the count. Nine of the drivers > are also affected in older releases. I was considering moving the Clang version support for counted_by up to where counted_by_ref isn't broken, as that would "fix" this too, and be "future proof". But it removes coverage for old Clang builds. I'm fine either way: if the clk patches are tolerable, we can do that. I'm just worried there will be more instances of this problem sneaking in. -Kees -- Kees Cook