Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.compilers > #991
| From | Alex McDonald <blog@rivadpm.com> |
|---|---|
| Newsgroups | comp.compilers |
| Subject | Re: Executing from dynamically allocated memory |
| Date | 2013-10-12 11:12 -0700 |
| Organization | Compilers Central |
| Message-ID | <13-10-008@comp.compilers> (permalink) |
| References | <13-10-004@comp.compilers> |
On Saturday, 12 October 2013 01:05:39 UTC+1, news wrote: > In the past, I've malloc'd memory, written machine instructions into it, > and called the function I built there. > All this on a 32-bit intel instruction set, on a Debian system. ... > Now it was a year or three ago that this worked. Has Linux changed in > this respect? Is there something new I have to do to allocate executable > writable memory for this purpose? > > Or might there be something even weirder going on? > [ Sounds like the NX bit. See http://en.wikipedia.org/wiki/NX_bit#Linux -John] mprotect(2) - Linux man page Name mprotect - set protection on a region of memory Synopsis #include <sys/mman.h> int mprotect(void *addr, size_t len, int prot); Description mprotect() changes protection for the calling process's memory page(s) containing any part of the address range in the interval [addr, addr+len-1]. addr must be aligned to a page boundary. If the calling process tries to access memory in a manner that violates the protection, then the kernel generates a SIGSEGV signal for the process. prot is either PROT_NONE or a bitwise-or of the other values in the following list: ... PROT_EXEC The memory can be executed. ...
Back to comp.compilers | Previous | Next — Previous in thread | Next in thread | Find similar
Executing from dynamically allocated memory "news" <news@fx32.iad.highwinds-media.com> - 2013-10-12 00:05 +0000 Re: Executing from dynamically allocated memory "James Harris" <james.harris.1@gmail.com> - 2013-10-12 10:10 +0100 Re: Executing from dynamically allocated memory Sébastien Fricker <sebastien.fricker@gmail.com> - 2013-10-12 11:52 +0200 Re: Executing from dynamically allocated memory chakaram@auth.gr - 2013-10-12 19:20 +0300 Re: Executing from dynamically allocated memory Alex McDonald <blog@rivadpm.com> - 2013-10-12 11:12 -0700 Re: Executing from dynamically allocated memory sandmann@cs.au.dk (Søren Sandmann) - 2013-10-12 20:58 +0200 Re: Executing from dynamically allocated memory Jens Kallup <jkallup@web.de> - 2013-10-13 10:44 +0200
csiph-web