News for hackers. Stuff that matters.
Re:Cap'n'Proto remote vuln: pointer overflow check optimized... by Asooka on Friday April 21, 2017 @07:19AM (#14164544)
Maybe. I really want to be writing code for a 2-complement integer CPU with 64-bit registers and a unified memory model, where addresses are unsigned integers and address 0 is NULL. I really, really want a portable-assembly flavour of C which would be machine target-dependent and would e.g. throw an error when compiling a pointer comparison for a machine with a nonuniform memory model, if the pointers cannot be proven to be part of the same object. The current model where parts of my code can just get deleted SILENTLY is really hard to reason about. At least add an -Werror-deleted-code (or -Werror-tautology for code that's tautological due to UB), so I can be alerted if that optimisation is done.
Re:Cap'n'Proto remote vuln: pointer overflow check optimized... by jjnoakes on Friday April 21, 2017 @08:06AM (#14164742)
I think if you had a way to enable warnings about deleted code you would be flooded with warnings from macro expansions, function inlining, template instantiations, and other valid and desirable optimizations.
Re:Cap'n'Proto remote vuln: pointer overflow check optimized... by caf on Friday April 21, 2017 @08:47AM (#14165033)
I don't think it's that hard to reason about.

Checking for overflow (and pointer-out-of-object-bounds, which is a special case of overflow) in C is like defusing a bomb: you can't cut the red wire and then see if it exploded, you have to check that it won't explode before you cut the wire.