Re: [PATCH] x86 : Add NX protection for kernel data on 64 bit

From: H. Peter Anvin
Date: Mon Mar 14 2011 - 19:05:34 EST


On 03/13/2011 11:37 AM, matthieu castet wrote:
> Cpu hotplug code read data in head_64.S (phys_base) before enabling NX, so when
> we enable NX on data, an triple fault happen because a reserved bit is set.
> It was fixed by allocating dedicated page table for ident mapping in trampoline.
> Now data can be protected by NX.
>
> The Low kernel Mapping is also set to NX.
>
> Finaly we preserve large page mapping by applying nx in free_init_pages only
> when we switch to NX mode

The right way to do this is to have initial_page_table and keep it
around, just as we already do on 32 bits... yet another thing that can
be merged instead of coming up with a separate solution.

-hpa
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/