From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796428164; b=IKJHXRrCIwtPIhAQq7xRSSmOYjm7W6Sw2BIyFDn8mGPZEeRndkxaDLnANwUQEHRXF6TS xnUQjm5nOfu0qwV+KUxqk2R8+MUOmttdU+afs/fRG2N4EesnUGSh6IZ1ph0kdc8wLmlox QB9tNWmq4ZmiQJT3iBFlvd6unszFmRi8qqRRDGcjrLxiq5hCa7WJ96d9Jpzbv1iPRWp6z mVXVCOH/rTfC/+Amdb/3hFs49q9Ne8TPETUlvpoJf94Nq/IyjUNpFz/cHbztgfOp/3nOc rbq0i6DdJ5Zb05d14kapQDGBPJhtcVuv/9HyVLu0nmbtJx+uwux/5zXWyfMzvyCGefg== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796428164; h=Received:DKIM-Signature:Date:From:To:Cc:Subject:Message-ID: References:MIME-Version:Content-Type:Content-Disposition:In-Reply-To; bh=3MlylO08OQSvlmz9rCnPK2ODQgOLxGiKXL8VBk7VQs4=; b=PAsHUKQj4AFy4ciI7oeAJ0HaQgsiIVeG129w0gs8ecEnYhyeaSaIwvPZkCNieQpY1zbL MCtgCyTumCqqTWSTG6Z5IATCQB4pmsYnMbvPTU6uyimYM40t6sebJHl/f8dccweJ6Bfgy atOyZDHL8ViVeDOgZI/sgYfdrOxfN3fRI99NavBzgafVwsM2y0NWbyTo8d8lTthIOvAfk WcPhSX8imYvsqX1IqWdG0e2NHn2wKGSOzTedXkAGRFBJ+qatxFWw4Y5qCfjlqpvQdnPth ju0+6nMqAyTCojdjI63ilGwziAfR9nWoPq1TbwzK1Rzm5LYqtRpf2gfQFlEG/JvJ9rQ== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=eqI++S5Z; arc=none smtp.remote-ip=100.103.45.18 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id BE8DB606A322; Fri, 4 Dec 2026 23:49:24 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=eqI++S5Z 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-Mailing-List: linux-hardening@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list 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> 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 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 914B4606A322 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=yE1FZGze; dkim=fail reason="signature verification failed" (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: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Unsubscribe-Post:List-Owner; bh=NK4EppsSf7mwMyyPWpFMpyjGiY/GLSrwQfMqe9skSt0=; b=yE1FZGzed78Q9RHyO0IOAE5UPV qcarqWwWKzBDVoCwM7lgz9vZzrPkI+9sV/EhGYGLAWcz8Ysy/OatBB4BPvLBonzUzLkQ9GeXt6Jj+ Ah6WOMB4ryfnJ5zWCGU3pWE4KSeU9uFt/ftG/N3Xc5qYw83LvISodhvJPMN6i0xIVFR93rpb8bAWr JymBYZLRkvVAqWIzq9XfFxR0IbyS/zxFhaF+M3lc4EGAWtDX2S1tNu1aF80iIW4tPiLnCmkz+5Yvz CXICb1YezEFRXOlK6YkZ+uCN+Z7Zf7xJQ3noINiuYHIRXSCz7XMlQ9DnANin0XQ6jhb4y3SZJaVz+ lPjGnyYQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.100.1 #2 (Red Hat Linux)) id 1xZd1u-00000001lfM-2GmM; 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-Disposition: inline In-Reply-To: <20261203-clk-onecell-count-order-v1-0-2b0e4e8d9ea6@cressey.dev> X-BeenThere: linux-riscv@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-riscv" X-Spam-Status: No, score=-4.3 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,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 _______________________________________________ linux-riscv mailing list linux-riscv@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-riscv