3 ms·
http://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
by marios 11y ago
http://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...