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] [thread-next>] [day] [month] [year] [list]
Message-ID: <a9bea6ae-27b1-468d-b895-f65189658abe@icloud.com>
Date: Sat, 12 Apr 2025 00:06:38 +0800
From: Zijun Hu <zijun_hu@...oud.com>
To: David Howells <dhowells@...hat.com>
Cc: Alexander Viro <viro@...iv.linux.org.uk>,
 Christian Brauner <brauner@...nel.org>, Jan Kara <jack@...e.cz>,
 linux-fsdevel@...r.kernel.org, linux-kernel@...r.kernel.org,
 Zijun Hu <quic_zijuhu@...cinc.com>
Subject: Re: [PATCH 1/5] fs/filesystems: Fix potential unsigned integer
 underflow in fs_name()

On 2025/4/11 23:34, David Howells wrote:
>> Fix by breaking the for loop when '@...ex == 0' which is also more proper
>> than '@...ex <= 0' for unsigned integer comparison.
> There isn't really a risk.  The list walked by "tmp" and the checks that this
> is or is not NULL will prevent a problem.
> 

no fixes tag is added and just improve code logic a bit since there is
no reason to continue the loop when @index reach 0.

> I also feel that breaking out of the loop with "<= 0" - even if the variable
> is unsigned - is safer, on the off chance that someone in the future changes
> the signedness of the variable.

for parameter @index representing filesystem index. unsigned integer
type may be better than signed.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ