Re:Glibc getaddrinfo stack-based buffer overflow
by minimax on Tuesday February 16, 2016 @06:39PM
(#11114001)
I think the other thing that changed is that branch predictors are roughly infinitely times better than they were in 1980. The is-this-subscript-ok check should be easily predictable and I wonder if these checks even cost anything in a hot loop on a modern CPU.
Re:Glibc getaddrinfo stack-based buffer overflow
by pjmlp on Wednesday February 17, 2016 @02:22AM
(#11115974)
After Z80 and Sinclair Basic, my next languages were GW-Basic, Turbo Basic and Turbo Pascal, followed by many others.
The Borland languages like many other that allowed for system programming in those days, allowed for disabling bounds checking, as Borland customers weren't like Hoare ones.
I never felt the need to disable them.
Yes they did had a few ms to the program execution, but nothing that would impact the user experience of the application.
This is one of the biggest problem in our industry, specially among C and its derived languages (C++, Objective-C), to micro-optimize each code line without any sort of measurement how it impacts the final application.
Of course there are cases where it really matters, like HPC, games and such, but those are a tiny portion of the software that gets written every day.
Re:Glibc getaddrinfo stack-based buffer overflow
by kevingadd on Tuesday February 16, 2016 @09:16PM
(#11114722)
They have a measurable cost, and performance-obsessed developers/users hate the cost. But it's a lot smaller than it used to be, and modern compiler/JIT research is yielding ways to safely eliminate/hoist a lot of the checks.
It was already clear in 1961 when Burroughs used Algol and C wasn't even born.
It was clear when Hoare stated on his speech in 1980:
"Many years later we asked our customers whether they wished us to provide an option to switch off these checks in the interests of efficiency on production runs. Unanimously, they urged us not to - they already knew how frequently subscript errors occur on production runs where failure to detect them could be disastrous. I note with fear and horror that even in 1980, language designers and users have not learned this lesson. In any respectable branch of engineering, failure to observe such elementary precautions would have long been against the law."
I can quote lots of other security research papers since computers exist.
But then UNIX workstations took over the computing world, bringing C with them.