Repository navigation
build: revert passing sanitizer flags to libsecp256k1 #7930
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -2062,9 +2062,6 @@ CPPFLAGS_TEMP="$CPPFLAGS" | |
| unset CPPFLAGS | ||
| CPPFLAGS="$CPPFLAGS_TEMP" | ||
|
|
||
| if test -n "$use_sanitizers"; then | ||
| export SECP_CFLAGS="$SECP_CFLAGS $SANITIZER_CFLAGS" | ||
| fi | ||
| dnl The ECDH module is required by the wallet's Platform key provider | ||
|
Comment on lines
2064
to
2065
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🟡 Suggestion: Preserve libsecp256k1 instrumentation in fuzz builds The removed export supplies libsecp256k1's sanitizer flags through SECP_CFLAGS, which its Makefile uses in AM_CFLAGS. Removing it also affects the documented --enable-fuzz --with-sanitizers=address,fuzzer,undefined configuration and ci/test/00_setup_env_native_fuzz.sh: library internals reached by fuzz targets lose compiler-inserted coverage feedback and ASan/UBSan checks. The DER wrappers themselves remain instrumented because ec_seckey_import_der/ec_seckey_export_der and ecdsa_signature_parse_der_lax are implemented in src/key.cpp and src/pubkey.cpp, not in the separately compiled library; the regression is specifically in the libsecp256k1 calls beneath those wrappers and other fuzz targets. Restore the export only when enable_fuzz=yes and sanitizers are requested. This preserves library instrumentation for fuzzing without restoring its cost in the ASan/TSan unit-test builds this PR targets. source: |
||
| dnl (DashPay contact request encryption, wallet/platformkeys.cpp). | ||
| ac_configure_args="${ac_configure_args} --disable-shared --with-pic --enable-benchmark=no --enable-module-recovery --enable-module-ecdh --disable-openssl-tests" | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When using the documented libFuzzer configuration (
doc/fuzzing.md:11) or the CI fuzz configuration (ci/test/00_setup_env_native_fuzz.sh:18), removing this propagation means--with-sanitizersno longer reachesAM_CFLAGSinsrc/secp256k1/Makefile.am. Consequently libFuzzer gets no branch feedback, and ASan/UBSan add no checks, inside secp256k1 even for the dedicatedsecp256k1_*fuzz targets, silently losing coverage of the cryptographic code; retain the propagation whenenable_fuzz=yeswhile omitting it from the ASan/TSan regression-test builds whose runtime this change targets.Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
intentionally done as this code is backported from bitcoin core as it is and instrumented there.