Commit graph

27200 commits

Author SHA1 Message Date
Andreas Gampe
cf6268f471 Build: Fix vendor sanitizer library for secondary arch
Fix the directory for secondary-architecture libraries under
sanitization. These incorrectly wrote into vendor/lib instead
of data/vendor/lib.

Bug: 29498013
Change-Id: Iee08422a1f7ad42cbe71a322347e98cb74e3ef7f
2016-06-30 20:20:38 -07:00
Evgenii Stepanov
24dc27e643 Merge "Sanitizer build tweaks." 2016-07-01 00:42:12 +00:00
Evgenii Stepanov
912b51f8ab Sanitizer build tweaks.
-Wl,-no-undefined is currently disabled for any SANITIZE_TARGET. Limit that to
the sanitizers with a runtime library (i.e. address, thread).

Re-enable the relocation packer for ASan. This has been fixed upstream a long
time ago.

Bug: 27729263
Change-Id: I566df6104de816223dc1c519d41a87629ce9c47c
2016-07-01 00:41:33 +00:00
Evgenii Stepanov
3d8ee8896b Merge "Only add libdl dependency for ASan/TSan on target." 2016-06-30 23:49:26 +00:00
Evgenii Stepanov
55f73e6c43 Only add libdl dependency for ASan/TSan on target.
Only sanitizers that intercept stuff need that. For example,
SafeStack does not, and I think UBSan too.

Bug: 27729263
Change-Id: I413cd46cc6c6914a363a3c53da7954beacd8f0d8
2016-06-30 23:49:03 +00:00
Andreas Gampe
6b30d770f0 Build: Add module-level product configuration of sanitization
To allow special sanitizer settings for modules shared between
products, add product-specific module settings.

This was copied from the product-specific dexopt settings.

Bug: 29498013
Change-Id: I17a96b975bb6ac7f4ffb3d5b08e2f00b21bd97a1
(cherry picked from commit bb5454b6db)
2016-06-30 16:21:36 -07:00
Andreas Gampe
3d3b0c950d Build: Add option to restrict sanitization by owner
Add Make variable SANITIZE_NEVER_BY_OWNER to selectively
sanitize modules. By default, both are being sanitized. The
value of the variable is interpreted as a space or colon
separated list of owner names.

This can be used to create builds that lower the sanitization
burden by not sanitizing parts of the platform.

Bug: 29498013
Change-Id: Ib4412657fd38ff28a5c0863eddc2acde63c88ebb
(cherry picked from commit ea38d8e95d)
2016-06-30 16:20:03 -07:00
Andreas Gampe
cd25740cba Build: Add option to restrict sanitization by architecture
Add Make variable SANITIZE_ARCH to selectively sanitize binaries.
This uses the "bitness," i.e., 32 or 64, to potentially filter
the sanitization. By default, both are being sanitized.

This can be used to create builds that lower the sanitization
burden by not sanitizing "half" of the platform.

Bug: 29498013
Change-Id: I73e6d479f08a970ba912f4f63967d32f3487125f
(cherry picked from commit 0290a416c8)
2016-06-30 16:19:53 -07:00
Evgenii Stepanov
ff3341b33b Merge "Add LOCAL_NOSANITIZE." 2016-06-30 22:49:52 +00:00
Evgenii Stepanov
428236614a Add LOCAL_NOSANITIZE.
This can be used to selectively disable individual sanitizers on a
target. For example, some parts of libc should be built with
SafeStack (when requested with SANITIZE_TARGET), but never with
AddressSanitizer. Current build rules specify LOCAL_SANITIZE := never
to disable AddressSanitizer; the idea is to change that to
LOCAL_NOSANITIZE := address thread.

Bug: 27729263
Change-Id: I2b770f2ce3faf6ad6798792327e96adb86fe4a4f
2016-06-30 22:49:17 +00:00
Treehugger Robot
55d4a46f6d Merge "Detect uname -m == i686 as a 32-bit host" 2016-06-29 20:37:13 +00:00
Dan Willemsen
88225fdfbe Detect uname -m == i686 as a 32-bit host
Change-Id: I0350629ce6ea7a5f0224489bafc98bc190e70932
Test: UNAME from https://groups.google.com/d/msg/android-building/nGQna2xuW5s/eEcXSo9ZBgAJ
2016-06-29 12:30:56 -07:00
Tianjie Xu
1767d3f918 Merge "Skip copying existing vendor images" 2016-06-29 18:37:38 +00:00
Tianjie Xu
aaca421ec1 Skip copying existing vendor images
add_img_to_target_files.py has an option of "-a" to add missing
images only. Under this option, the script should skip copying
the radio images for A/B devices when given image exists already
under "IMAGES/".

Test: Run the command on an A/B device, the existing radio images under "IMAGES/" don't get overwritten; and missing images are added correctly.
Bug: 29608905
Change-Id: Ie034b85a5d777d53e367f99470cea4d19cb1aaaf
2016-06-29 18:32:30 +00:00
Yi Kong
d2f4cbbf88 Merge "Add jdk.net to whitelist" 2016-06-29 11:00:47 +00:00
Dan Willemsen
f761c0f574 Never add asan libraries to NDK code
We're beginning to enforce (still warning) that NDK code only links to
other NDK code. So we should never need to link them to the address
sanitizer libraries.

This breaks down a bit when platform code starts depending on NDK-built
code, where the NDK-built code should be mostly the same as if it was
built with the platform, but has an implicit LOCAL_SANITIZE := never.
Even so, this change shouldn't make that worse, as we'll still compile
fine, and anything platform code that uses asan should pull in the
shared library.

Change-Id: I81b30b9edd971468c3cb1467f809f184807b505e
2016-06-28 16:47:43 -07:00
Badhri Jagan Sridharan
997c9af7b1 Add build variant to kernel command line
Verity is not enabled in eng builds. Pass the build variant so
that kernel does not try to enable verity in eng builds

BUG:29276559
Change-Id: I7f412196ac59aa63e91c21d825ad15bae9f51691
2016-06-28 23:36:45 +00:00
Badhri Jagan Sridharan
606ad22def Merge "Extract public key ID from cert" 2016-06-28 23:36:23 +00:00
Badhri Jagan Sridharan
131e1977f6 Extract public key ID from cert
Extracts keyid inline using openssl commands.
The keyid is passed as one of the kernel command line parameters
for the dm-android-verity module to mount root fs(system)
with verity enabled.

(cherry-picked from 3af315aed5
https://googleplex-android-review.git.corp.google.com/#/c/1061691/)

BUG: 28384658
Change-Id: I8efbe1b0e415ef1d396f9b51cfa4b3fa01b22484
2016-06-28 23:35:41 +00:00
Treehugger Robot
73609480b3 Merge "Turn unused source files from warning to error" 2016-06-28 19:41:39 +00:00
Dan Willemsen
9efeb1ea4f Turn unused source files from warning to error
All instances have disappeared from the build server, so switch this to
error before more turn up.

Change-Id: Iac07526a6e77ebf33733033249f2a108aae3fa7d
2016-06-28 10:22:08 -07:00
Treehugger Robot
2acb2d5bcf Merge "Add VENDOR_PRODUCT_RESTRICT_VENDOR_FILES" 2016-06-28 06:17:32 +00:00
Hung-ying Tyan
3c054d8e1f Add VENDOR_PRODUCT_RESTRICT_VENDOR_FILES
Allow exceptions specified by module (VENDOR_EXCEPTION_MODULES) and
path (VENDOR_EXCEPTION_PATHS, not including leading vendor/).

BUG=26968426

Change-Id: I068e43f3eae14f8793c33ae916d46979ab1681d1
2016-06-28 10:10:53 +08:00
Treehugger Robot
7c7571d510 Merge "releasetools: Change the default key path for bvbtool" 2016-06-28 01:52:36 +00:00
Alex Klyubin
819e8485e4 APK signer primitive.
This adds an APK signer primitive which preserves as much of the input
APK as possible. For example, it preserves the order of APK entries
and preserves their contents, including compressed form and alignment
of data.

Bug: 27461702
Change-Id: I51d07c530480182a66379e70a00f680544ff6214
2016-06-27 11:28:08 -07:00
Ethan Xia
37b4a9819b releasetools: Change the default key path for bvbtool
The bvb path has been changed from 'system/bvb' to 'external/bvb'

Change-Id: I8587351b7d702a287883c6bd3c9de1cd3540435b
2016-06-27 17:19:01 +08:00
Treehugger Robot
05038d84dc Merge "Fix typo in setting PRIVATE_MODULE for AIDL source" 2016-06-24 21:16:23 +00:00
Christopher Wiley
dc9e2675e6 Fix typo in setting PRIVATE_MODULE for AIDL source
Bug: 29619260
Change-Id: I59f883c1a92075800844cc2a77b307782a9ab800
2016-06-24 13:13:52 -07:00
Chih-hung Hsieh
4837ce8ca6 Merge "Add +/- buttons to expand/collapse warning categories." 2016-06-24 18:07:44 +00:00
David Sehr
be6b4fc1b3 Merge "Filter logging from dexdump/dex2oat to errors only" 2016-06-24 18:07:07 +00:00
Yi Kong
066a9c3e53 Add jdk.net to whitelist
Tracks libcore commit a434f3be3c22c6b3e7ddd426766808e76a5780fd

Bug: 29067535
Change-Id: I764b602aa0f2a991dc26b5fd42a1143bb58d67ba
2016-06-24 18:57:55 +01:00
David Sehr
49fbdd1f28 Filter logging from dexdump/dex2oat to errors only
Change-Id: Idb3f1c3d216e2db87ce3b03cbacc6fc3ceff37e0
2016-06-24 09:27:00 -07:00
Christopher Wiley
7e918b6a46 Merge "Fix path escaping for aidl generated java" 2016-06-24 16:00:33 +00:00
Tao Bao
46abc55954 Merge "Fix the path for verity_key replacement when signing." 2016-06-24 05:20:20 +00:00
Tao Bao
8e6582b238 Merge "Add ability to pass in payload_signer args" 2016-06-24 05:20:06 +00:00
Tao Bao
983a42bdf1 Merge "releasetools: Support using payload_signer." 2016-06-24 05:19:54 +00:00
Tao Bao
6efa887f9b Merge "releasetools: replace verity keyid" 2016-06-24 05:19:40 +00:00
Tao Bao
f2c34ece3c Merge "Replace OTA keys when signing for A/B devices." 2016-06-24 05:19:22 +00:00
Tao Bao
8adcfd1688 Fix the path for verity_key replacement when signing.
system_root_image expects the key at ROOT/verity_key as opposed to
BOOT/verity_key. Also refactor the verity key replacement lines.

Bug: 29397395
Test: 'sign_target_files_apks.py --replace_verity_private_key newkey --replace_verity_public_key newkey.pub target_files.zip signed-target_files.zip' and verify the replaced key in boot.img.
Change-Id: I58a5defff4be008ad55d4b5a5b7148569c3b8d66
(cherry picked from commit e0ee794fa1)
2016-06-23 22:17:46 -07:00
Baligh Uddin
34eb000de5 Add ability to pass in payload_signer args
Bug: 28701652
Change-Id: I110d5fc14446e4a6a0f8e25dcb0d300decdf09a4
(cherry picked from commit 2abbbd0333)
2016-06-23 22:16:46 -07:00
Tao Bao
1a5e1d18a7 releasetools: Support using payload_signer.
For A/B OTAs, by default it calls 'openssl pkeyutl' to sign the payload
and metadata with the package private key. If the private key cannot be
accessed directly, a payload signer that knows how to do that should be
supplied via "--payload_signer <signer>".

The signer will be called with "-inkey <path_to_private_key>",
"-in <input_file>" and "-out <output_file>" parameters.

Test: Use a dummy signer, call 'ota_from_target_files.py --payload_signer <signer> <target_files.zip> <ota.zip>' and verify the signatures in the generated package.
Bug: 28701652
Change-Id: I26cfdd3fdba6fc90799221741b75426988e46fd3
(cherry picked from commit dea0f8bfed)
2016-06-23 22:15:30 -07:00
Badhri Jagan Sridharan
35c9b1243f releasetools: replace verity keyid
Replace verity keyid with the keyid extracted from cert
passed through --replace_verity_keyid. The veritykeyid in the
BOOT/cmdline of input target files is replaced with keyid
extracted from --replace_verity_keyid and written to the
output target files.

BUG: 28384658
Change-Id: Ic683f36f543c4fcd94b6f95e40f01200fbf45ee1
(cherry picked from commit b58d23fe00)
2016-06-23 22:13:12 -07:00
Tao Bao
a80ed221b8 Replace OTA keys when signing for A/B devices.
It replaces the package verification key (change of path due to
system_root_image flag), as well as the payload verification key.

Bug: 29397395
Change-Id: I10435072aaf4356f2d8b5e1b6e82eb9cead7ad62
(cherry picked from commit 24a7206430)
2016-06-23 22:12:31 -07:00
Christopher Wiley
d9205ba17e Fix path escaping for aidl generated java
Bug: 29619260
Change-Id: I806044573661c61e691adf36a47092188db87ab6
Test: Generated java with ../ in paths appears in the right place.
2016-06-23 16:49:32 -07:00
Chih-Hung Hsieh
465b610183 Add +/- buttons to expand/collapse warning categories.
* Add expand/collapse-all buttons to expand/collapse all warnings.
* Use HTML styles to reduce output file size.

Change-Id: Ica188cc4f123ce0ab8547f88315325c3e0560a39
Test: Checked output html file with Chrome browser.
2016-06-23 13:18:58 -07:00
Treehugger Robot
744e7746c4 Merge "Use Builder pattern for ApkVerifier parameters." 2016-06-23 00:31:53 +00:00
Alex Klyubin
9a41c93f41 Use Builder pattern for ApkVerifier parameters.
This should make it easier to add parameters/options without breaking
existing clients.

Bug: 27461702
Change-Id: Ia4577f78d703a6b91828dd08492c78d5e9afb110
2016-06-22 14:59:12 -07:00
Treehugger Robot
239f2b0f9f Merge "Finish refactoring tests to NATIVE_TESTS" 2016-06-22 20:37:41 +00:00
Dan Willemsen
e1c6deab10 Finish refactoring tests to NATIVE_TESTS
Now that the source trees all use NATIVE_TESTS for intermediate files
and generated sources, make it a requirement.

Change-Id: Id5718fabe63f6e8dde7981a6f0f5bd89e0ec7ee5
2016-06-22 00:27:54 -07:00
Treehugger Robot
59e060e1c6 Merge "move test artifact build rules into open source location" 2016-06-22 00:47:28 +00:00