Skip to content

Fix FIPS build under MSAN by broadening integrity-test guards#3167

Open
justsmth wants to merge 1 commit intoaws:mainfrom
justsmth:fix-fips-msan
Open

Fix FIPS build under MSAN by broadening integrity-test guards#3167
justsmth wants to merge 1 commit intoaws:mainfrom
justsmth:fix-fips-msan

Conversation

@justsmth
Copy link
Copy Markdown
Contributor

@justsmth justsmth commented Apr 15, 2026

Issues:

Description of changes:

CMake already skips the delocator (and linker script) for both ASAN and MSAN FIPS builds, but bcm.c and fips.c only guarded the integrity-test symbol references with #if !defined(OPENSSL_ASAN). This means an MSAN+FIPS build still extern-declares BORINGSSL_bcm_text_start/end/hash and tries to call BORINGSSL_integrity_test(), even though nothing provides those symbols — resulting in link failures.

This broadens all three guards in bcm.c and the FIPS_mode() check in fips.c to !defined(OPENSSL_ASAN) && !defined(OPENSSL_MSAN), matching the existing guard in delocate.h.

Call-outs:

FIPS_mode() now returns 0 under MSAN, just as it does under ASAN. is_fips_build() is unaffected — it still returns 1 for any BORINGSSL_FIPS build regardless of sanitizer, which is the intended distinction between the two.

Testing:

Added a targeted MSAN+FIPS CI job (ubuntu:22.04 / clang-14 / x86_64) in linux-multi-arch-omnibus.yml, gated behind AWSLC_ENABLE_FIPS_MSAN. The corresponding run_fips_tests.sh block builds with -DFIPS=1 -DMSAN=1 -DUSE_CUSTOM_LIBCXX=1, verifies bssl isfips returns 0, and runs the test suite.

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license and the ISC license.

@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented Apr 15, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 78.15%. Comparing base (da998ab) to head (2708c5f).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3167      +/-   ##
==========================================
+ Coverage   77.97%   78.15%   +0.17%     
==========================================
  Files         689      689              
  Lines      122670   122671       +1     
  Branches    17076    17081       +5     
==========================================
+ Hits        95658    95870     +212     
+ Misses      26115    25902     -213     
- Partials      897      899       +2     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Comment thread tests/ci/run_fips_tests.sh
The FIPS integrity-test symbols (BORINGSSL_bcm_text_start/end/hash) are
only provided by the delocator or linker script. CMake already skips
these for both ASAN and MSAN builds, but bcm.c and fips.c only guarded
with !defined(OPENSSL_ASAN), causing link failures under MSAN.

Broaden all guards to also check !defined(OPENSSL_MSAN), matching the
existing guard in delocate.h, and add targeted MSAN+FIPS CI coverage.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants