hi lazyweb, is there a consensus about the best hardened-for-security memory allocation library for C and C++ right now?
-
-
Replying to @johnregehr
malloc=2 mmaps (guard page), free=nop. You might not like the overhead though.
1 reply 0 retweets 1 like -
Replying to @RichFelker @johnregehr
I take John's question to be “without instrumenting accesses”, & then, shouldn't free() be munmap()? (w/o ever reusing addresses, of course)
1 reply 0 retweets 1 like -
Replying to @volatile_void @johnregehr
munmap & not reusing are mutually exclusive. Could mprotect PROT_NONE.
1 reply 0 retweets 2 likes -
Replying to @RichFelker @johnregehr
I had assume you were mmapping at addresses of your choosing, keeping track of addresses in use yourself, able to choose not to reuse.
1 reply 0 retweets 0 likes -
I now see you literally meant “two mmap calls for malloc” and nothing more.
1 reply 0 retweets 0 likes -
Which is simpler, if you are sure mmap doesn't place all the guard pages conveniently together at the end of the address space?
1 reply 0 retweets 0 likes -
Replying to @volatile_void @johnregehr
I meant the first one for the full range with guard and the second MAP_FIXED over top of the beginning for the usable space.
1 reply 0 retweets 1 like
But mprotect would probably work just as well for making the usable space.
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.