lkml.org 
[lkml]   [2011]   [Feb]   [2]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] NX protection for kernel data : fix 32 bits S3 suspend

* castet.matthieu@free.fr <castet.matthieu@free.fr> wrote:

> Quoting Ingo Molnar <mingo@elte.hu>:
>
> >
> > * matthieu castet <castet.matthieu@free.fr> wrote:
> >
> > > static inline int is_kernel_text(unsigned long addr)
> > > {
> > > +#if defined(CONFIG_X86_32) && defined(CONFIG_ACPI_SLEEP)
> > > + /*
> > > + * We need to make the wakeup trampoline in first 1MB !NX
> > > + */
> > > + if (addr >= PAGE_OFFSET && addr <= (PAGE_OFFSET + (1<<20)))
> > > + return 1;
> > > +#endif
> >
> > That's pretty ugly. Why not use set_memory_x()/set_memory_nx(), and only for
> > the
> > trampoline itself? Does the whole 1MB need to be marked X?
>
> The previous code was doing that.

So why not call set_memory_x() in your patch? Mind trying that?

Thanks,

Ingo


\
 
 \ /
  Last update: 2011-02-02 07:29    [W:0.092 / U:0.112 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site