Commit graph

18729 commits

Author SHA1 Message Date
Evgenii Stepanov
2f5ed30a7c Merge \"Align-up and randomize shared libraries.\"
am: a9fbaee593

Change-Id: I5cb0caea4db3a8cb3b0e1a4dd3a4bb2d5f5069d9
2016-07-20 20:37:26 +00:00
Evgenii Stepanov
a9fbaee593 Merge "Align-up and randomize shared libraries." 2016-07-20 20:31:41 +00:00
Christopher Ferris
fa46052743 Merge \"Move/remove android only kernel uapi headers.\"
am: fe280773ed

Change-Id: If9de2352e7522628aff751211753c11d4d453ca8
2016-07-20 18:09:38 +00:00
Christopher Ferris
fe280773ed Merge "Move/remove android only kernel uapi headers." 2016-07-20 18:03:48 +00:00
Evgenii Stepanov
d13e9a603f Align-up and randomize shared libraries.
This change implements the following property:
  Any 2**N aligned memory region on size 2**N contains no more than one DSO.

The value N can be configured, with 16 or 18 looking like a good choice.
Additionally, DSOs are loaded at random page-aligned address inside these large
regions.

This change has dual purpose:
1. Larger values of N allow a lot more compact CFI shadow implementation.
   See change I14dfea630de468eb5620e7f55f92b1397ba06217.
   For example, CFI shadow for the system_server process has the following size (RSS, KB):
   152 for N = 12, 32 for N = 16, 16 for N = 18.
2. Extra randomization is good for security.

This change does not result in extra RAM usage, because everything is still page-aligned.
It does result in a bit more VM fragmentation because of the gaps between shared libraries.
As it turns out, this fragmentation is barely noticeable because the kernel creates new mapping
at the highest possible address, and we do enough small mappings to almost completely fill the
gaps (ex. in the Zygote the gaps are filled with .ttf file mappings and thread stacks).

I've measured VM fragmentation as the sum of all VM gaps (unmapped regions) that are larger
than 1MB according to /proc/$PID/maps. On aosp_angler-userdebug, the numbers are (in GB):

                |   N = 12  |  N = 18
system_server   |   521.9   |  521.1
zygote64        |   522.1   |  521.3
zygote32        |   2.55    |  2.55
mediaserver     |   4.00    |  4.00

Change-Id: Ia6df840dd409c82837efd1f263be420d9723c84a
2016-07-19 18:18:22 -07:00
Elliott Hughes
9f9d4caf3c Merge \"Expand the testing docs slightly.\"
am: d941f72e75

Change-Id: I9ad64b2f4b1af867b422af7a558338d1224823aa
2016-07-19 22:00:46 +00:00
Elliott Hughes
234c0f6bb6 Merge \"Remove __LIBC_ABI_PUBLIC__.\"
am: 9af76f9b48

Change-Id: I8e2e7bf6a70f978619499a0e96e424c6bdb1cdf0
2016-07-19 21:58:19 +00:00
Treehugger Robot
d941f72e75 Merge "Expand the testing docs slightly." 2016-07-19 21:57:27 +00:00
Treehugger Robot
9af76f9b48 Merge "Remove __LIBC_ABI_PUBLIC__." 2016-07-19 21:48:25 +00:00
Elliott Hughes
20758d58dd Expand the testing docs slightly.
Change-Id: I4b172eefd8f456a62b24520a9f04f500a1d6bc85
2016-07-19 14:09:10 -07:00
Elliott Hughes
f47514dd99 Remove __LIBC_ABI_PUBLIC__.
We have much better control over visibility now, so we don't need to
pollute the headers with cruft.

Bug: http://b/24767418
Change-Id: I349f4c3bc30102477375ad9f80926e560c7c1d8b
2016-07-19 13:56:46 -07:00
Christopher Ferris
d6e8b8ca56 Move/remove android only kernel uapi headers.
Move all of the uapi kernel headers that are only found in the android
kernel, and are still used by the tree into their own directory.

Delete all of these files that are not used.

Also, delete binder.h from the linux directory since it already exists
in the linux/android directory.

Bug: 30072483
Change-Id: I879f16e366f7670b8be3546b0a9cf9567fce6526
2016-07-19 12:43:56 -07:00
Elliott Hughes
a2487be0c7 Merge \"Add a test for a known kernel bug.\"
am: 061cf180db

Change-Id: I31af9c357077b932157eef80f3c51c96750986ab
2016-07-19 18:10:58 +00:00
Treehugger Robot
061cf180db Merge "Add a test for a known kernel bug." 2016-07-19 17:52:03 +00:00
Elliott Hughes
1b2b8362c9 Merge \"Don\'t declare SYS_* constants for unavailable __NR_* constants.\"
am: 20de9ef5bd

Change-Id: Ib9e6ef7fc06df0ac42414870061da287a9692d09
2016-07-18 20:48:52 +00:00
Treehugger Robot
20de9ef5bd Merge "Don't declare SYS_* constants for unavailable __NR_* constants." 2016-07-18 20:39:10 +00:00
Elliott Hughes
d2f725eaed Don't declare SYS_* constants for unavailable __NR_* constants.
Bug: https://code.google.com/p/android/issues/detail?id=215853
Change-Id: Iaaa3ce888deb8d032208bf636b7badaed6a72d30
2016-07-18 12:48:39 -07:00
TreeHugger Robot
22d5ddcb95 Merge "resolve merge conflicts of cf85fd5 to stage-aosp-master" into stage-aosp-master 2016-07-15 23:51:05 +00:00
Dimitry Ivanov
476950d104 resolve merge conflicts of cf85fd5 to stage-aosp-master
Change-Id: Id73b6e03a224ce9a3e3838731be24a16692ef6e0
2016-07-15 16:49:14 -07:00
Colin Cross
268a9f4161 resolve merge conflicts of cf85fd5 to stage-aosp-master
Change-Id: I29bb554c9469109f999c6921e169625ad52cc515
2016-07-15 15:49:51 -07:00
Treehugger Robot
cf85fd5fd5 Merge "Convert linker from Android.mk to Android.bp" 2016-07-15 22:31:13 +00:00
Dan Albert
548d8e0374 Merge \"Put the legacy stdio fds back for pre-M.\"
am: 098d8ef5b2

Change-Id: I32565181dcfc9caab8212baa1c3f7a03f490ce0d
2016-07-15 21:48:30 +00:00
Treehugger Robot
098d8ef5b2 Merge "Put the legacy stdio fds back for pre-M." 2016-07-15 21:33:00 +00:00
Dan Albert
32d7ca35ec Merge \"Add an alias for _CTYPE_N.\"
am: 730fa648c2

Change-Id: I84e7abe390146bfb2deb0987ccd997fd11c7d6aa
2016-07-15 21:02:25 +00:00
Treehugger Robot
730fa648c2 Merge "Add an alias for _CTYPE_N." 2016-07-15 20:56:01 +00:00
Colin Cross
97f0aefe59 Convert linker from Android.mk to Android.bp
Change-Id: Ibf7da301defb2fd7e24fb3f4cd2e967a8f376497
2016-07-15 13:39:29 -07:00
Dan Albert
32c79c279d Put the legacy stdio fds back for pre-M.
Change-Id: I2e397b04cba2969b9f9a3767b9b2fd12a289fcd2
2016-07-15 12:54:14 -07:00
Dan Albert
77bd6073fb Add an alias for _CTYPE_N.
gnustl is using this. It would be easy to change gnustl to *not* use
it for Android, but we've had this in released NDKs for years now so
we probably need this anyway.

Change-Id: I398a550664bf4ccbd9ea54f53c65428293a599a4
2016-07-15 12:54:05 -07:00
Yabin Cui
cd165f63c2 Merge \"Force pthread_cond_timedwait_relative_np using CLOCK_MONOTONIC.\"
am: a24a2476d0

Change-Id: I5d1ebca87932f915fc33dd44d3b383e83b940d90
2016-07-15 01:39:12 +00:00
Yabin Cui
a24a2476d0 Merge "Force pthread_cond_timedwait_relative_np using CLOCK_MONOTONIC." 2016-07-15 01:29:28 +00:00
Colin Cross
14bef04838 Merge \"Fix clean mma in bionic\"
am: 1e4a945f27

Change-Id: Ie6e69b74c7c1fa044db5e6eed58981ef0d57af28
2016-07-15 01:00:44 +00:00
Treehugger Robot
1e4a945f27 Merge "Fix clean mma in bionic" 2016-07-15 00:52:37 +00:00
Elliott Hughes
4a253496b8 Add a test for a known kernel bug.
Bug: http://b/27265969
Change-Id: I981cb6a91015bd17d362987ed12c8ca638987c5b
2016-07-14 17:07:17 -07:00
Colin Cross
0e25b3425b Fix clean mma in bionic
Change-Id: If2410c5ff9c08372098e5ec831e33e4da0e04b30
2016-07-14 16:53:18 -07:00
Colin Cross
2d61b5bc3a Merge \"Convert bionic benchmarks and tests to Android.bp\"
am: 55653cc33b

Change-Id: I577eb6db457bfbc520ca4528315715674173c489
2016-07-14 21:11:23 +00:00
Treehugger Robot
55653cc33b Merge "Convert bionic benchmarks and tests to Android.bp" 2016-07-14 21:05:27 +00:00
Dimitry Ivanov
deabb9030b Merge \"Fix typo in the comment\"
am: d0e764f91e

Change-Id: Id4579211e39c2806debcda66c971473de7b2d2b6
2016-07-14 20:14:51 +00:00
Treehugger Robot
d0e764f91e Merge "Fix typo in the comment" 2016-07-14 20:11:21 +00:00
Colin Cross
f45e58585c Merge \"Convert malloc_debug from Android.mk to Android.bp\"
am: 0393437b53

Change-Id: Iea3dbd038677e42075c6be87fceeb32e442ae152
2016-07-14 19:47:18 +00:00
Colin Cross
0393437b53 Merge "Convert malloc_debug from Android.mk to Android.bp" 2016-07-14 19:43:29 +00:00
Colin Cross
0b6963e5b1 Merge \"Move relocation_packer from Android.mk to Android.bp\"
am: 41933386c0

Change-Id: Iaac010c42c1c1d75cd36645a8b25e89a05abac06
2016-07-14 19:39:18 +00:00
Treehugger Robot
41933386c0 Merge "Move relocation_packer from Android.mk to Android.bp" 2016-07-14 19:34:48 +00:00
Colin Cross
2722ebb30b Convert bionic benchmarks and tests to Android.bp
The compile-time tests and a few custom libraries for dynamic linker
testing are still compiled in make.

Also converts the make rules to run tests on the host to shell scripts
in tests/run-on-host.sh and benchmarks/run-on-host.sh

Change-Id: I6f174b3a69d58c4ed74d29f4e79332d483681534
2016-07-14 12:30:12 -07:00
Dimitry Ivanov
0340450440 Merge \"linker: Improve elf-file validation\"
am: 51f64197ae

Change-Id: I0093b7fda86f7445b5a6cbe55b7237cba3020af6
2016-07-14 18:18:11 +00:00
Dimitry Ivanov
ebe5af7536 Fix typo in the comment
Addressing review comment from change I11bc2567b0cff89f48699ec74015991fee5b137b

Change-Id: I5d479ef61421c86fae06167815aa0a2681d9142d
2016-07-14 11:15:44 -07:00
Dimitry Ivanov
51f64197ae Merge "linker: Improve elf-file validation" 2016-07-14 18:12:59 +00:00
Elliott Hughes
7513194e8a Merge \"Support 32-bit ARM vdso.\"
am: 85f900d589

Change-Id: I20c259c574b519e10efc054b7f2ae13ec9f7b451
2016-07-14 17:32:57 +00:00
Elliott Hughes
85f900d589 Merge "Support 32-bit ARM vdso." 2016-07-14 16:54:23 +00:00
Colin Cross
baa4899d38 Convert malloc_debug from Android.mk to Android.bp
Change-Id: I60ad376d222a92a29263c2804dcd1bd0d3c383d0
2016-07-14 09:07:56 -07:00
Colin Cross
d3b6bc7624 Move relocation_packer from Android.mk to Android.bp
Change-Id: I3d24f8513fe3ca19900705d4861ab797464e0930
2016-07-14 09:07:13 -07:00