chicken-hackers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Chicken-hackers] mprotect on malloc'ed memory?


From: Elf
Subject: Re: [Chicken-hackers] mprotect on malloc'ed memory?
Date: Mon, 19 Nov 2007 19:16:29 -0800 (PST)


um, if im understading the openbsd pages right, it might work, but it wont necessarily protect only the page. according to POSIX, its not undefined, its
an error to use mprotect on anything but mmapped regions.  at a guess, even
if it does happen to work, you'll be looking at a lifetime of unpredictable
and undebuggable SIGSEGVs.  may i ask the intended purpose of mprotecting
regular memory?

-elf

On Mon, 19 Nov 2007, felix winkelmann wrote:

Hi!

A question to the unix hackers:

Is it legal to call mprotect() on memory allocated via malloc()? (yes, properly
aligned to page boundaries). On Linux it seems to work, but according to
POSIX it is undefined. What about BSD/Mac systems?


cheers,
felix


_______________________________________________
Chicken-hackers mailing list
address@hidden
http://lists.nongnu.org/mailman/listinfo/chicken-hackers





reply via email to

[Prev in Thread] Current Thread [Next in Thread]