[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <417e3654-27bf-4fc4-8adb-36ec6010f027@zytor.com>
Date: Tue, 20 Jan 2026 12:24:07 -0800
From: "H. Peter Anvin" <hpa@...or.com>
To: David Desobry <david.desobry@...malgen.com>,
Borislav Petkov <bp@...en8.de>
Cc: tglx@...nel.org, mingo@...hat.com, dave.hansen@...ux.intel.com,
x86@...nel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] x86/lib: Fix num_digits() signed overflow for INT_MIN
On 2026-01-20 12:16, David Desobry wrote:
> I haven't hit this corner case in practice; I was just auditing the code and
> noticed the corner case overflow leading to wrong logic.
> Then in a v2 version I brought some design improvement (switch case).
The switch is a good improvement. I would say, though, that if we don't need
signed input then we should just take out the minus handling code and have the
function take an unsigned int as input.
-hpa
Powered by blists - more mailing lists