Commit graph

14 commits

Author SHA1 Message Date
Colin Cross
badcb38d3c Convert bionic dlext test zips to Android.bp
Use cc_genrules to create the dlext test zips needed by the bionic
tests.  The genrules aren't visible to Make, and so don't work with
the `required` property.  Move all of the dependencies to `data_bins`,
`data_libs` or `data` for helper binaries, shared libraries or
genrule zip files respectively.  The `data*` properties copy the
files into the same directory as a test, respecting the
`bionic-loader-test-libs` relative path specified by each, but
does not put each helper binary in its own subdirectory, so update
the paths in each of the tests.

Bug: 200872604
Test: atest CtsBionicTestCases
Test: atest bionic-unit-tests
Test: cts-tradefed run commandAndExit cts -m CtsBionicTestCases
Test: adb push $OUT/data/nativetest/bionic-unit-tests /data/nativetest/ && adb shell /data/nativetest/bionic-unit-tests/bionic-unit-tests
Change-Id: Ic4257cb4104ff558326df2363730acd20464b051
2021-09-30 14:04:27 -07:00
Elliott Hughes
141b917018 Switch to libbase SilentDeathTest.
Bug: http://b/184955378
Test: treehugger
Change-Id: Ie0849224074da92203340a741a86a24a4a3702c2
2021-04-12 10:01:20 -07:00
Elliott Hughes
e657eb4f8a Fix some bionic death tests.
These were creating tombstones and spewing to the log.

You need TEST_F() rather than TEST(), and the modern style is apparently
to use `using` rather than an empty subclass.

Bug: http://b/180605583
Test: run tests, check logcat
Change-Id: I1e639d34854aeff6f042c24643b769a6bcfab877
2021-02-18 17:23:04 -08:00
Evgenii Stepanov
0f6b504e0c Remove stack address check in cfi_basic test.
This is not actually a property that is guaranteed by the bionic
implementation of CFI shadow. Since the gaps between libraries are not
completely inaccessible, it is possible for a stack mapping to sneak in,
which would cause the callback to register in the test library.

This is not a correctness issue in CFI as the actual __cfi_check
callback will reject such address anyway, at a small CPU cost.

Bug: 156218352
Test: CtsBionicTestCases-cfi_test#basic
Change-Id: I8d04fb7132e1eac2a8abfbc48a37c8eac6e25a09
2020-07-20 15:52:06 -07:00
Christopher Ferris
f322483b3f Fix possible issue with cfi_basic test.
It's possible for malloc to return a pointer that is not going to
crash with __cfi_slowpath. It's possible to modify the cfi code
to avoid this problem, but I'm not convinced that this will be any
better at catching problems. So I'm just modifying the test so that
it will eventually allocate a pointer that does not overlap.

This previous version of the test failed on jemalloc svelte config,
but there is nothing that would not result in a failure on scudo
leading to a failure every once in a while.

Bug: 142556796
Bug: 140079007

Test: Ran bionic unit tests with jemalloc and scudo.
Change-Id: Iff45bd950d2eb33ff56dc700a2d739b5b578e090
2020-04-02 05:48:05 +00:00
Christopher Ferris
6d2c0bdf6e Move isolated test runner out of bionic.
Use a global gtest isolation runner rather than the custom one in
bionic.

Test: Ran all unit tests and verified same behavior before and after.

Change-Id: I24a7cf17cf8e018d0f51969c64b53ce9059cc779
2018-09-27 22:22:17 -07:00
Evgenii Stepanov
1dfd76ac2c Extend cfi test to verify a range of target pointers.
Test: bionic device tests
Bug: 63400743
Bug: 65590288
Change-Id: Ic4ef9630a2db709cf4edcc7f76c791df3f349192
2017-09-19 13:59:34 -07:00
Evgenii Stepanov
97c16f8dca [cfi] Export __cfi_shadow_size.
__cfi_shadow_size returns the size of the CFI shadow mapping, or 0 if
CFI is not (yet) used in this process. This can be used to adjust
RLIMIT_AS setting.

Test: device bionic tests
Bug: 64293803
Change-Id: Icd7164f96aa7115b3585c21c0f68529cd2f07c11
2017-08-03 14:04:15 -07:00
Evgenii Stepanov
68ecec1965 Fix CFI initialization crash on x86.
Third try.

Bug: 34752378
Test: bionic tests
Change-Id: I247c127489a8ee38404e104f28d916a704e35f36
2017-02-02 14:44:46 -08:00
Evgenii Stepanov
beb3eb1790 Revert "Fix CFI initialization crash on x86."
Breaks aosp-master/sdk.

This reverts commit 4ccd4317f9.
2017-01-31 17:10:03 -08:00
Evgenii Stepanov
4ccd4317f9 Fix CFI initialization crash on x86.
Second try.

Bug: 34752378
Test: bionic tests
Change-Id: I0a7453154671918b2e6e72f0bb9074c29ceb0f34
2017-01-31 13:44:55 -08:00
Alex Cheung
6fcd7a7d28 Revert "Fix CFI initialization crash on x86."
This reverts commit be46d3871c.

Reverting due to broken build:

https://android-build.googleplex.com/builds/branch-dashboard/aosp-master?build_id=3687823

Change-Id: I30968398edd9a094fce878839ba0a002ed487a77
2017-01-31 04:19:50 +00:00
Evgenii Stepanov
be46d3871c Fix CFI initialization crash on x86.
Bug: 34752378
Test: bionic tests
Change-Id: If8e33f76a1a2d83356d818fed506ea624f579860
2017-01-30 14:29:48 -08:00
Evgenii Stepanov
0a3637d3eb Runtime support for CFI
Control Flow Integrity support in bionic.

General design:
http://clang.llvm.org/docs/ControlFlowIntegrityDesign.html#shared-library-support

This CL implements subsections "CFI Shadow" and "CFI_SlowPath" in the above document.

Bug: 22033465
Test: bionic device tests
Change-Id: I14dfea630de468eb5620e7f55f92b1397ba06217
2017-01-18 13:13:52 -08:00