* [PATCH] tile: array underflow in setup_maxnodemem()
@ 2017-07-22 7:33 Dan Carpenter
2017-07-24 15:25 ` Chris Metcalf
0 siblings, 1 reply; 2+ messages in thread
From: Dan Carpenter @ 2017-07-22 7:33 UTC (permalink / raw)
To: Chris Metcalf; +Cc: linux-kernel, kernel-janitors
My static checker correctly complains that we should have a lower bound
on "node" to prevent an array underflow.
Fixes: 867e359b97c9 ("arch/tile: core support for Tilera 32-bit chips.")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
diff --git a/arch/tile/kernel/setup.c b/arch/tile/kernel/setup.c
index 443a70bccc1c..b1474e7d9afb 100644
--- a/arch/tile/kernel/setup.c
+++ b/arch/tile/kernel/setup.c
@@ -140,7 +140,7 @@ static int __init setup_maxnodemem(char *str)
{
char *endp;
unsigned long long maxnodemem;
- long node;
+ unsigned long node;
node = str ? simple_strtoul(str, &endp, 0) : INT_MAX;
if (node >= MAX_NUMNODES || *endp != ':')
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] tile: array underflow in setup_maxnodemem()
2017-07-22 7:33 [PATCH] tile: array underflow in setup_maxnodemem() Dan Carpenter
@ 2017-07-24 15:25 ` Chris Metcalf
0 siblings, 0 replies; 2+ messages in thread
From: Chris Metcalf @ 2017-07-24 15:25 UTC (permalink / raw)
To: Dan Carpenter; +Cc: linux-kernel, kernel-janitors
On 7/22/2017 3:33 AM, Dan Carpenter wrote:
> My static checker correctly complains that we should have a lower bound
> on "node" to prevent an array underflow.
>
> Fixes: 867e359b97c9 ("arch/tile: core support for Tilera 32-bit chips.")
> Signed-off-by: Dan Carpenter<dan.carpenter@oracle.com>
Thanks, taken into the tile tree.
--
Chris Metcalf, Mellanox Technologies
http://www.mellanox.com
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2017-07-24 15:25 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-07-22 7:33 [PATCH] tile: array underflow in setup_maxnodemem() Dan Carpenter
2017-07-24 15:25 ` Chris Metcalf
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox