Re: Understanding Linux addr space, malloc, and heap

From: Vincent W. Freeh
Date: Fri Oct 21 2005 - 11:10:59 EST


First, thanks for all the help and attention. I am learning much.

I think the focus of this discussion should be on mprotect. I understand that spec says it only works on mmap'd memory. So does malloc use mmap? If not why does it work at all?

Probably the most problematic issue, tho, is why does mprotect return 0 even though it failed to change permissions on the 66th page?

Kyle Moffett wrote:
On Oct 21, 2005, at 11:37:07, Vincent W. Freeh wrote:
You *cannot* reliably expect to mprotect() the results of malloc(). If you want to mprotect() things, you _must_ do it on mmap()ed memory.

Cheers,
Kyle Moffett

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/