Re: [PATCH 1/1] time/jiffies: Fix conversion breakage on systems where USER_HZ < HZ
From: Joel Granados
Date: Fri Feb 27 2026 - 10:08:01 EST
On Wed, Feb 25, 2026 at 03:37:49PM -0800, Gerd Rausch wrote:
> Conversion from user_hz to jiffies broke with
> commit 2dc164a48e6fd ("sysctl: Create converter functions with two new macros")
>
> because the old overflow check in do_proc_dointvec_userhz_jiffies_conv()
> to see if "*u_ptr" was too large got replaced by an unconditional:
> + if (USER_HZ < HZ)
> + return -EINVAL;
>
> which will always be true on platforms with "USER_HZ < HZ".
>
> We shouldn't need this extra check anyway, because clock_t_to_jiffies()
> returns ULONG_MAX for the overflow case:
> if (x >= ~0UL / (HZ / USER_HZ))
> return ~0UL;
>
> and proc_int_u2k_conv_uop() checks for "> INT_MAX" after conversion:
> if (u > (ulong) INT_MAX)
> return -EINVAL;
>
> Fixes: 2dc164a48e6fd ("sysctl: Create converter functions with two new macros")
> Reported-by: Colm Harrington <colm.harrington@xxxxxxxxxx>
> Signed-off-by: Gerd Rausch <gerd.rausch@xxxxxxxxxx>
I changed the message of the patch a bit. You can take a look here [1]
Best
[1] https://git.kernel.org/pub/scm/linux/kernel/git/sysctl/sysctl.git/commit/?h=sysctl-next&id=a17a86da1c90b62866bf2f45560510f2f6f18503
--
Joel Granados
Attachment:
signature.asc
Description: PGP signature