Enable Clang C++ buffer hardening when it is available
Categories
(Firefox Build System :: Toolchains, enhancement)
Tracking
(Not tracked)
People
(Reporter: mccr8, Unassigned)
References
Details
(Keywords: sec-want)
Google has a blog post from about a month ago about some work they have done related to some kind of C++ buffer hardening, which will be available behind a compile flag in libc++ 18.0.0. This adds release mode bounds checking to some standard container data structures like std::array, std::vector, and std::span. It would be good if we could enable this as well. Our runtime checks for our own Mozilla data structures like nsTArrays have caught a lot of bugs that would have otherwise been sec-high buffer overflows. The blog post also has some discussion of the performance implications in their code base.
Comment 1•1 year ago
|
||
The Bugbug bot thinks this bug should belong to the 'Firefox Build System::Toolchains' component, and is moving the bug to that component. Please correct in case you think the bot is wrong.
Comment 2•1 year ago
|
||
We're not using libc++ currently. Well, we are on macOS because that's its system library for C++, but that's an old version, and it won't be the one from llvm 18 for some time (xcode 15 is on llvm 16). On windows, we use the standard library from MSVC, and on Linux, libstdc++. I'm not sure what Android uses these days, but it's definitely not libc++ from the llvm we use to build.
Reporter | ||
Comment 3•1 year ago
|
||
Ah, okay. That's unfortunate, for this purpose.
Comment 4•1 year ago
|
||
Bug 1270832 is basically the libstdc++ version of this I think
Description
•