From: Cyrill Gorcunov <gorcunov@gmail.com>
To: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
Cc: Andrew Morton <akpm@linux-foundation.org>,
npiggin@suse.de, riel@redhat.com, penberg@cs.helsinki.fi,
linux-kernel@vger.kernel.org, jirislaby@gmail.com
Subject: Re: [PATCH] mm: __nr_to_section - make it safe against overflow v2
Date: Tue, 6 Jan 2009 10:49:28 +0300 [thread overview]
Message-ID: <20090106074928.GA7671@localhost> (raw)
In-Reply-To: <20090106153036.1263b5ab.kamezawa.hiroyu@jp.fujitsu.com>
[KAMEZAWA Hiroyuki - Tue, Jan 06, 2009 at 03:30:36PM +0900]
| On Tue, 6 Jan 2009 14:57:41 +0900
| KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com> wrote:
|
| > On Mon, 5 Jan 2009 16:37:42 -0800
| > Andrew Morton <akpm@linux-foundation.org> wrote:
| >
| > > On Mon, 5 Jan 2009 13:31:32 +0300
| > > Cyrill Gorcunov <gorcunov@gmail.com> wrote:
| > >
| > > > __nr_to_section should check for array bound overflow.
| > > > We should better get NULL dereference then silently
| > > > pass some memory snippet out of bounds to a caller.
| > > >
| > >
| > > Are there actually any known problems here?
| > >
| >
| > IIRC, I never saw any problem. (But I may see in memory-hotplug development.)
|
| I digged mails and seems this patch is from this thread.
|
| =
| http://lkml.org/lkml/2009/1/4/61
| =
|
| He seems to want to hunt boot time failure.
| (Finally, BIOS-update was necessary for original problem of this thread.)
|
| Cyrill, could you modify this WARN_ON() works works when __nr_to_section()
| is called directly by sparse.c and memhotplug.c ?
|
| Adding WARN_ON() in pfn_to_page() is overkill.
|
| Thanks,
| -Kame
|
Thanks for review Kame, this patch should be just dropped.
Actually the only code snippet which make me nervious is
sizeof (mem_section) part. Which is to remain power of
two and even doesn't have 'packed' attribute neither any
comments above. And if it happens that it will be modified
or say gcc decide to add some bytes here (bugs happens) we
would silently address wrong mem_section. So I think at least
the 'comment' part of my patch is deserve to be applied :)
- Cyrill -
next prev parent reply other threads:[~2009-01-06 7:49 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-01-05 10:31 [PATCH] mm: __nr_to_section - make it safe against overflow v2 Cyrill Gorcunov
2009-01-05 10:33 ` Pekka Enberg
2009-01-06 0:37 ` Andrew Morton
2009-01-06 5:57 ` KAMEZAWA Hiroyuki
2009-01-06 6:30 ` KAMEZAWA Hiroyuki
2009-01-06 7:49 ` Cyrill Gorcunov [this message]
2009-01-06 9:46 ` Cyrill Gorcunov
2009-01-06 10:51 ` Pekka Enberg
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=20090106074928.GA7671@localhost \
--to=gorcunov@gmail.com \
--cc=akpm@linux-foundation.org \
--cc=jirislaby@gmail.com \
--cc=kamezawa.hiroyu@jp.fujitsu.com \
--cc=linux-kernel@vger.kernel.org \
--cc=npiggin@suse.de \
--cc=penberg@cs.helsinki.fi \
--cc=riel@redhat.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