Commit graph

34084 commits

Author SHA1 Message Date
Bram Bonné
1e32ae2da2 Merge "Revert^2 "Soft-enables new MAC address restrictions."" 2020-11-25 09:59:25 +00:00
Treehugger Robot
d0ef99a94a Merge "[GWP-ASan] Remove include." am: 50a7621b3f
Original change: https://android-review.googlesource.com/c/platform/bionic/+/1506876

Change-Id: Ic00ff84ba9f80ced052378b64fdfb9e300f1c77c
2020-11-20 04:50:15 +00:00
Treehugger Robot
50a7621b3f Merge "[GWP-ASan] Remove include." 2020-11-20 04:19:54 +00:00
Mitch Phillips
742a003db6 [GWP-ASan] Remove include.
Unnecessary include, and the file was deleted with upstream changes.

Bug: N/A
Test: cd external/gwp_asan && atest
Change-Id: Id8facff0c5e382aa639ce158b7b5862ce157aa25
2020-11-19 16:01:14 -08:00
Peter Collingbourne
47fc123b00 Merge "Change the android_mallopt(M_SET_HEAP_TAGGING_LEVEL) API." am: 097846e25b
Original change: https://android-review.googlesource.com/c/platform/bionic/+/1484976

Change-Id: Ib4f69f7730efa4ad2eea56cc529c513fce6220fc
2020-11-18 21:39:12 +00:00
Peter Collingbourne
097846e25b Merge "Change the android_mallopt(M_SET_HEAP_TAGGING_LEVEL) API." 2020-11-18 20:57:36 +00:00
Peter Collingbourne
9eb85bf70c Change the android_mallopt(M_SET_HEAP_TAGGING_LEVEL) API.
- Make it apply to every thread, and thus remove the restriction
  that it must be called while the program is single threaded.
- Make it change TCF0 itself (on all threads), instead of requiring
  callers to do it themselves, which can be error prone.

And update all of the call sites.

Change the implementation of
android_mallopt(M_DISABLE_MEMORY_MITIGATIONS) to call
android_mallopt(M_SET_HEAP_TAGGING_LEVEL) internally. This avoids
crashes during startup that were observed when the two mallopts
updated TCF0 unaware of each other.

I wouldn't expect there to be any out-of-tree callers at this point,
but it's worth noting that the new interface is backwards compatible
with the old one because it strictly expands the set of situations in
which the API can be used (i.e. situations where there are multiple
threads running or where TCF0 hadn't been updated beforehand).

Bug: 135772972
Change-Id: I7746707898ff31ef2e0af01c4f55ba90b72bef51
2020-11-18 10:24:29 -08:00
Bram Bonné
53211a98dc Revert^2 "Soft-enables new MAC address restrictions."
259776d8ff

The original change was reverted due to InterfaceParamsTest failing.
This test has now been fixed in r.android.com/1498525.
The original change message is below.

Updates getifaddrs() to behave as if RTM_GETLINK requests are not
allowed for non-system apps. This is different from previous behavior,
where apps targeting an API level < 30 were exempted from this
restriction.

Actual enforcement happens in SELinux. This change:
- Soft-enables the behavior until SELinux changes are in place
- Prevents logspam from SELinux denials after they are in place

Bug: 170188668
Test: atest bionic-unit-tests-static
Test: atest NetworkInterfaceTest
Test: Connect to Wi-Fi network
Test: Call getifaddrs() directly from within an app.
Test: Call NetworkInterface#getNetworkInterfaces() from within an app.

Change-Id: Ia9f61819f8fdf878c0e67e57de7e893fb3b1c233
2020-11-16 12:53:49 +00:00
Tej Singh
120de14891 Merge "Revert "Soft-enables new MAC address restrictions."" am: 92b8588f17
Original change: https://android-review.googlesource.com/c/platform/bionic/+/1499099

Change-Id: I3256c2be2bb74ff8cf56eabf557dba1eeca6758d
2020-11-14 02:09:14 +00:00
Tej Singh
92b8588f17 Merge "Revert "Soft-enables new MAC address restrictions."" 2020-11-14 01:59:33 +00:00
Tej Singh
259776d8ff Revert "Soft-enables new MAC address restrictions."
Revert "Enforce RTM_GETLINK restrictions on all 3p apps"

Revert "Updates tests for untrusted app MAC address restrictions"

Revert submission 1450615-mac-address-restrictions

Reason for revert: DroidMonitor: Potential culprit for Bug 173243616 - verifying through Forrest before revert submission. This is part of the standard investigation process, and does not mean your CL will be reverted

Reverted Changes:
I08c709b2b:Enforce RTM_GETLINK restrictions on all 3p apps
I95d124ae8:Soft-enables new MAC address restrictions.
I5392f8339:Updates tests for untrusted app MAC address restri...
I9d214c5d0:Return anonymized MAC for apps targeting SDK < 30

Change-Id: If09920b24370077d647d60cfda7fc0a110b77851
2020-11-13 22:27:15 +00:00
Bram Bonné
342177a8ea Merge "Soft-enables new MAC address restrictions." am: 7433096f06
Original change: https://android-review.googlesource.com/c/platform/bionic/+/1450615

Change-Id: If1d487293d3f2c61be0496271339cb07fbea792d
2020-11-12 17:34:50 +00:00
Bram Bonné
7433096f06 Merge "Soft-enables new MAC address restrictions." 2020-11-12 17:07:11 +00:00
Treehugger Robot
190ae56561 Merge "Add "product_available" to product available modules" am: 8037f54614
Original change: https://android-review.googlesource.com/c/platform/bionic/+/1495578

Change-Id: Ia12ce79cd9e67fa9e3684c35acf012cc5de1329b
2020-11-12 00:02:55 +00:00
Treehugger Robot
8037f54614 Merge "Add "product_available" to product available modules" 2020-11-11 23:43:57 +00:00
Justin Yun
869a0faf21 Add "product_available" to product available modules
"vendor_available" modules were available to product modules.
However, not all "vendor_available" modules are required to be
available to product modules. Some modules want to be available only
to product modules but not vendor modules.

To cover the requirement, we separate "product_available" from
"vendor_available".
"vendor_available" will not provide product available module.

Bug: 150902910
Test: build
Change-Id: I13b8222e191333c6c2cb7794ef3344fdcc6ebe98
2020-11-11 15:29:47 +09:00
Treehugger Robot
e9c73415e2 Merge "Disable failing test __cxa_demangle#cxa_demangle_fuzz_167977068." am: f4afda9773
Original change: https://android-review.googlesource.com/c/platform/bionic/+/1494836

Change-Id: Ia6d5f725844bc9eb40acbe04edb968cb5f23f9ef
2020-11-10 23:57:58 +00:00
Treehugger Robot
f4afda9773 Merge "Disable failing test __cxa_demangle#cxa_demangle_fuzz_167977068." 2020-11-10 23:37:43 +00:00
Elliott Hughes
8589e0909c Disable failing test __cxa_demangle#cxa_demangle_fuzz_167977068.
Not sure what the problem is yet, and can't guarantee I'll have time to
look this week, so let's disable this for now...

Bug: http://b/172465723
Test: treehugger
Change-Id: I052c2ed876504581cb89e49f1c65c3232d213eb5
2020-11-10 11:31:51 -08:00
Elliott Hughes
7d10fa26c4 Merge "linker: add ld.config.txt parse time to systrace." am: 6fc751cca8
Original change: https://android-review.googlesource.com/c/platform/bionic/+/1490341

Change-Id: Ia783e662231125da59a8f116f57f51c1fe800667
2020-11-09 23:28:39 +00:00
Elliott Hughes
6fc751cca8 Merge "linker: add ld.config.txt parse time to systrace." 2020-11-09 21:35:43 +00:00
Elliott Hughes
658b938700 linker: add ld.config.txt parse time to systrace.
Bug: http://b/172640358
Test: treehugger
Change-Id: I9d6b7c1e200d2effb737508d3c282063edefa888
2020-11-06 09:28:16 -08:00
Treehugger Robot
d04f66d534 Merge "Improve __cxa_demangle#cxa_demangle_fuzz_167977068 diagnostics." am: 55180dda00
Original change: https://android-review.googlesource.com/c/platform/bionic/+/1489087

Change-Id: I4dd24a521e3e49985edfaee8cc7f2b025ec1a79c
2020-11-06 17:13:06 +00:00
Treehugger Robot
55180dda00 Merge "Improve __cxa_demangle#cxa_demangle_fuzz_167977068 diagnostics." 2020-11-06 17:02:22 +00:00
Elliott Hughes
f266f26cb7 Improve __cxa_demangle#cxa_demangle_fuzz_167977068 diagnostics.
Bug: http://b/172465723
Test: treehugger
Change-Id: I253a164f95705bd0cebe06483011b08187072691
2020-11-05 16:23:39 -08:00
Peter Collingbourne
1858385a3c Merge "Clear PAC bits in android_unsafe_frame_pointer_chase()." am: 56f1c406a5
Original change: https://android-review.googlesource.com/c/platform/bionic/+/1482076

Change-Id: I217882d2390932b700eff96362311841bf641c9d
2020-11-04 02:15:18 +00:00
Peter Collingbourne
56f1c406a5 Merge "Clear PAC bits in android_unsafe_frame_pointer_chase()." 2020-11-04 01:32:49 +00:00
Ryan Prichard
9d5e9ea82a Merge "Put __*_ARRAY__ symbols before prioritized init/fini funcs" am: e9eae51539
Original change: https://android-review.googlesource.com/c/platform/bionic/+/1472582

Change-Id: I33424f313d7b8906f177d4046d39c91fe32c8d93
2020-11-03 22:48:11 +00:00
Ryan Prichard
e9eae51539 Merge "Put __*_ARRAY__ symbols before prioritized init/fini funcs" 2020-11-03 22:19:57 +00:00
Elliott Hughes
9cfef8d7fd Merge "Add a couple of demangler tests." am: 718a5fd73e
Original change: https://android-review.googlesource.com/c/platform/bionic/+/1475337

Change-Id: Ie78528e48ede269165009b4ac2fa781a4d682a85
2020-11-03 19:58:10 +00:00
Elliott Hughes
718a5fd73e Merge "Add a couple of demangler tests." 2020-11-03 18:40:34 +00:00
Matthew Maurer
de30635eb6 Put __*_ARRAY__ symbols before prioritized init/fini funcs
A constructor or destructor function with an integral priority is
placed in an .init_array or .fini_array section with the priority
suffixed to the section name:
 - __attribute__((constructor)) ==> .init_array
 - __attribute__((constructor(42))) ==> .init_array.42

The suffixed init/fini sections appear before the unsuffixed sections,
so the prioritized functions appeared before the __{INIT,FINI}_ARRAY__
symbols and were dropped when the symbols were used.

The (static) linker doesn't recognize priority suffixes on
.preinit_array.

This bug affected .init_array and .fini_array for static executables.
For dynamic executables, only .fini_array was affected, because
.init_array is handled by the dynamic loader instead, which uses
DT_INIT_ARRAY[SZ]. For DSOs, neither is affected, because the two
sections are only handled by the dynamic loader.

This patch also fixes a minor inconsistency where dynamic init/preinit
were passed argc/argv/envp, but static were not.

Bug: http://b/170983066
Test: bionic-unit-tests
Change-Id: I0fffa776e5d9bdb6f8af06b4c1af148236742fef
2020-11-02 17:28:41 -08:00
Elliott Hughes
413817f69c Add a couple of demangler tests.
Bug: http://b/152588929
Test: treehugger
Change-Id: I4528e464f969e9167d459f292b179d14381d0f2e
2020-11-02 20:46:19 +00:00
Elliott Hughes
cfcb749e41 Merge "Docs: link to the unwinder docs." am: 0c2350413e
Original change: https://android-review.googlesource.com/c/platform/bionic/+/1482722

Change-Id: I2397f2857d70e778cdcb738b0e4433b6a2664acc
2020-11-02 20:45:48 +00:00
Elliott Hughes
0c2350413e Merge "Docs: link to the unwinder docs." 2020-11-02 20:09:01 +00:00
Elliott Hughes
0427760a54 Docs: link to the unwinder docs.
Since (a) they're not a README.md and (b) they moved git project
recently, it's really hard to find these docs even if you know they
exist, which no-one does.

Test: N/A
Change-Id: Ic12e47ef5eb09e692ac0974b1d33bc5dc83d1028
2020-10-30 16:36:16 -07:00
Peter Collingbourne
a5c4b17e13 Clear PAC bits in android_unsafe_frame_pointer_chase().
Bug: 172057932
Change-Id: Ie0eb4800a6699f2094070e97e5157d4e9c186097
2020-10-30 14:36:37 -07:00
Treehugger Robot
04bf04485c Merge "getgrnam, getgrgid, getpwnam, getpwuid for host" am: 10c2875934
Original change: https://android-review.googlesource.com/c/platform/bionic/+/1474736

Change-Id: I951286a4d3cfc37c068c4448c12fb24158b677c1
2020-10-30 00:08:57 +00:00
Treehugger Robot
10c2875934 Merge "getgrnam, getgrgid, getpwnam, getpwuid for host" 2020-10-29 23:53:50 +00:00
Yifan Hong
cf69efe25c Merge "Make vendor_ramdisk_available." am: 02bee7182e
Original change: https://android-review.googlesource.com/c/platform/bionic/+/1469699

Change-Id: I854236775104d3a41953213d468b390e68f94c4f
2020-10-29 17:49:01 +00:00
Yifan Hong
02bee7182e Merge "Make vendor_ramdisk_available." 2020-10-29 17:17:29 +00:00
Jiyong Park
bf383283d9 getgrnam, getgrgid, getpwnam, getpwuid for host
The functions now read /etc/group and /etc/passwd on host machines.
Android-specific IDs are not recognized in the host.

getpwent and getgrent are still not working though. They require a
bigger refactoring to sequentially advance in the database files.

Bug: 171718702
Test: run assemble_cvd in aosp_cf_arm64_phone
Change-Id: Ie8da382a467bbd0bffac7b4b8592cd871db80181
2020-10-29 07:52:54 +09:00
Yifan Hong
b04490d7e5 Make vendor_ramdisk_available.
Test: pass
Bug: 156098440
Change-Id: I8fe2deb8fa3b24c227202be02d8af648629cffeb
2020-10-27 17:06:45 -07:00
Treehugger Robot
d4d80bebeb Merge "system(3) uses /bin/sh when built for host" am: c3ecfb623f
Original change: https://android-review.googlesource.com/c/platform/bionic/+/1473958

Change-Id: Id9f3c0f53d1527547184164ff4f2bc640eca7e60
2020-10-26 19:58:27 +00:00
Treehugger Robot
c3ecfb623f Merge "system(3) uses /bin/sh when built for host" 2020-10-26 19:28:27 +00:00
Elliott Hughes
7873005996 Merge "Add DoNotOptimize and use it in tests." am: 40aed73b5f
Original change: https://android-review.googlesource.com/c/platform/bionic/+/1471242

Change-Id: I7aacc5d1fb159f1f79e103926a93ceac73fb6ddc
2020-10-26 17:02:32 +00:00
Elliott Hughes
40aed73b5f Merge "Add DoNotOptimize and use it in tests." 2020-10-26 16:19:05 +00:00
Jiyong Park
8dd649deac system(3) uses /bin/sh when built for host
/system/bin/sh exists only on Android. When Bionic is built for the
host, use the standard /bin/sh.

Bug: 159685774
Test: run aosp_cf_arm64_phone on rockpi4
Change-Id: Idf4028c134abc128f203fc4d3be591f06b8fe8ff
2020-10-26 22:02:53 +09:00
Colin Cross
61b79a919b Merge "Make the connection between implementation and llndk_library explicit" am: c44b1d0676
Original change: https://android-review.googlesource.com/c/platform/bionic/+/1466458

Change-Id: I0d153e308134f1725d3bda95a3057f319e7604f8
2020-10-23 19:00:06 +00:00
Colin Cross
c44b1d0676 Merge "Make the connection between implementation and llndk_library explicit" 2020-10-23 18:09:42 +00:00