Bug 1627768 - Expand check_networking exemption to ASan and UBSan builds r=rstewart

They all fail for the same reason: the sanitizer runtime in compiler-rt installs an interceptor for `getsockname` which then contains a call to the real implementation.

Differential Revision: https://phabricator.services.mozilla.com/D70889

--HG--
extra : moz-landing-system : lando
This commit is contained in:
David Major 2020-04-15 15:56:34 +00:00
parent ae6d2e126f
commit e8a38f48d0

View File

@ -298,18 +298,16 @@ $(RUST_LIBRARY_FILE): force-cargo-library-build
# that we are not importing any networking-related functions in rust code. This reduces
# the chance of proxy bypasses originating from rust code.
# The check only works when rust code is built with -Clto.
# Enabling sancov or TSan also causes this to fail.
# Sanitizers and sancov also fail because compiler-rt hooks network functions.
ifndef MOZ_PROFILE_GENERATE
ifndef MOZ_TSAN
ifeq ($(OS_ARCH), Linux)
ifeq (,$(rustflags_sancov))
ifeq (,$(rustflags_sancov)$(MOZ_ASAN)$(MOZ_TSAN)$(MOZ_UBSAN))
ifneq (,$(filter -Clto,$(cargo_rustc_flags)))
$(call py3_action,check_binary,--target --networking $@)
endif
endif
endif
endif
endif
force-cargo-library-check:
$(call CARGO_CHECK) --lib $(cargo_target_flag) $(rust_features_flag)