Disable sanitizer for vendor_snapshot_object modules
vendor_snapshot_object modules do not provide sanitizers.
Avoid sanitizer mutation for these modules.
Bug: 234772527
Test: build against the vsdk with SANITIZE_TARGET=hwaddress
Change-Id: Ib4fe4def673aa77a4321f47c09393adcb2fa2964
diff --git a/cc/sanitize.go b/cc/sanitize.go
index dc07381..8e2d161 100644
--- a/cc/sanitize.go
+++ b/cc/sanitize.go
@@ -630,15 +630,8 @@
// Also disable CFI for VNDK variants of components
if ctx.isVndk() && ctx.useVndk() {
- if ctx.static() {
- // Cfi variant for static vndk should be captured as vendor snapshot,
- // so don't strictly disable Cfi.
- s.Cfi = nil
- s.Diag.Cfi = nil
- } else {
- s.Cfi = nil
- s.Diag.Cfi = nil
- }
+ s.Cfi = nil
+ s.Diag.Cfi = nil
}
// HWASan ramdisk (which is built from recovery) goes over some bootloader limit.
@@ -1168,10 +1161,12 @@
//TODO: When Rust modules have vendor support, enable this path for PlatformSanitizeable
// Check if it's a snapshot module supporting sanitizer
- if ss, ok := c.linker.(snapshotSanitizer); ok && ss.isSanitizerAvailable(s.sanitizer) {
- return []string{"", s.sanitizer.variationName()}
- } else {
- return []string{""}
+ if ss, ok := c.linker.(snapshotSanitizer); ok {
+ if ss.isSanitizerAvailable(s.sanitizer) {
+ return []string{"", s.sanitizer.variationName()}
+ } else {
+ return []string{""}
+ }
}
}