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: <49b686e0-6fa3-4e60-a007-51c1fa675f2d@nfschina.com>
Date: Fri, 30 May 2025 18:42:40 +0800
From: Su Hui <suhui@...china.com>
To: David Howells <dhowells@...hat.com>
Cc: marc.dionne@...istor.com, linux-afs@...ts.infradead.org,
 linux-kernel@...r.kernel.org, kernel-janitors@...r.kernel.org
Subject: Re: [PATCH] afs: Replace simple_strtoul with kstrtoul in
 afs_parse_address


On 5/30/25 5:32 PM, David Howells wrote:
> Su Hui <suhui@...china.com> wrote:
>
>> kstrtoul() is better because simple_strtoul() ignores overflow which
>> may lead to unexpected results.
> Overflow in what sense?  Are we talking about a mathematical overflow or not
> checking the text beyond the end of the number?

IMO, It's meaning that  the number represented by the string exceeds the 
type range. Like this code:

const char str[] = "0xffffffffffffffff0000000000000001";
unsigned long res;
res = simple_strtoul(str, &p, 0); //overflow happends and  res = 0x1
err = kstrtoul(str, 0, &res); // overflow happends and res = 0x1,  err = 
-ERANGE

Su Hui


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ