[PATCH[ Export __PAGE_KERNEL_EXEC for modules (vmmon)
Hello Ingo,
recently support for NX on i386 arrived to 2.6.x kernel, and I have
some problems building code which uses vmap since then - PAGE_KERNEL_EXEC expands to __PAGE_KERNEL_EXEC, and this one is not accessible to modules.
Or should I just use __pgprot(__PAGE_KERNEL & ~_PAGE_NX) or__pgprot(_PAGE_KERNEL_EXEC) instead as pgprot argument to vmap?
Thanks,
Petr Vandrovec
arch/i386/kernel/i386_ksyms.c +1 -0
@@ -179,6 +179,7 @@#endif EXPORT_SYMBOL (__PAGE_KERNEL); +EXPORT_SYMBOL (__PAGE_KERNEL_EXEC);#ifdef CONFIG_HIGHMEM EXPORT_SYMBOL (kmap);
Quoted 3 lines · Petr Vandrovec
Hello Ingo,
recently support for NX on i386 arrived to 2.6.x kernel, and I have
some problems building code which uses vmap since then -PAGE_KERNEL_EXEC
why are you vmap'ing *executable* kernel memory?
That sounds very wrong.... very very wrong. The module loader needs it, sure, but that's not modular. What on earth are you doing ????
Quoted 8 lines · Arjan van de Ven
Quoted 3 lines · Petr Vandrovec
Hello Ingo,
recently support for NX on i386 arrived to 2.6.x kernel, and I have
some problems building code which uses vmap since then -PAGE_KERNEL_EXECwhy are you vmap'ing *executable* kernel memory?
That sounds very wrong.... very very wrong. The module loader needs it, sure, but that's not modular. What on earth are you doing ????
Due to rule that not everything should be in kernel, userspace picks one of codes needed to switch processor from currently used mode & address space to mode VMware needs (ia32 => long, long => ia32, PAE <=> non-PAE + cr3 + gdt + idt) maps it into kernel space, and then run it as needed. And for running it it must be executable.
OK, I think that I understand message. __pgprot(__PAGE_KERNEL & ~_PAGE_NX) is my friend.
Petr Vandrovec
Quoted 7 lines · Petr Vandrovec
????
Due to rule that not everything should be in kernel, userspace picks one of codes needed to switch processor from currently used mode & address space to mode VMware needs (ia32 => long, long => ia32, PAE <=> non-PAE + cr3 + gdt + idt) maps it into kernel space, and then run it as needed. And for running it it must be executable.
so effectively vmware has it's own module loader. quite interesting ;)
Quoted 4 lines · Petr Vandrovec
Hello Ingo,
recently support for NX on i386 arrived to 2.6.x kernel, and I have
some problems building code which uses vmap since then -PAGE_KERNEL_EXECexpands to__PAGE_KERNEL_EXEC, and this one is not accessible to modules.
The right thing is not to mark kernel virtual memory executable from modules at all.