Open Bug 1883751 Opened 7 months ago Updated 1 month ago

Enable Clang C++ buffer hardening when it is available

Categories

(Firefox Build System :: Toolchains, enhancement)

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.

Keywords: sec-want

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.

Component: General → Toolchains

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.

Ah, okay. That's unfortunate, for this purpose.

Bug 1270832 is basically the libstdc++ version of this I think

See Also: → 1270832
See Also: → 1913116
You need to log in before you can comment on or make changes to this bug.