4 ms·
If your claim is that OpenBSD routes every call to malloc/free through mmap/munmap, it is simply not believable. Do you have a URL to a git ... hahaha, pardon
by kazinator 11y ago
If your claim is that OpenBSD routes every call to malloc/free through mmap/munmap, it is simply not believable.
Do you have a URL to a git ... hahaha, pardon me, CVS repo?
- kayamon 11y agoWell you could read the paper he just linked to.
- marios 11y agohttp://bxr.su/OpenBSD/lib/libc/stdlib/malloc.c#omalloc http://bxr.su/OpenBSD/lib/libc/stdlib/malloc.c#omalloc ^Not the CVS repo, but close enough for those who want to check OpenBSD's malloc implementation. The malloc.conf manpage is also an interesting read : http://www.openbsd.org/cgi-bin/man.cgi/OpenBSD-current/man5/malloc.conf.5 http://www.openbsd.org/cgi-bin/man.cgi/OpenBSD-current/man5/... And some context around malloc and the various techniques OpenBSD implements to make exploitation of bugs more difficult: http://www.openbsd.org/papers/dev-sw-hostile-env.html http://www.openbsd.org/papers/dev-sw-hostile-env.html The tl;dr is : if your code compiles and runs on OpenBSD, chances are it will fine on other Unices. The opposite is not necessarily true though.
- icebraining 11y agoHere's the CVS repo: http://cvsweb.openbsd.org/cgi-bin/cvsweb/src/lib/libc/stdlib/malloc.c?rev=1.174&content-type=text/x-cvsweb-markup http://cvsweb.openbsd.org/cgi-bin/cvsweb/src/lib/libc/stdlib...
- comex 11y agoI don't think that source refutes the parent's point: only large allocations go directly to mmap/munmap as opposed to being cached. Of course, there are other anti-exploitation measures too...