Re: non-executable stack question



rbtqwt@xxxxxxxxx writes:

Is there a way to make non-executable the stack (or the heap) of a
process without patching the kernel?

On which platform?

On the original x86, there is no separate eXecute bit, so if the
memory is readable, it is also executable. You can make your stack
non-executable by mprotect(2)ing it with no PROT_READ, but your
program will not execute very far past that call :(

OTOH, on x86_64 (and recent Intel x86 processors), a separate
eXecute bit has been introduced, and on these processors you can
make your stack non-executable (with the same mprotect()) if the
kernel hasn't done that already.

Cheers,
--
In order to understand recursion you must first understand recursion.
Remove /-nsp/ for email.
.



Relevant Pages

  • Re: yet another Forth: vmForth
    ... and MidLevel and HLL all Integrated in the Kernel. ... VM assembler and simulator from within the simulator for testing :-) ... higher level Forth constructs, like jz/jnz, lit, execute, call and jump. ... Compiles VM assembler mnemonics into the VM memory. ...
    (comp.lang.forth)
  • Re: [Full-Disclosure] Linux Exec Shield (was: Linux (in)security)
    ... > Speaking about kernel hardening, I was wondering if anyone on the list could ... > comment on Ingo Molnar's Exec Shield Linux kernel patches. ... Linux kernel you can execute any data inside a process's memory or overwrite ... From a security point of view ...
    (Full-Disclosure)
  • Re: Hibernation considerations
    ... ACPI calls needed in the second and third cases above? ... be done from within a kexec'd hibernation kernel. ... * execute the _PTS global control method ...
    (Linux-Kernel)
  • Re: [PATCH 0/2] add new notifier function ,take3
    ... panic so that remote node can initiate failover ... job harder as one needs to pass all the required data to second kernel. ... So it will not left to user whether he should execute the code after ... Things should be more reliable in second kernel. ...
    (Linux-Kernel)
  • Re: 5.2-CURRENT: ldd /boot/kernel/kernel generates signal 6 (ABRT) ?
    ... The kernel actually has a bogus loader, /red/herring, ... The kernel ELF image activator sees this and tries to execute ... Usually invalid binaries won't have a correct ELF header and will error ...
    (freebsd-current)