Commit graph

34598 commits

Author SHA1 Message Date
Nikita Ioffe
8f537e8762 Explicitly set generate_hashtree: false
Non-updatable APEXes are going to be only present on a dm-verity
protected read-only partition. For such APEXes there is no need in
embedding a hashtree.

This is a no-op change in preparation of switching default value of
generate_hashtree to true.

Bug: 190621617
Test: m
Change-Id: I426c1fce37ce63200810d69092660644e13291c2
2021-06-14 22:13:42 +01:00
Colin Cross
34fead98cb Merge "Don't use prefix_symbols for host bionic linker wrapper" 2021-06-14 19:25:36 +00:00
Colin Cross
a0a591a714 Don't use prefix_symbols for host bionic linker wrapper
The only symbol that actually needs a prefix to avoid a collision is
_start, and that can be handled with a copy of begin.S that uses a
"#define" to rename _start to __dlwrap__start. Removing the prefixed
symbols will also allow simplifying the host bionic build process by
letting it directly reference the real _start.

Test: build and run host bionic binary
Change-Id: I50be786c16fe04b7f05c14ebfb74f710c7446ed9
2021-06-14 12:24:25 -07:00
Treehugger Robot
a882cb5d43 Merge "DO NOT MERGE - Merge ab/7272582" 2021-06-14 07:12:30 +00:00
Xin Li
d8bd5bd28f DO NOT MERGE - Merge ab/7272582
Bug: 190855093
Change-Id: I7d0e41fb466c03c7e8a43d2cc4a271902e4f76eb
2021-06-11 17:33:56 -07:00
Peter Collingbourne
be1c013280 Merge "Disable return PAC in __pthread_start." 2021-06-09 01:14:29 +00:00
Christopher Ferris
33b86cc6c1 Merge "Skip the malloc_slack test on native bridge." 2021-06-09 00:11:07 +00:00
Peter Collingbourne
26d83ba7ab Disable return PAC in __pthread_start.
This function doesn't return, but it does appear in stack traces. Avoid
using return PAC in this function because we may end up resetting IA,
which may confuse unwinders due to mismatching keys.

Bug: 189808795
Change-Id: I953da9078acd1d43eb7a47fb11f75caa0099fa12
2021-06-08 16:03:41 -07:00
Christopher Ferris
7c0ce86a00 Skip the malloc_slack test on native bridge.
The allocator for the native bridge is not necessarily going to
allocate the slack data.

Bug: 189606147

Test: Ran on non-native bridge and verified test isn't skipped.
Test: Ran on native bridge and verified test is skipped.
Change-Id: Ia1555be0e9f55896af7ca81830605367133c44a1
2021-06-08 15:33:22 -07:00
Ryan Prichard
8ab7ab147c Merge "Use ro.build.type instead of ro.debuggable" 2021-06-08 21:00:22 +00:00
Treehugger Robot
6236ebd2d6 Merge "Mark abort(3) as nomerge." 2021-06-08 19:15:18 +00:00
Elliott Hughes
504d0488ad Mark abort(3) as nomerge.
Otherwise, since it's `noreturn`, clang will merge multiple call sites
in the same function, destroying information that helps you debug
_which_ call fired from a tombstone.

Bug: https://github.com/android/ndk/issues/1514
Test: treehugger
Change-Id: I7930318a813f6a2220266794f16c0e5e72d32869
2021-06-07 11:20:28 -07:00
Ryan Prichard
546723b2b8 Use ro.build.type instead of ro.debuggable
The LD_CONFIG_FILE test needs to match how Bionic was compiled, and
Bionic only enables LD_CONFIG_FILE for debug builds (i.e. ro.build.type
is "user"). ro.debuggable can be forced on without recompiling Bionic.

Bug: http://b/140324381
Bug: http://b/189422994
Test: bionic unit tests
Change-Id: I139059a7f94d15a5447dab292927606a6bcc48ef
2021-06-04 17:32:51 -07:00
Florian Mayer
9af7da4ff8 Merge "Fix dangling pointer in heapprofd API." 2021-06-03 19:37:58 +00:00
Florian Mayer
85c7838bd9 Fix dangling pointer in heapprofd API.
We would dlopen heapprofd_client.so, which has a static initializer [1]
that passes a pointer to of its functions to heapprofd_client_api.so.
If we dlclose heapprofd_client.so, this pointer is dangling.

[1]: https://cs.android.com/android/platform/superproject/+/master:external/perfetto/src/profiling/memory/malloc_interceptor_bionic_hooks.cc?q=symbol:g_heap_id

Bug: 189332777
Change-Id: Ia4a9d9dd7c89eceec86c6fac5f4b66de85d7604e
2021-06-02 14:48:53 +01:00
Lukács T. Berki
64be12fbc9 Merge "Remove sort_bss_symbols_by_size ." 2021-06-02 08:24:12 +00:00
Lukacs T. Berki
a2b7c3fbec Remove sort_bss_symbols_by_size .
Test: Presubmits.
Change-Id: I03b502e75e0964942ec2bf197722c77542e956db
2021-06-02 08:12:04 +02:00
Christian Wailes
921b3a4642 Merge "Move android_reset_stack_guard to LIBC_S" 2021-05-24 23:23:29 +00:00
Treehugger Robot
e207b4f764 Merge "Turns out we don't need to say calll any more." 2021-05-20 19:02:49 +00:00
Elliott Hughes
ef76860f22 Turns out we don't need to say calll any more.
I don't know when LLVM's x86 assembler started making the same
assumptions as GAS used to, but I'm happy to get rid of "calll".

Test: treehugger
Change-Id: I0a924993aebf7d701a846805fea9a015e8feb58a
2021-05-19 09:14:41 -07:00
Chris Wailes
660ba39b52 Move android_reset_stack_guard to LIBC_S
Test: Declare as external and compile
Bug: 168258494
Change-Id: I32d1c0cc6c150b440baeac458d7753445036b455
2021-05-17 11:42:02 -07:00
Bram Bonné
23e33cf94e Merge "Enable RTM_GETLINK restrictions on all apps" 2021-05-17 13:28:27 +00:00
David Srbecky
453076b8d0 Merge "Update API of MapInfo from libunwindstack" 2021-05-13 09:49:52 +00:00
David Srbecky
92b8d64f41 Update API of MapInfo from libunwindstack
Use accessors to for all the fields.

Test: build
Change-Id: I6ae458002e059ef2f9d73931cc68f2f698f85d7e
2021-05-13 01:50:00 +01:00
Christian Wailes
b1270fdd54 Merge "Clear the stack frame pointer in _start and __bionic_clone" 2021-05-12 22:52:59 +00:00
Collin Fijalkovich
13d267e77e Merge "Add cc_defaults for hugepage alignment of shared libraries" 2021-05-11 16:13:58 +00:00
Collin Fijalkovich
20ab1b7b47 Merge "Bionic: Mark PMD aligned text segments huge page eligible" 2021-05-10 16:11:41 +00:00
Chris Wailes
559f27828c Clear the stack frame pointer in _start and __bionic_clone
This CL adds an instruction to the _start label that clears the frame
pointer.  This allows stack walking code to determine when it has
reached the end of the stack.

The __bionic_clone function is similarly modified, for architectures
that weren't already doing both.

Test: bionic-unit-tests
Test: CtsBionicTestCases
Change-Id: Iea3949f52c44f7931f9fff2d60d4d9e5c742c120
2021-05-07 15:00:55 -07:00
Collin Fijalkovich
47d27aa79c Bionic: Mark PMD aligned text segments huge page eligible
To take advantage of file-backed huge pages for the text segments of key
shared libraries (go/android-hugepages), the dynamic linker must load
candidate ELF files at an appropriately aligned address and mark
executable segments with MADV_HUGEPAGE.

This patches uses segments' p_align values to determine when a file is
PMD aligned (2MB alignment), and performs load operations accordingly.

Bug: 158135888
Test: Verified PMD aligned libraries are backed with huge pages on
supporting kernel versions.

Change-Id: Ia2367fd5652f663d50103e18f7695c59dc31c7b9
2021-05-06 13:15:11 -07:00
Christopher Ferris
3e0defac5d Merge "Update to v5.12 kernel headers." 2021-05-04 17:50:59 +00:00
Christopher Ferris
a9750eda0d Update to v5.12 kernel headers.
Kernel headers coming from:

Git: https://android.googlesource.com/kernel/common/
Branch: android-mainline
Tag: android-mainline-5.12

Test: Boots flame device and runs bionic unit tests.
Test: Boots acloud device and runs bionic unit tests.

Change-Id: I8ac107ce9d4978be3ef9517b90ad6ecafd06785a
2021-05-03 15:01:39 -07:00
Bram Bonné
5a7f3ef9a8 Enable RTM_GETLINK restrictions on all apps
Extend existing restrictions targeting only apps with API level >= 30 to
all apps.

Actual enforcement happens in SELinux. This change just prevents
logspam.

To be merged when automerge to sc-dev ends.

Bug: 170188668
Test: atest bionic-unit-tests-static
Test: atest NetworkInterfaceTest
Test: Connect to Wi-Fi network
Test: atest CtsSelinuxTargetSdk27TestCases
Test: atest CtsSelinuxTargetSdk28TestCasesTest: atest
CtsSelinuxTargetSdk29TestCases
Test: atest CtsSelinuxTargetSdkCurrentTestCases

Change-Id: If1761354216b23a1e55e6b9606de452899afff0c
2021-04-30 15:52:27 +02:00
Collin Fijalkovich
c9521e08ce Add cc_defaults for hugepage alignment of shared libraries
Introduces a cc_defaults category hugepage_aligned that passes the
requisite linker flags to produce shared object files with 2MB-aligned
sections. This enables supporting platforms to back the text segments of
these libraries with hugepages.

Bug: 158135888
Test: Built and confirmed ELF layout
Change-Id: I5c8ce35d8f8bf6647ec19d58398740bd494cc89c
2021-04-29 11:32:43 -07:00
Colin Cross
48166a4eaf Merge "Replace llndk_library with llndk clause in cc_library" 2021-04-28 16:21:43 +00:00
Colin Cross
a0a4a6c296 Replace llndk_library with llndk clause in cc_library
Remove the vestigial llndk_library and replace it with properties
in the llndk clause of the implementation cc_library.

In order to reduce duplication of the arch-specific headers used
by the implementation and LLNDK, rename libc_headers_arch to
libc_llndk_headers and hoist the "include" directory out of it,
since that directory is preproccessed separately for LLNDK
libraries.

Bug: 170784825
Test: m checkbuild
Test: compare out/soong/build.ninja
Change-Id: I75f0ff9129d910640da55eee6a6387467e6e4a9d
2021-04-26 17:45:57 -07:00
Treehugger Robot
4b42ad753e Merge "Reorder libc.llndk headers to match libc_headers_arch" 2021-04-23 02:51:32 +00:00
Peter Collingbourne
2f62c26bcb Merge "Avoid prctl(PR_PAC_RESET_KEYS) on devices without PAC support." 2021-04-22 21:02:42 +00:00
Peter Collingbourne
dcbacd676f Avoid prctl(PR_PAC_RESET_KEYS) on devices without PAC support.
Processes loaded from vendor partitions may have their own sandboxes
that would reject the prctl. Because no devices launched with PAC
enabled before S, we can avoid issues on upgrading devices by checking
for PAC support before issuing the prctl.

Bug: 186117046
Change-Id: I9905b963df01c9007d9fb4527273062ea87a5075
2021-04-22 12:17:01 -07:00
Rupert Shuttleworth
2a79326a80 Merge "Add missing liblog_headers dependency to libc_defaults." 2021-04-22 16:07:20 +00:00
Rupert Shuttleworth
ed80dcd775 Add missing liblog_headers dependency to libc_defaults.
This unblocks several targets building with Bazel, see https://android-review.googlesource.com/c/platform/build/soong/+/1677125.

Test: bp2build; bazel build //bionic/...
Change-Id: I4206241fc56cf4df5d5f1e65a367844da85a1360
2021-04-22 01:52:53 -04:00
Colin Cross
96be371187 Reorder libc.llndk headers to match libc_headers_arch
Ease later comparisons by making libc.llndk match libc_headers_arch.

Bug: 170784825
Test: m checkbuild
Change-Id: I90162c0bc5f6f0e79fe974208fde47cca7489fa1
2021-04-21 16:29:50 -07:00
Christopher Ferris
e6b7969dd1 Merge "Fix last python3 issues." 2021-04-21 20:02:10 +00:00
Treehugger Robot
74dab83037 Merge "Fix overly-zealous strip." 2021-04-21 00:41:19 +00:00
Christopher Ferris
a2142d2835 Fix last python3 issues.
Includes pointing to the python3 version of the clang bindings.

Also, remove stale .gitignore line.

Test: Ran bionic/libc/kernel/tools/update_all.py and verified
Test: the files generated the same exact way.
Change-Id: I4eb9dd7382bca013f70d921b6ef48c7e7478615a
2021-04-20 17:36:07 -07:00
Dan Albert
8607c084c2 Fix overly-zealous strip.
The argument to this is the characters to strip, so `line.strip(line)`
just returns the empty string.

Test: None?
Bug: None
Change-Id: I4f62bffcd00936e4eef837a28b78023fcad54bb0
2021-04-20 16:05:02 -07:00
Christopher Ferris
fae6ff2f9e Merge "Update for python3." 2021-04-20 20:49:48 +00:00
Treehugger Robot
8d36be9bb9 Merge "Ignore backup files left by emacs." 2021-04-20 01:24:49 +00:00
Christopher Ferris
ac7ec11473 Update for python3.
This fixes all of the problems with our kernel scripts, but not
the clang python script problems.

I also removed the updateGitFiles function since that code was
just silently failing any way. I replaced all calls with updateFiles.

Test: Ran script using python2 to verify it still works.
Test: Run script in python3 verifying that it starts to run.

Change-Id: I223a31a8324c59e6bc4067f48a6110361b3e26e8
2021-04-19 17:02:38 -07:00
Dan Albert
77d976cd65 Ignore backup files left by emacs.
Test: Added a file like this locally and the upload hook didn't care
Bug: None
Change-Id: I4c33f2517a9a83c7797d3ea9074fffeedf85dcaa
2021-04-19 14:05:59 -07:00
Treehugger Robot
b82fcdaf36 Merge "Say which API level fdsan/fdtrack appeared at." 2021-04-17 00:22:25 +00:00