From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B7FC12BDC3D for ; Sat, 21 Feb 2026 23:19:57 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1771715997; cv=none; b=FiGECPCmD0KsxeHUhbQ+jghn2eh9h68uVeUuSX6KHbBQh3+TSFVwGMiDhQ8m3plsrXjBgZ++NgfpxmHFnlxZXu1vP4ofME90z3asugFhYyxKHC9UwBcBZ1fe375bQeHFhyzovFdJ/fS6JupRHerVLzcUWCl7qYG//GT9xQt3E0Y= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1771715997; c=relaxed/simple; bh=dd83vicnzqOzq+FTgkg+xMKRgXxQ84jmyxiWvZFg+Kg=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=cISv2jOlsBr8ETl8LUDqK6ugGgoNrL4Mn4ulBBIk76lVsZKNNQ38nyCRbSk/9/AG8yMFTRo9M4TuCvdjOLO6A7YM9qw+evQZVvD/Q7RjzxG1pyyeJxfPdHz8yY4+3letZ/cczs7LK4XogvPqQpD/7jHeMVJ6vdQcqDyXTXGLdpQ= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=X9Ap5OsU; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="X9Ap5OsU" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 4BF04C4CEF7; Sat, 21 Feb 2026 23:19:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1771715997; bh=dd83vicnzqOzq+FTgkg+xMKRgXxQ84jmyxiWvZFg+Kg=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=X9Ap5OsUKNzTN97FlTSkEBy5TWig9sGRq2YIBQNm/1G+WrjX34Pic5vWC70VoFjtb zAe4Td+SB77hV5BBsX9MOgRoFfr6cZYGb7I6peoVEOoxtzSdrSrMtDLu/fSZd5Xj2B cKN44RyAY3Cc9g4G+3QXY23hjJfdgbMDgiTnDTayUpw4gOyo1urKtTxJ3ZaOfjbora HuAgqVaEwDJxgjffnB6/D9sxMZ3LU8T4V3a0z0bpBet5YlpWQpN7w8TNwftpYkAiie o3yOmXlkcEAxPsDtEzfd8p1l2AfVjRtEnTaqfF2IB07DwDs+0ZlHvCgOTQf7bFSk74 kaGjx6eImItuw== Date: Sat, 21 Feb 2026 15:19:56 -0800 From: Kees Cook To: Linus Torvalds Cc: linux-kernel@vger.kernel.org Subject: Re: [GIT PULL] kmalloc_obj treewide refactor for v7.0-rc1 Message-ID: <202602211508.57394C771A@keescook> References: <202602210108.0EABDA1CDD@keescook> <202602211442.1BE76271@keescook> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: On Sat, Feb 21, 2026 at 03:01:15PM -0800, Linus Torvalds wrote: > But I think I found the real bug: > > #define overflows_flex_counter_type(TYPE, FAM, COUNT) \ > (!overflows_type(COUNT, typeof_flex_counter(((TYPE *)NULL)->FAM))) > > WTF is up with that '!' there? That seems entirely bogus. So now > overflows_flex_counter_type() will return true in it *doesn't* > overflow the type. > > So I think clang was not actually the problem. That whole code looks buggy. I would agree. This code mutated a few times but the logic and docs for this function are in sync ("Returns: true if @COUNT can be represented") but I renamed it somewhere along the way in a confusing way and then got the above quoted macro's usage wrong. > But that actually makes me *less* happy, because it means that this > whole patch must have been ENTIRELY untested in any shape or form. > > If I read this right, none of this should have successfully booted > anywhere if you had actually tested it outside of just compile-testing > it. Right, I am surprised as well, since I explicitly did boot testing on the tree-wide refactor, though I admit the most recent validation over the last few weeks has been on the compile testing side due to tracking down type mismatches. FWIW, I have now been able to reproduce the objtool warning, though, using Fedora 42's Clang 20. I'm frustrated that it didn't show with the other builds I did, and that 0day never sent a single email about it over the weeks that I've had my tree up for testing. -Kees -- Kees Cook