Conversation

I'm not sure how enthusiastic I am about replacing my downstream Clang -fsanitize=local-init option with the upstream -ftrivial-auto-var-init=zero -enable-trivial-auto-var-init-zero-knowing-it-will-be-removed-from-clang. Yes, that's literally what you need to pass to enable this.
1
11
I'm not using zero for performance. I explain the choice in github.com/GrapheneOS/har as "Zero-based filling has the least chance of uncovering latent bugs, but also the best chance of mitigating vulnerabilities.". Uncovering bugs also isn't necessarily good for this use case.
1
on 64-bit platforms, repeated 0xAA have that property. However, repeated 0xAA is a pretty large size index, zero isn't. But! In a context like a kernel zero is often a valid pointer sentinel... So what the "right" choice is was pretty hard to agree, and all that was left was perf
1
It has that property for 64-bit pointers, but not 32-bit pointers. In a 32-bit process on a 64-bit OS, the entire 32-bit address space is usually accessible. As another common example, the standard Android Runtime uses 32-bit pointers for the managed heaps to reduce memory usage.
1
Show replies