From: Christoph Lameter <cl@linux-foundation.org>
To: Cyrill Gorcunov <gorcunov@gmail.com>
Cc: Andrew Morton <akpm@linux-foundation.org>,
Nick Piggin <npiggin@suse.de>, Rik van Riel <riel@redhat.com>,
LKML <linux-kernel@vger.kernel.org>,
Jiri Slaby <jirislaby@gmail.com>
Subject: Re: [PATCH] mm: __nr_to_section - make it safe against overflow
Date: Mon, 5 Jan 2009 09:37:36 -0600 (CST) [thread overview]
Message-ID: <Pine.LNX.4.64.0901050935120.13628@quilx.com> (raw)
In-Reply-To: <20090105152848.GG7645@localhost>
On Mon, 5 Jan 2009, Cyrill Gorcunov wrote:
> yes, I know, that is why I've changed WARN_ON_ONCE to plain WARN_ON.
This is still going to create a gazillion of checks in the code because it
will be expanded numerous times.
> | I would think that the code does not have the tests because of performance
> | and code size concerns. Can we just say that a sane nr must be passed to
> | __nr_section?
> |
>
> If you mean did I test this patch for speed regresson then to be fair --
> no, I didn't. BUT we have a number of macros wich are self protective
> like present_section which is used havily too. On the other hand --
> bad argument passed to __nr_to_section will be (and it is now) really
> harmfull -- since it would allow to reference a memory outside the
> valid bounds. The second -- SECTION_ROOT_MASK wich is fragile, any
> attempt to modify mem_section structure will silently lead to insane
> referencing, that is why it deserve a comment on top of structure.
>
> Don't know Christoph, if it really that important to not spend a few
> cycles here in a sake of safety -- we could easily drop this patch.
The problem is that these few cycles aggregate. Both because these inline
primitives are frequently used and because developers add more of these
checks over time.
prev parent reply other threads:[~2009-01-05 15:40 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-01-05 9:40 Cyrill Gorcunov
2009-01-05 10:00 ` Pekka Enberg
2009-01-05 10:03 ` Cyrill Gorcunov
2009-01-05 10:01 ` Cyrill Gorcunov
2009-01-05 15:10 ` Christoph Lameter
2009-01-05 15:28 ` Cyrill Gorcunov
2009-01-05 15:34 ` Nick Piggin
2009-01-05 16:12 ` Cyrill Gorcunov
2009-01-05 15:37 ` Christoph Lameter [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=Pine.LNX.4.64.0901050935120.13628@quilx.com \
--to=cl@linux-foundation.org \
--cc=akpm@linux-foundation.org \
--cc=gorcunov@gmail.com \
--cc=jirislaby@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=npiggin@suse.de \
--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
all inboxes | Powered by JetHome®