Re: [PATCH] Read only syscall tables for x86_64 and i386

Andi Kleen
2005-06-28T19:37:10Z

Christoph Lameter <christoph@lameter.com> writes:

> Place x86_64 and i386 syscall table into the read only section.
>
> Remove the syscall tables from the data section and place them into the
> readonly section (like IA64).

It's unfortunately useless because all the kernel is mapped in the
same 2 or 4MB page has to be writable because it overlaps with real
direct mapped memory.

On x86-64 there is a separate kernel mapping which could be made
read only. But that would be useless again because the memory
is aliased in the real direct mapping which has the same
overlapping problem.

The only way to write protect the kernel would be to pad
it to 2MB (or 4MB on i386/non PAE) which would be a big waste
of memory or use significantly more TLB entries in normal
operation.

Both is probably not worth the modest safety increase you
get from such a change.

-Andi