NX (No eXecute) support for x86, 2.6.7-rc2-bk2
A message that is not in the archive (sent off-list or not yet received): [email protected]
A message that is not in the archive (sent off-list or not yet received): [email protected]
A message that is not in the archive (sent off-list or not yet received): [email protected]
Quoted 10 lines · Ingo Molnar
Quoted 4 lines · Rusty Russell
You want to replace the arch-specific
module_alloc()function for this. Or even better, reset the NX bit only on executable sections (in the arch-specificmodule_finalize(), usingmod->core_text_sizeandmod->init_text_size). No generic changes necessary.this reminds me of another issue:
x86_64currently seems to manually map the whole module viaPAGE_KERNEL_EXEC. Andi, we could change it to usevmalloc_exec(), right?
Nope, the manual map is needed. On x86-64 kernels are linked in the "kernel" code model and the modules must be within 2GB of the main kernel text. vmalloc space is elsewhere.
To fix this you would need to link the modules with -fPIC and add a full dynamic linker to the module loader, which would probably not be worth the effort.
-Andi