lkml.org 
[lkml]   [2009]   [Jul]   [12]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v5] RO/NX protection for loadable kernel modules
On Sun, 12 Jul 2009 14:10:39 +0930
Rusty Russell <rusty@rustcorp.com.au> wrote:

> On Sun, 12 Jul 2009 01:19:58 am Arjan van de Ven wrote:
> > Rusty Russell <rusty@rustcorp.com.au> wrote:
> > > I have a question about this patch though: I think it's unsafe in
> > > general to mark the last partial page as NX (we asked for
> > > executable pages, this could remove executable from some
> > > unrelated allocation).
> >
> > we vmalloc / g_f_p modules right? so we don't share the last page.
>
> Historically yes, but I don't think we should be counting on it. It
> makes sense to kmalloc for small modules, and it's arch specific code.
>
> OTOH, a quick grep shows currently only cris does kmalloc, and that's
> a config option.
>
> It might be time to unify this code. If we rename MODULE_START to
> MODULE_VADDR on MIPS, then ignoring CRIS there's only two real
> variants; vmalloc and __vmalloc.
>
> (I like the idea of trying kmalloc and falling back, simply because
> it reduces TLB pressure, but that's probably best done after
> unification).
>

or using a non-power-of-two get_free_pages() thing...

some architectures will need to know that memory needs to be executable
at allocation time so that it can be put in an executable address range
etc...


\
 
 \ /
  Last update: 2009-07-12 09:47    [W:0.057 / U:1.364 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site