r/programming • • Apr 09 '14
Theo de Raadt: "OpenSSL has exploit mitigation countermeasures to make sure it's exploitable"
[deleted] — view deleted post
2.0k
Upvotes
r/programming • • Apr 09 '14
[deleted] — view deleted post
View all comments
Show parent comment
38
u/wwqlcw Apr 09 '14
Years ago I was maintaining a system that had its roots in the DOS days. Real-mode, segmented addressing.
My predecessor had some genuine difficulties with real mode, there were structures he wanted to keep in RAM that were too big for the segments. That was a genuine issue for many systems at the time.
The easiest solution would have been to be a little more flexible about his memory structures. Another choice might have been to license a commercial memory extender. He opted to instead roll his own version of malloc.
I would not consider myself to be qualified to undertake such a project, but he was if anything less qualified.
I only discovered all of this at the end of an 11 hour debugging session. The reason my memory was becoming corrupt was because of bugs in the allocator itself. By the time I was working on this project, the compiler had better support for large memory structures, and I was able to fix it by deleting his malloc and twiddling some compiler flags.
Lo and behold, a zillion other bugs went away. And the whole system got faster, too.
The trouble is, if you're not cautious enough to be given pause by the notion of implementing memory management yourself, you're almost certainly the kind of person who needs that pause the most.