[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <4F97A4B6.3010305@kernel.org>
Date: Wed, 25 Apr 2012 16:16:06 +0900
From: Minchan Kim <minchan@...nel.org>
To: Peter Teoh <htmldeveloper@...il.com>
CC: LKML <linux-kernel@...r.kernel.org>,
Minchan Kim <minchan.kim@...il.com>
Subject: Re: A potential bug in mm/memblock.c?
On 04/25/2012 03:27 PM, Peter Teoh wrote:
> Comments please. Thanks.
barrios@...x:~/linux-next$ ./scripts/get_maintainer.pl -f mm/memblock.c
Tejun Heo <tj@...nel.org> (commit_signer:32/36=89%)
"H. Peter Anvin" <hpa@...ux.intel.com> (commit_signer:15/36=42%)
Andrew Morton <akpm@...ux-foundation.org> (commit_signer:4/36=11%)
Ingo Molnar <mingo@...e.hu> (commit_signer:2/36=6%)
linux-mm@...ck.org (open list:MEMORY MANAGEMENT)
linux-kernel@...r.kernel.org (open list)
Please Cced them and write down the description which should include
problem and how to fix. And it would be better to use more clear subject.
[BUG]memblock: fix overflow of array index
Anyway,
Reviewed-by: Minchan Kim <minchan@...nel.org>
>
> Signed-off-by: Peter Teoh <htmldeveloper@...il.com>
>
> diff --git a/mm/memblock.c b/mm/memblock.c
> index a44eab3..2c621c5 100644
> --- a/mm/memblock.c
> +++ b/mm/memblock.c
> @@ -553,8 +553,8 @@ void __init_memblock __next_free_mem_range(u64
> *idx, int nid,
> {
> struct memblock_type *mem = &memblock.memory;
> struct memblock_type *rsv = &memblock.reserved;
> - int mi = *idx & 0xffffffff;
> - int ri = *idx >> 32;
> + unsigned int mi = *idx & 0xffffffff;
> + unsigned int ri = *idx >> 32;
>
> for ( ; mi < mem->cnt; mi++) {
> struct memblock_region *m = &mem->regions[mi];
>
>
>
--
Kind regards,
Minchan Kim
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists