Re: x86: map kernel DATA+BSS with NX/XD bit

2015-12-05 Thread Maxime Villard
This actually requires more investigation. I'll see later; perhaps I'll just protect DATA. Le 28/11/2015 19:54, Maxime Villard a écrit : Hi, here is a (draft) patch to map the kernel DATA and BSS segments with the NX/XD bit in the PTEs on i386+amd64. A nice PoC: patch your (amd64) kernel with t

Re: x86: map kernel DATA+BSS with NX/XD bit

2015-11-28 Thread Joerg Sonnenberger
On Sat, Nov 28, 2015 at 07:54:10PM +0100, Maxime Villard wrote: > here is a (draft) patch to map the kernel DATA and BSS segments with > the NX/XD bit in the PTEs on i386+amd64. There should be no need to force extra padding between .data and .bss. Joerg

Re: x86: map kernel DATA+BSS with NX/XD bit

2015-11-28 Thread Jonathan A. Kollasch
On Sat, Nov 28, 2015 at 07:54:10PM +0100, Maxime Villard wrote: > Hi, > here is a (draft) patch to map the kernel DATA and BSS segments with > the NX/XD bit in the PTEs on i386+amd64. Pretty sure this won't work on i386. You have to have PAE enabled before you can use NX/XD in the MMU. AFAIK i38

x86: map kernel DATA+BSS with NX/XD bit

2015-11-28 Thread Maxime Villard
Hi, here is a (draft) patch to map the kernel DATA and BSS segments with the NX/XD bit in the PTEs on i386+amd64. A nice PoC: patch your (amd64) kernel with the shellcode below, and launch this: #include #include #include int main() { sched_getp