Commit graph

34432 commits

Author SHA1 Message Date
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
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
Elliott Hughes
977867173a Say which API level fdsan/fdtrack appeared at.
Test: N/A
Change-Id: Id29db9a5ec6a039af95ce3cdd421542ac862f339
2021-04-16 13:57:52 -07:00
Elliott Hughes
508c02fa06 Merge "Force everything to use python3 for consistency." 2021-04-16 20:49:38 +00:00
Elliott Hughes
6b586e7709 Force everything to use python3 for consistency.
Rather than "whatever people have installed as 'python' on their machine".

I've removed check-symbols.py because that's been broken for years and
we never even noticed, and I'm not sure it's worth fixing.

Test: treehugger, manual
Change-Id: Ieb996bbdf790a18d4b1fb46a409cc240ba2a2a49
2021-04-15 13:39:08 -07:00
Treehugger Robot
9cf8871dd9 Merge "Make gensyscalls.py compatible with Python 3." 2021-04-15 17:46:36 +00:00
Rupert Shuttleworth
e99df59d1e Make gensyscalls.py compatible with Python 3.
Test: Fixes bp2build; bazel build //bionic/...
Change-Id: I6ab66e99935b962f1ff99e478c0f55188f31b495
2021-04-15 06:14:48 -04:00
Elliott Hughes
166efcb496 Merge "Make the tests that call readelf(1) less sensitive to whitespace." 2021-04-13 00:25:28 +00:00
Elliott Hughes
ec580d3d07 Make the tests that call readelf(1) less sensitive to whitespace.
Bug: http://b/185168726
Test: treehugger
Change-Id: I13dbbf57c7366966d51b8ea771ec9edd52505e72
2021-04-12 15:56:49 -07:00
Elliott Hughes
27cf254193 Merge "Switch to libbase SilentDeathTest." 2021-04-12 18:39:46 +00:00
Elliott Hughes
f20b021903 Merge "Make res_init() work again." 2021-04-12 17:44:50 +00: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
2b1930afaa Merge "Add tests for inet_nsap_addr()/inet_nsap_ntoa()." 2021-04-12 16:09:23 +00:00
Peter Collingbourne
16b51e62ea Merge "Fix the adb command to push the memory trace files." 2021-04-10 00:12:33 +00:00
Elliott Hughes
c30a1c08ec Add tests for inet_nsap_addr()/inet_nsap_ntoa().
Turns out that "NSAP" is yet another ISO standard that no-one actually
uses: https://en.wikipedia.org/wiki/NSAP_address

Test: treehugger
Change-Id: I73b4d924a8f4d34e3e2f2da00d0d5529db8e97d1
2021-04-09 16:26:40 -07:00
Peter Collingbourne
7bdca8d16f Fix the adb command to push the memory trace files.
Change-Id: If49d084486486c7899d7655175860f7528aac6ce
2021-04-09 15:11:49 -07:00
Treehugger Robot
999d82e51d Merge "Add tests for the untested <wchar.h> functions." 2021-04-09 17:28:31 +00:00
Elliott Hughes
fe50a0cbeb Add tests for the untested <wchar.h> functions.
Test: treehugger
Change-Id: Id3d8852fd195a7238d1fdc70cb1a92b921372717
2021-04-09 09:11:23 -07:00