diff options
author | Inseob Kim <inseob@google.com> | 2020-07-29 20:32:10 +0900 |
---|---|---|
committer | Bill Peckham <bpeckham@google.com> | 2020-08-10 16:06:13 -0700 |
commit | 3c6a45240c65433d65936b2333297b13887ffef3 (patch) | |
tree | e5974dea9561b67067cf043aba314cc87df51112 /scripts/lint-project-xml.py | |
parent | b48f973000f216a87101df90adaef132d88b9756 (diff) |
Add cfi static libraries to vendor snapshot
CFI modules can't link against non-CFI static libraries, and vice versa.
So without capturing both CFI and non-CFI static libraries, vendor
modules won't be able to use CFI, which will be a critical security
hole.
This captures both CFI and non-CFI variants of all static libraries for
vendor snapshot, except for those whose cfi are explicitly disabled.
For example, suppose that "libfoo" is defined as follows.
cc_library_static {
name: "libfoo",
vendor_available: true,
}
As it doesn't have cfi disabled, two libraries "libfoo.a" and
"libfoo.cfi.a" will be captured. When installed, vendor snapshot module
for "libfoo" will look like:
vendor_snapshot_static {
name: "libfoo",
src: "libfoo.a",
cfi: {
src: "libfoo.cfi.a",
},
}
The build system will recognize the "cfi" property, and will create both
CFI and non-CFI variant, allowing any modules to link against "libfoo"
safely, no matter whether CFI is enabled or not.
Two clarification:
1) The reason why we don't create separate modules is that DepsMutator
runs before sanitize mutators. CFI and non-CFI variant of a library
should exist in a single module.
2) We can't capture CFI variant if the source module explicitly disables
cfi variant by specifying the following.
sanitize: {
cfi: false,
}
In this case, only non-CFI variant will be created for the vendor
snapshot module.
Bug: 65377115
Test: m dist vendor-snapshot && install && build against snapshot
Change-Id: Idbf3e3205d581800d6093c8d6cf6152374129ba4
(cherry picked from commit c42f2f2e9df800ae0c2267964d51d22b7a5de649)
Diffstat (limited to 'scripts/lint-project-xml.py')
0 files changed, 0 insertions, 0 deletions