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: stable@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