From: Jeff Garzik <jgarzik@pobox.com>
To: Rusty Russell <rusty@rustcorp.com.au>
Cc: Ingo Molnar <mingo@elte.hu>,
lkml - Kernel Mailing List <linux-kernel@vger.kernel.org>,
Andrew Morton <akpm@osdl.org>, Andi Kleen <ak@suse.de>,
Linus Torvalds <torvalds@osdl.org>,
Arjan van de Ven <arjanv@redhat.com>,
"Siddha, Suresh B" <suresh.b.siddha@intel.com>,
"Nakajima, Jun" <jun.nakajima@intel.com>
Subject: Re: [announce] [patch] NX (No eXecute) support for x86, 2.6.7-rc2-bk2
Date: Wed, 02 Jun 2004 20:17:14 -0400 [thread overview]
Message-ID: <40BE6E0A.9050403@pobox.com> (raw)
In-Reply-To: <1086221461.29390.327.camel@bach>
Rusty Russell wrote:
> On Thu, 2004-06-03 at 06:50, Ingo Molnar wrote:
>
>>furthermore, the patch also implements 'NX protection' for kernelspace
>>code: only the kernel code and modules are executable - so even
>
>
> No, actually, it doesn't quite do that:
>
> --- linux/kernel/module.c.orig
> +++ linux/kernel/module.c
> @@ -1431,7 +1431,7 @@ static struct module *load_module(void _
>
> /* Suck in entire file: we'll want most of it. */
> /* vmalloc barfs on "unusual" numbers. Check here */
> - if (len > 64 * 1024 * 1024 || (hdr = vmalloc(len)) == NULL)
> + if (len > 64 * 1024 * 1024 || (hdr = vmalloc_exec(len)) == NULL)
> return ERR_PTR(-ENOMEM);
> if (copy_from_user(hdr, umod, len) != 0) {
> err = -EFAULT;
>
> This is where we such the module file into kernel memory to parse it,
> not where we actually copy the memory.
>
> You want to replace the arch-specific module_alloc() function for this.
> Or even better, reset the NX bit only on executable sections (in the
> arch-specific module_finalize(), using mod->core_text_size and
> mod->init_text_size). No generic changes necessary.
>
> What surprises me is that this error didn't cause your kernel to explode
> the moment you inserted a module containing a function...
bah, modules are for lame people who don't want to squeeze that last
%0.00001 of additional performance out of their kernel by reducing TLB
and I-cache misses...
Jeff
next prev parent reply other threads:[~2004-06-03 0:17 UTC|newest]
Thread overview: 66+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-06-02 20:50 [announce] [patch] NX (No eXecute) support for x86, 2.6.7-rc2-bk2 Ingo Molnar
2004-06-02 21:00 ` Christoph Hellwig
2004-06-02 21:07 ` Ingo Molnar
2004-06-02 21:13 ` Linus Torvalds
2004-06-02 21:17 ` Arjan van de Ven
2004-06-02 21:31 ` Doug McNaught
2004-06-08 8:46 ` Jakub Jelinek
2004-06-03 1:12 ` Joel Becker
2004-06-03 1:27 ` Andi Kleen
2004-06-03 6:24 ` Arjan van de Ven
2004-06-03 20:37 ` jlnance
2004-06-03 7:21 ` Ingo Molnar
2004-06-03 12:44 ` Ingo Molnar
2004-06-03 15:54 ` Andi Kleen
2004-06-03 23:01 ` Andy Lutomirski
2004-06-03 23:08 ` Andi Kleen
2004-06-03 23:54 ` Andy Lutomirski
2004-06-04 0:05 ` Andy Lutomirski
2004-06-04 9:25 ` Ingo Molnar
2004-06-04 15:26 ` Andy Lutomirski
2004-06-04 15:36 ` Linus Torvalds
2004-06-04 15:41 ` Arjan van de Ven
2004-06-04 15:47 ` Linus Torvalds
2004-06-04 15:51 ` Arjan van de Ven
2004-06-04 16:02 ` Linus Torvalds
2004-06-04 16:13 ` Andi Kleen
2004-06-04 16:37 ` Arjan van de Ven
2004-06-04 16:40 ` Christoph Hellwig
2004-06-04 17:27 ` David Mosberger
2004-06-04 17:30 ` Andi Kleen
2004-06-08 9:07 ` Jakub Jelinek
2004-06-08 9:14 ` Andi Kleen
2004-06-08 9:19 ` Arjan van de Ven
2004-06-04 16:51 ` Ulrich Drepper
2004-06-08 17:15 ` Bill Davidsen
2004-06-04 18:11 ` Gerhard Mack
2004-06-04 18:12 ` Arjan van de Ven
2004-06-04 16:06 ` Ingo Molnar
2004-06-04 17:20 ` Ingo Molnar
2004-06-04 17:22 ` Ingo Molnar
2004-06-04 17:32 ` Ingo Molnar
2004-06-03 19:24 ` Suresh Siddha
2004-06-03 20:37 ` Andi Kleen
2004-06-03 22:58 ` Suresh Siddha
2004-06-03 23:06 ` Andi Kleen
2004-06-04 9:30 ` Ingo Molnar
2004-06-03 12:57 ` Brian Gerst
2004-06-04 9:39 ` Ingo Molnar
2004-06-04 10:41 ` Christoph Hellwig
2004-06-04 10:48 ` William Lee Irwin III
2004-06-03 16:21 ` Ulrich Drepper
2004-06-03 19:30 ` Kurt Garloff
2004-06-02 21:43 ` Andi Kleen
2004-06-03 0:11 ` Rusty Russell
2004-06-03 0:17 ` Jeff Garzik [this message]
2004-06-03 7:24 ` Ingo Molnar
2004-06-03 8:47 ` Ingo Molnar
2004-06-03 8:53 ` Ingo Molnar
2004-06-04 0:04 ` Rusty Russell
2004-06-03 9:07 ` Ingo Molnar
2004-06-03 14:36 ` Gerhard Mack
2004-06-03 16:22 ` Arjan van de Ven
2004-06-04 9:36 ` Ingo Molnar
2004-06-04 11:59 ` Stephen Wille Padnos
[not found] <22L0f-5Ci-11@gated-at.bofh.it>
[not found] ` <22O7J-8dw-11@gated-at.bofh.it>
[not found] ` <22Wf4-5Xv-23@gated-at.bofh.it>
2004-06-03 9:43 ` Andi Kleen
-- strict thread matches above, loose matches on Subject: below --
2004-06-04 18:01 Nakajima, Jun
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=40BE6E0A.9050403@pobox.com \
--to=jgarzik@pobox.com \
--cc=ak@suse.de \
--cc=akpm@osdl.org \
--cc=arjanv@redhat.com \
--cc=jun.nakajima@intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@elte.hu \
--cc=rusty@rustcorp.com.au \
--cc=suresh.b.siddha@intel.com \
--cc=torvalds@osdl.org \
/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