News for hackers. Stuff that matters.
Re:Understanding Integer Overflow in C/C++ (2012) [pdf] by pcwalton on Saturday July 09, 2016 @01:48PM (#12062465)
> Now that memory errors are slowly disappearing, it's integer problems that are becoming the pain-in-the-neck for exploits

What fraction of integer overflow exploits crucially have to be combined with an unsafe memory model in order to be weaponizable? I suspect the number is close to 99%.

(I know there are a handful of overflow-related security problems that are independent of memory safety--someone mentioned money overflow issues in online games when this topic came up last--but they are few and far between.)

> I was quite disappointed when Rust opted to keep the wraparound model.

That's oversimplified. In debug builds, Rust panics on overflow; in release builds, Rust may or may not panic. It doesn't right now out of performance considerations. That is not a decision that is set in stone if the performance becomes acceptable in the future.

Re:Understanding Integer Overflow in C/C++ (2012) [pdf] by marvy on Saturday July 09, 2016 @02:55PM (#12062747)
This means that Rust has experience with wraparound and with panics. So this question should be answerable by someone on the Rust team: how much does the check cost? A few percent? A factor of 2? Surely not more than that?
Re:Understanding Integer Overflow in C/C++ (2012) [pdf] by pcwalton on Saturday July 09, 2016 @04:22PM (#12063136)
Depends. The problem is not so much the overhead of the check itself as that it introduces a lot of control flow edges which interfere with optimizations. For example, on x86 you can kiss most uses of LEA goodbye...
Re:Understanding Integer Overflow in C/C++ (2012) [pdf] by marvy on Saturday July 09, 2016 @08:18PM (#12063968)
Sure, but when all is said and done, what's the cost? There are plenty of Rust benchmarks by now, possibly some of them are part of the test suite. How much do they slow down?
Re:Understanding Integer Overflow in C/C++ (2012) [pdf] by wofo on Saturday July 09, 2016 @06:23PM (#12063625)
Note that it is possible to enable overflow checking in release builds as well.