3 ms·
The risk is that you'll screw up and write a buggy allocator with a security hole. Yes, if your program just needs to allocate lots of memory, do some computat
by blt 11y ago
The risk is that you'll screw up and write a buggy allocator with a security hole.
Yes, if your program just needs to allocate lots of memory, do some computations, then exit, this approach works. But the programs where security is most critical do not usually follow that pattern.
- jeffreyrogers 11y agoThe code for this is so simple it would be hard to screw up. Plus you can just use obstacks[1] which pretty much provide the interface I was describing. Look, I'm totally willing to accept that there might be flaws with this approach, but with the exception of adrusi, no one's objections have been all that reasonable. If there are legitimate objections (not just handwavy, oh, you'll probably implement the allocator wrong) I'd love to hear them. I use this pattern in my own code and I'll stop if there are legitimate flaws. Also, Akamai released a patch for the OpenSSL allocator bug mentioned earlier. Guess what the patch used: mmaped regions.[2] [1]: http://www.gnu.org/software/libc/manual/html_node/Obstacks.html http://www.gnu.org/software/libc/manual/html_node/Obstacks.h... [2]: http://thread.gmane.org/gmane.comp.encryption.openssl.user/51243 http://thread.gmane.org/gmane.comp.encryption.openssl.user/5...
- z92 11y agoVery good tip. Thank you. It looks like you are being opposed without a reason. Not everyone is writing encryption software in C.