Commit graph

30141 commits

Author SHA1 Message Date
Xin Li
b45aca535f [automerger skipped] DO NOT MERGE - Merge Android 10 into master
am: 9dd8a90472 -s ours
am skip reason: subject contains skip directive

Change-Id: I3664cc6e69975ef59a4a9654175814a53d06564e
2019-09-05 13:26:10 -07:00
Xin Li
df0daeb1ee Merge "DO NOT MERGE - Merge Android 10 into master" 2019-09-05 16:53:34 +00:00
Martin Stjernholm
be746a7691 Merge "Add more linker debug log."
am: b94e6895a3

Change-Id: I0a102dc39425fd3a00e8f3559804db0057b2cc25
2019-09-05 07:54:30 -07:00
Treehugger Robot
b94e6895a3 Merge "Add more linker debug log." 2019-09-05 14:34:28 +00:00
Martin Stjernholm
9fe3826be1 Add more linker debug log.
Main change is to log errors directly where they occur, to correlate with
other dlopen/dlsym logs.

Test: Build & boot with and without LinkerLogger::flags_ initialised to kLogDlopen
Change-Id: If36f52914dc97cedd95dc9375c291640c6891728
2019-09-05 12:00:25 +00:00
Xin Li
9dd8a90472 DO NOT MERGE - Merge Android 10 into master
Bug: 139893257
Change-Id: Ib97781dd4ee5e719cc2376221708bb1c8aaeaf73
2019-09-04 17:50:37 -07:00
Ryan Prichard
85be9725c7 crtbegin: replace TPREL with R_*_NONE relocs
Bug: https://bugs.llvm.org/show_bug.cgi?id=41527
Test: bionic unit tests
Change-Id: Ia66c969b209c0f72d1e37573949f3fb59817ca71
2019-09-04 20:31:06 +00:00
Christopher Ferris
000cdf8732 Merge "Update to kernel headers v5.2.11."
am: e2c10d8de0

Change-Id: I1dc284be7b04d4894ad98156e245c2d74004cb0d
2019-09-04 13:04:01 -07:00
Christopher Ferris
e2c10d8de0 Merge "Update to kernel headers v5.2.11." 2019-09-04 19:44:24 +00:00
chenbruce
eb21b2f142 Merge "Test for ns_parserr() and got a heap-buffer-overflow"
am: d0494b368e

Change-Id: Iac510a0f8e199711ff7fa2df9f9fb8d5dd77a278
2019-09-03 19:43:45 -07:00
Treehugger Robot
d0494b368e Merge "Test for ns_parserr() and got a heap-buffer-overflow" 2019-09-04 02:21:43 +00:00
Logan Chien
cbf4e805f8 Merge "versioner: Fix bzero/bcopy fortify"
am: 2fb9a03b9c

Change-Id: Icfc6cbadb3c6fa7f84956e6550864bb60ea7a06a
2019-09-03 16:34:46 -07:00
Logan Chien
2fb9a03b9c Merge "versioner: Fix bzero/bcopy fortify" 2019-09-03 23:12:43 +00:00
Christopher Ferris
e892fd6b17 Update to kernel headers v5.2.11.
Test: Build and boots on taimen.
Test: Bionic unit tests all pass on taimen.
Change-Id: I80abb6f9abbff9ca20ce6c7c912a259b5ca86fa2
2019-09-03 15:56:49 -07:00
Elliott Hughes
8049184be8 Merge "Support statvfs on API levels before 19."
am: 37ff081e88

Change-Id: Id79699c172491d805543e370980bfc736802f570
2019-09-03 15:42:34 -07:00
Elliott Hughes
37ff081e88 Merge "Support statvfs on API levels before 19." 2019-09-03 22:28:36 +00:00
Christopher Ferris
f0e70113d5 Merge "Add EFD_SEMAPHORE flag for eventfd."
am: add3a4ae70

Change-Id: I5508cec132fa1c8b79d41f39231e26fde17bba2f
2019-09-03 12:45:26 -07:00
Christopher Ferris
add3a4ae70 Merge "Add EFD_SEMAPHORE flag for eventfd." 2019-09-03 19:16:55 +00:00
Logan Chien
39268e56eb Merge "versioner: Fix C11 threads.h"
am: 8292d04da5

Change-Id: I85d8993b90fa26888a803451a17ac3b8d78f514e
2019-09-03 09:40:41 -07:00
Christopher Ferris
2c4cb0d760 Add EFD_SEMAPHORE flag for eventfd.
Add a test for the new flag and add a test for the EFD_CLOEXEC flag.

Test: New unit tests pass on glibc and target.
Change-Id: Ib7a6ea4aadbd67ba8a523b6114a49fb8d6a43f12
2019-09-03 09:35:51 -07:00
Logan Chien
8292d04da5 Merge "versioner: Fix C11 threads.h" 2019-09-03 16:22:02 +00:00
Martin Stjernholm
b17a3a2a58 Merge "Update references to the new com.android.art APEX."
am: c238330720

Change-Id: I805d7fbc1655c23f4452f392c299f72cd90996e2
2019-09-02 03:43:16 -07:00
Martin Stjernholm
c238330720 Merge "Update references to the new com.android.art APEX." 2019-09-02 10:28:30 +00:00
Logan Chien
b33952c777 versioner: Fix bzero/bcopy fortify
This commit replaces `bzero` with `__bionic_bzero` and `bcopy` with
`__bionic_bcopy` because `bzero` and `bcopy` are partially defined in
`libc.map.txt`.  Bionic versioner raises errors because versioner treats
static inline functions as exported function definitions then it
compares the availability with the information specified in
`libc.map.txt`.

This commit fixes the problem by replacing static inline functions into
`__bionic_{bzero,bcopy}` and defining aliases for source-level
compatibility.

Test: PATH=$(pwd)/prebuilts/clang-tools/linux-x86/bin:$PATH \
      bionic/tools/versioner/run_tests.py
Bug: 140110040

Change-Id: I97f2f0dc0abccd0a9fcfe5bb02f4e918362d35cc
2019-08-30 10:17:36 -07:00
Elliott Hughes
261bd745ee Support statvfs on API levels before 19.
Split statfs and statvfs. The former has been available forever, and the
latter is implemented in terms of the former. The implementation has
been moved into headers so that it can be used at low API levels.

There's no reason for any Android or Linux code to use statvfs rather
than statfs, but code that needs to build on Darwin too will want to use
statvfs because Darwin's statfs is very spartan.

Bug: https://github.com/android-ndk/ndk/issues/609
Test: treehugger
Change-Id: Icf3d5723a260099fddb2d9f902e3047b0f041647
2019-08-29 21:57:58 -07:00
Logan Chien
235aad1981 versioner: Fix C11 threads.h
This commit annotates C11 Thread APIs so that bionic versioner won't
report errors.

This commit also adds a guard before `mtx_timedlock` because
`pthread_mutex_timedlock` was introduced in Android L.

Test: PATH=$(pwd)/prebuilts/clang-tools/linux-x86/bin:$PATH \
      bionic/tools/versioner/run_tests.py
Bug: 140110040

Change-Id: I3c6ce0831f613ffd3a7bf1c1972fd3548195cc56
2019-08-29 16:40:34 -07:00
Martin Stjernholm
6d5277dbaa Update references to the new com.android.art APEX.
Test: Flash & boot
Test: atest CtsJniTestCases CtsBionicTestCases
Bug: 135753770
Exempt-From-Owner-Approval: Approved internally
Change-Id: I1c16a798edc494e75b9d703990de08e60686a3ea
Merged-In: I1c16a798edc494e75b9d703990de08e60686a3ea
2019-08-29 18:07:50 +01:00
chenbruce
2cc76462e5 Test for ns_parserr() and got a heap-buffer-overflow
In ns_name_skip of ns_name.c, there is a possible out of bounds read due to
a missing bounds check. This could lead to remote denial of service with no
additional execution privileges needed. User interaction is not needed for
exploitation.

Bug: 137346580
Test: built, flashed, booted
Test: ns_parserr_fuzzer test
Change-Id: Ib023bd9b2ae97795d64195de9922a6a32d7b2f37
2019-08-29 22:18:37 +08:00
Ryan Savitski
b8f36d0e65 Merge "Add arm32 case to BIONIC_STOP_UNWIND to correctly stop unwinders"
am: 2acd0c34a9

Change-Id: If916d92c03e8f254a7acb4adb35e75d4b58a99ae
2019-08-28 17:07:01 -07:00
Ryan Savitski
2acd0c34a9 Merge "Add arm32 case to BIONIC_STOP_UNWIND to correctly stop unwinders" 2019-08-28 21:43:39 +00:00
Logan Chien
d49602fd71 Merge changes from topic "clang-tools-r365631"
am: 9e544d3077

Change-Id: Ifda9bcc6b4eef2862d221c11afe776bb166874f1
2019-08-27 19:47:16 -07:00
Logan Chien
e6b71eb92e versioner: Update clang prebuilts to clang-r365631
am: c071fe4089

Change-Id: I0dc7befc7ac1c432655714e34aee0697b43803d5
2019-08-27 19:47:07 -07:00
Logan Chien
9e544d3077 Merge changes from topic "clang-tools-r365631"
* changes:
  versioner: Add R to codename map
  versioner: Update clang prebuilts to clang-r365631
2019-08-28 02:29:20 +00:00
Ryan Savitski
9db3486a12 Add arm32 case to BIONIC_STOP_UNWIND to correctly stop unwinders
The arm32 case was omitted when the macro was originally added due to
clang issues (b/15469122#comment5).

Testing at ToT master, ".cfi_undefined r14" appears to compile & work as
expected. This is the same directive as used by the linker's begin.S.

Test: ran a 32 bit binary on crosshatch-userdebug, verified that
"debuggerd -b" (which uses libunwindstack) stops at __libc_init as in
the arm64 case (before it would unwind past _start_main, with an
erroneous frame at the bottom).

Test: ran unwind_reg_info tool on /system/lib/libc.so with an address
within __libc_init, confirmed that the "debug_frame" section includes
"r14 = undefine" (arm exidx still contains "r14 = [cfa - 4]", but that
looked correct to cferris@).

Bug: 140008396
Change-Id: I6eb0bc6cf516fddee2df40492350678a0547fee3
2019-08-27 22:50:21 +01:00
Elliott Hughes
33de9cb1c5 Merge "libm: remove unused x86/x86_64 assembler."
am: eab2046e35

Change-Id: Id9fc83ab760b2bf4407d9b37cffd17de9f7fab0a
2019-08-27 13:21:45 -07:00
Treehugger Robot
eab2046e35 Merge "libm: remove unused x86/x86_64 assembler." 2019-08-27 19:40:14 +00:00
Logan Chien
8fd8b99978 versioner: Add R to codename map
This commit adds "R" to codename map because `libc.map.txt` started
using "introduced=R".

Test: PATH=prebuilts/clang-tools/linux-x86/bin:$PATH \
      ./bionic/tools/versioner/run_tests.py
Bug: 140110040

Change-Id: Ibc1154557c29d9580b5c527160116b24fa4c656f
2019-08-27 11:54:28 -07:00
Logan Chien
c071fe4089 versioner: Update clang prebuilts to clang-r365631
This commit ports bionic version to clang-r365631.
`clang::CompilerInstance::setVirtualFileSystem(VFS)` has been replaced
by `clang::CompilerInstance::createFileManager(VFS)`.

Test: OUT_DIR=out ./prebuilts/clang-tools/build-prebuilts.sh
Bug: 140110040
Change-Id: Ia833d502765dd9885eb85026d513bdfdee3756f3
2019-08-27 09:53:53 -07:00
Elliott Hughes
ef14a89f72 libm: remove unused x86/x86_64 assembler.
Test: treehugger
Change-Id: Icefa51fe2d204f0ad5700fd67649a1d4b1e6a38f
2019-08-27 09:16:12 -07:00
Vic Yang
7dd2650fe1 Merge "Move __dso_handle to RELRO"
am: 74a62838fb

Change-Id: Id8eff6672c1fc8fce37252cca675c24e48ffa870
2019-08-26 22:18:02 -07:00
Treehugger Robot
74a62838fb Merge "Move __dso_handle to RELRO" 2019-08-27 05:09:20 +00:00
Jooyung Han
e585a2a748 Merge "Revert "linker: cleanup (removing unused VNDK_VER)""
am: c896a066d2

Change-Id: I8089b8abb3826beea8cbf91a12ba3c74208cd398
2019-08-26 22:04:57 -07:00
Treehugger Robot
c896a066d2 Merge "Revert "linker: cleanup (removing unused VNDK_VER)"" 2019-08-27 04:34:47 +00:00
Vic Yang
f1fde773e1 Move __dso_handle to RELRO
Most DSOs have a RELRO segment, but some of them have nothing except
__dso_handle in their .data section.  This means __dso_handle is taking
up a page as well as a vm_area_struct in kernel slabs for those DSOs.

Let's move it to the RELRO segment to save memory.

On a 32-bit device I tested on, I saw ~400 KB less slab usage on
vm_area_struct.  To control for difference in number of cached
processes, I also measured with Android stopped, and I saw ~100 KB less
slab usage.  Summing up all dirty pages attributed to shared libraries,
I saw 5.6 MB less dirty pages.

Test: Build and boot.
Change-Id: Ib88e49f1c72352e610affc19623895d954110d4e
2019-08-26 20:35:00 -07:00
Jooyung Han
5d1d907ba5 Revert "linker: cleanup (removing unused VNDK_VER)"
This reverts commit 39699ea095.

Reason for revert: This breaks swcodec apex. (It still uses VNDK_VER)
Bug: 140014331
Change-Id: I3a4c5b68fdd5e42fdf93c4c71f6c3be839ea8a28
2019-08-26 23:09:07 +00:00
Christopher Ferris
5b8d0757f1 Merge "Use ReadMapFileAsyncSafe in malloc_iterate tests."
am: 8bccbb01e7

Change-Id: I6eab952fb46f1f3e0a9661c1e25f4ef98dea0d09
2019-08-24 01:22:13 -07:00
Ryan Prichard
f62547a4ee Merge "Add additional dl_phdr_info fields"
am: 665e98edf7

Change-Id: I3c1ed6c9f53ef2a348de69481498299577437780
2019-08-24 01:18:27 -07:00
Christopher Ferris
8bccbb01e7 Merge "Use ReadMapFileAsyncSafe in malloc_iterate tests." 2019-08-24 04:12:42 +00:00
Ryan Prichard
665e98edf7 Merge "Add additional dl_phdr_info fields" 2019-08-23 20:45:54 +00:00
Christopher Ferris
8ea85afde5 Use ReadMapFileAsyncSafe in malloc_iterate tests.
This avoids issues where an allocation could create a map while trying
to check data from the maps and running malloc_iterate.

Bug: 137795072

Test: Runs in unit tests.
Change-Id: If8509845d86dd9d002aeac3aa9278fbcf026af17
2019-08-23 10:07:31 -07:00