The simple_strtoull() function is deprecated in some situation, since
it does not check for the range overflow, use kstrtoull() instead.
Signed-off-by: Chen Huang <redacted>
---
arch/powerpc/kernel/rtas-proc.c | 7 +------
1 file changed, 1 insertion(+), 6 deletions(-)
The simple_strtoull() function is deprecated in some situation, since
it does not check for the range overflow, use kstrtoull() instead.
Signed-off-by: Chen Huang <redacted>
---
drivers/xen/xen-balloon.c | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
The simple_strtoull() function is deprecated in some situation since
it does not check for the range overflow, use kstrtoull() instead.
Signed-off-by: Chen Huang <redacted>
---
fs/ocfs2/cluster/heartbeat.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
From: David Laight <hidden> Date: 2021-05-27 14:10:37
From: Chen Huang
Sent: 26 May 2021 10:20
The simple_strtoull() function is deprecated in some situation, since
it does not check for the range overflow, use kstrtoull() instead.
I'd have thought it was more important to check *endchar
than overflow.
If you are worried about overflow you need a range check
before the multiply.
David
-
Registered Address Lakeside, Bramley Road, Mount Farm, Milton Keynes, MK1 1PT, UK
Registration No: 1397386 (Wales)
From: Dan Carpenter <hidden> Date: 2021-05-27 14:39:44
On Thu, May 27, 2021 at 02:10:21PM +0000, David Laight wrote:
From: Chen Huang
quoted
Sent: 26 May 2021 10:20
The simple_strtoull() function is deprecated in some situation, since
it does not check for the range overflow, use kstrtoull() instead.
I'd have thought it was more important to check *endchar
than overflow.
That's one of the differences between simple_strtoull() and kstrtoull().
The simple_strtoull() will accept a string like "123ABC", but kstrtoull()
will only accept NUL terminated numbers or a newline followed by a NUL
terminator. Which is fine in this context because users will be doing
"echo 1234 > /sys/foo".
If you are worried about overflow you need a range check
before the multiply.
This is probably a case where if the users cause an integer overflow
then they get what they deserve.
regards,
dan carpenter