lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <34a36725-6efd-43fe-9e23-19b14814b6af@linux.microsoft.com>
Date: Mon, 3 Feb 2025 12:42:36 -0800
From: Easwar Hariharan <eahariha@...ux.microsoft.com>
To: Geert Uytterhoeven <geert@...ux-m68k.org>
Cc: eahariha@...ux.microsoft.com, Jiri Slaby <jirislaby@...nel.org>,
 David Laight <david.laight.linux@...il.com>,
 Thomas Gleixner <tglx@...utronix.de>,
 Anna-Maria Behnsen <anna-maria@...utronix.de>,
 Luiz Augusto von Dentz <luiz.von.dentz@...el.com>,
 Miguel Ojeda <ojeda@...nel.org>, open list <linux-kernel@...r.kernel.org>,
 stable@...r.kernel.org, Andrew Morton <akpm@...ux-foundation.org>,
 kernel test robot <lkp@...el.com>, linux-xfs <linux-xfs@...r.kernel.org>
Subject: Re: [PATCH] jiffies: Cast to unsigned long for secs_to_jiffies()
 conversion

On 1/31/2025 9:55 AM, Easwar Hariharan wrote:
> On 1/31/2025 12:10 AM, Geert Uytterhoeven wrote:

<snip>

>>
>> More importantly, I doubt this change is guaranteed to fix the
>> reported issue.  The code[*] in retry_timeout_seconds_store() does:
>>
>>     int val;
>>     ...
>>     if (val < -1 || val > 86400)
>>             return -EINVAL;
>>     ...
>>     if (val != -1)
>>             ASSERT(secs_to_jiffies(val) < LONG_MAX);
>>
>> As HZ is a known (rather small) constant, and val is range-checked
>> before, the compiler can still devise that the condition is always true.
>> So I think that assertion should just be removed.
>>

Following the lkp instructions to repro the issue, with this patch, the
compiler does not continue reporting that the condition is always true.
This patch is sufficient IMHO, without needing to remove the assert.

- Easwar (he/him)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ