From: Minchan Kim <minchan@kernel.org>
To: Peter Teoh <htmldeveloper@gmail.com>
Cc: LKML <linux-kernel@vger.kernel.org>, Minchan Kim <minchan.kim@gmail.com>
Subject: Re: A potential bug in mm/memblock.c?
Date: Wed, 25 Apr 2012 16:16:06 +0900 [thread overview]
Message-ID: <4F97A4B6.3010305@kernel.org> (raw)
In-Reply-To: <CAHnt0GWDqsGsj_i1u3aRSMa1ie4EAhS9GN_D=m1jx5gk6nYgwg@mail.gmail.com>
On 04/25/2012 03:27 PM, Peter Teoh wrote:
> Comments please. Thanks.
barrios@bbox:~/linux-next$ ./scripts/get_maintainer.pl -f mm/memblock.c
Tejun Heo <tj@kernel.org> (commit_signer:32/36=89%)
"H. Peter Anvin" <hpa@linux.intel.com> (commit_signer:15/36=42%)
Andrew Morton <akpm@linux-foundation.org> (commit_signer:4/36=11%)
Ingo Molnar <mingo@elte.hu> (commit_signer:2/36=6%)
linux-mm@kvack.org (open list:MEMORY MANAGEMENT)
linux-kernel@vger.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@kernel.org>
>
> Signed-off-by: Peter Teoh <htmldeveloper@gmail.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
prev parent reply other threads:[~2012-04-25 7:15 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-04-25 6:27 A potential bug in mm/memblock.c? Peter Teoh
2012-04-25 7:16 ` Minchan Kim [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4F97A4B6.3010305@kernel.org \
--to=minchan@kernel.org \
--cc=htmldeveloper@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=minchan.kim@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox