Commit graph

31584 commits

Author SHA1 Message Date
Evgenii Stepanov
b5f301eaaf Merge "Revert "Add randomized padding around shared library mappings."" 2020-07-06 22:18:45 +00:00
Evgenii Stepanov
474f2f5c8b Revert "Add randomized padding around shared library mappings."
This reverts commit a8cf3fef2a.

Reason for revert: memory regression due to the fragmentation of the page tables
Bug: 159810641
Bug: 158113540

Change-Id: I6212c623ff440c7f6889f0a1e82cf7a96200a411
2020-07-06 19:27:55 +00:00
Kiyoung Kim
9963adb975 Merge "Disable warning message for missing linker config in some cases" 2020-07-01 08:03:41 +00:00
Kiyoung Kim
46e731caf5 Disable warning message for missing linker config in some cases
There are some special cases - such as init process - when linker
configuration is not expected to exist. This change disables warning
message that generated linker configuration does not exist in those
cases.

Bug: 158800902
Test: Tested from cuttlefish that warning message is not generated from
init

Change-Id: Ie2fbb5210175cf1e6f2b7e638f57c3b74d395368
2020-06-30 09:21:07 +09:00
Treehugger Robot
29cff99e08 Merge "Improve diagram in malloc_heapprofd." 2020-06-29 20:55:35 +00:00
Florian Mayer
c618960288 Improve diagram in malloc_heapprofd.
Include the functions that cause the state transitions.

Change-Id: I262e74c58e12316996451c418ab222f4512d005c
2020-06-26 14:27:58 +02:00
Treehugger Robot
b76e8e610c Merge "strings.h: undef ffs/ffsl/ffsll." 2020-06-25 19:11:08 +00:00
Elliott Hughes
c9889fdf15 strings.h: undef ffs/ffsl/ffsll.
Protect against software that #defines these, such as mesa3d.

Test: treehugger
Change-Id: I22e937423967676ea332956289419d48bb7c2cd3
2020-06-25 08:46:06 -07:00
Christopher Ferris
d381b26576 Merge "Remove references to libc_scudo." 2020-06-24 03:16:47 +00:00
Treehugger Robot
536b7ec5ac Merge "Revert "Disallow vmsplice(2) for all zygote-spawned processes."" 2020-06-23 19:44:54 +00:00
Elliott Hughes
b477ac74e7 Revert "Disallow vmsplice(2) for all zygote-spawned processes."
This reverts commit 3d1bd8efbe.

Reason for revert: http://b/159712722

The original test (`atest --test-mapping packages/providers/MediaProvider`) passed in AOSP, but there's a new use of vmsplice() in rvc-dev.

Bug: http://b/157591659
Bug: http://b/159712722
Change-Id: Icc9b752ca4fa21f7e18c409b55f3977b7460bfbe
Test: treehugger
2020-06-23 17:53:35 +00:00
Elliott Hughes
fffb59149e Merge "Simplify tzdata fallback logic." 2020-06-23 15:14:45 +00:00
Christopher Ferris
ef707f9056 Remove references to libc_scudo.
As scudo is now the default native allocator, there is no need to
keep this library around.

Test: Builds and walleye boots.
Change-Id: Id2918544651348854956d1348d2a634f6425b952
Merged-In: Id2918544651348854956d1348d2a634f6425b952
(cherry picked from commit 941ad56299)
2020-06-22 15:27:52 -07:00
Elliott Hughes
528e29d91c Simplify tzdata fallback logic.
It's a historical accident that we try all the other files even if a
higher-priority file doesn't contain the sought-for olson id. Stop
doing that.

Also remove a TODO that has never been warranted, and add one that it
will be many years before anyone can do anything about it, but by that
time the historical knowledge may have been lost.

Bug: http://b/159613340
Test: treehugger
Change-Id: I873579268753c84b0bb721ea56f71ba64506d45a
2020-06-22 12:55:12 -07:00
Treehugger Robot
c17236ee78 Merge "Skip MTE tests with native_bridge" 2020-06-22 18:15:52 +00:00
Elliott Hughes
933454f141 Merge "Disallow vmsplice(2) for all zygote-spawned processes." 2020-06-22 17:59:18 +00:00
Evgeny Eltsin
ed51fb9a07 Skip MTE tests with native_bridge
With native_bridge, native and emulated parts exchange data, including
pointers. If tagging on native architecture is different from tagging on
emulated architecture, all the pointers in the data exchange must be
identified and marshalled, which is hardly feasible.

Disable MTE tests with native_bridge.

Bug: 135772972
Bug: 159352723
Test: bionic-unit-tests --gtest_filter=*mte*
Change-Id: Icba90636173e9e71036def5302c7d0a09dd8873b
2020-06-22 18:49:16 +02:00
Elliott Hughes
3d1bd8efbe Disallow vmsplice(2) for all zygote-spawned processes.
Bug: http://b/157591659
Test: treehugger
Test: atest --test-mapping packages/providers/MediaProvider
Change-Id: I6adfc6060f6382e70383f10fce4e65b09acd1dd0
2020-06-19 15:49:19 -07:00
Evgenii Stepanov
cd1c8b0e84 Merge "Add randomized padding around shared library mappings." 2020-06-19 18:04:13 +00:00
Evgenii Stepanov
a8cf3fef2a Add randomized padding around shared library mappings.
Improve ASLR by increasing the randomly sized gaps between shared
library mappings, and keep them mapped PROT_NONE.

Bug: 158113540
Test: look at /proc/$$/maps
Change-Id: Ie72c84047fb624fe2ac8b7744b2a2d0d255ea974
2020-06-17 17:28:28 -07:00
Elliott Hughes
ad4b47c429 Merge "Don't look for licenses in .md files and pylintrc files." 2020-06-16 15:38:39 +00:00
Elliott Hughes
da45ea6687 Merge "Update libc/NOTICE." 2020-06-16 00:35:59 +00:00
Elliott Hughes
c5db38a4bb Don't look for licenses in .md files and pylintrc files.
Also be quiet about public domain files unless asked to be verbose.

Test: ./libc/tools/generate-NOTICE.py
Change-Id: Ia7e4d42870b2ef4b0b77a11093eefa4f117bebaf
2020-06-15 17:26:58 -07:00
Treehugger Robot
31e3ec3e10 Merge "Use more inclusive language." 2020-06-15 20:17:28 +00:00
Treehugger Robot
43b06e5701 Merge "Use more inclusive language for seccomp filter" 2020-06-15 18:25:01 +00:00
Elliott Hughes
8c936b4e6c Use more inclusive language.
One turns out not to be used at all, and the pylintrc even uses the more
intention-revealing term in the machine readable part, just not the
comment!

Test: treehugger
Change-Id: I4db7f1cf4fa1aa8ee601857e4e4c400e2119887c
2020-06-15 11:18:43 -07:00
Elliott Hughes
5e93ee2b02 Update libc/NOTICE.
Someone skipped the presubmit hooks :-(

Test: N/A
Change-Id: I434a76ffc0aec7661f335def490daf54e0d97c12
2020-06-15 11:03:27 -07:00
Victor Hsieh
dbb8670dfd Use more inclusive language for seccomp filter
blacklist and whitelist are replaced with blocklist and allowlist
respectively.

Test: CtsSeccompHostTestCases
Change-Id: I39d9eda89038d1addbdaed59284a254a34cea1c6
2020-06-15 10:12:17 -07:00
Treehugger Robot
4ea659a7c6 Merge "Use PROT_NONE on the unused parts of CFI shadow." 2020-06-13 01:49:13 +00:00
Evgenii Stepanov
071416b700 Use PROT_NONE on the unused parts of CFI shadow.
This replaces a single 2Gb readable memory region with a bunch of tiny
regions, and leaves the bulk of 2Gb mapped but unaccessible. This makes
it harder to defeat ASLR by probing for the CFI shadow region.

Sample CFI shadow mapping with this change:
7165151000-716541f000 ---p 00000000 00:00 0                              [anon:cfi shadow]
716541f000-7165420000 r--p 00000000 00:00 0                              [anon:cfi shadow]
7165420000-71654db000 ---p 00000000 00:00 0                              [anon:cfi shadow]
71654db000-71654dc000 r--p 00000000 00:00 0                              [anon:cfi shadow]
71654dc000-71654dd000 r--p 00000000 00:00 0                              [anon:cfi shadow]
71654dd000-71654f0000 ---p 00000000 00:00 0                              [anon:cfi shadow]
71654f0000-71654f1000 r--p 00000000 00:00 0                              [anon:cfi shadow]
71654f1000-71e5151000 ---p 00000000 00:00 0                              [anon:cfi shadow]

This change degrades CFI diagnostics for wild jumps and casts (i.e. when
the target of a CFI check is outside of any known library bounds). This
is acceptable, because CFI does not have much to tell about those cases
anyway. Such bugs will show up as SEGV_ACCERR crashes inside
__cfi_slowpath in libdl.so from now on.

Bug: 158113540
Test: bionic-unit-tests/cfi_test.*
Test: adb shell cat /proc/$PID/maps | grep cfi

Change-Id: I57cbd0d3f87eb1610ad99b48d98ffd497ba214b4
Merged-In: I57cbd0d3f87eb1610ad99b48d98ffd497ba214b4
2020-06-12 12:22:32 -07:00
Elliott Hughes
2dced5bfbb Merge "Update upstream OpenBSD gdtoa." 2020-06-11 22:53:50 +00:00
Elliott Hughes
cdb4a26d29 Update upstream OpenBSD gdtoa.
Also add a test for the bug that this fixes.

Bug: http://b/152588929
Test: treehugger
Change-Id: I58055b3ebaef457721bb4f5d8a8710025122b2e7
2020-06-11 12:57:37 -07:00
Peter Collingbourne
dc39f6e23b Merge "Adopt remaining MTE string routines." 2020-06-11 19:30:15 +00:00
Treehugger Robot
86a8696cfb Merge "linker: CHECK() or async_safe_fatal() rather than abort()." 2020-06-11 16:01:49 +00:00
Peter Collingbourne
2361d4ef80 Adopt remaining MTE string routines.
ARM has released the remaining MTE string routines, so let's start
using them. The strnlen implementation is now compatible with MTE,
so it no longer needs to be an ifunc.

Bug: 135772972
Change-Id: I9de7fb44447aa1b878f4ad3f62cb0129857b43ad
2020-06-11 08:52:26 -07:00
Elliott Hughes
3205cddff0 linker: CHECK() or async_safe_fatal() rather than abort().
In particular, add the strerror() output if mprotect() fails.

Fix the CHECK macro so that you can make assertions involving operator%
without that being confused for a printf format specifier.

Bug: https://issuetracker.google.com/158645318
Test: treehugger
Change-Id: I6817f8ca5f094c52dc2c9067bfac90385a8743f5
2020-06-10 14:49:28 -07:00
Victor Khimenko
7ea9c1630a Merge "Move exit.c from stdlib to bionic subdirectory." 2020-06-10 16:11:32 +00:00
Victor Khimenko
8e0707d82c Move exit.c from stdlib to bionic subdirectory.
Test: make

Change-Id: I2182d5a7c97abc0335e88d2d9dd9f77bc7e7f633
2020-06-10 16:38:05 +02:00
Treehugger Robot
79686ca145 Merge "fortify: remove static" 2020-06-10 00:37:58 +00:00
George Burgess IV
e0a14d4c8a fortify: remove static
When glancing at libc.so, I noticed we had five copies of
`__fortify_fatal` sitting around. LLVM can't inline variadic functions;
allowing everything to reference the same one seems best to me. This
saves us a few hundred bytes. Whoopee.

Bug: None
Test: TreeHugger
Change-Id: I99188d49cd46d792e3167cb961f13b3c1b65bd61
2020-06-09 16:03:42 -07:00
Evgeny Eltsin
15cbad3f59 Merge "Skip pthread.pthread_create__mmap_failures with native_bridge" 2020-06-09 19:38:23 +00:00
Evgeny Eltsin
b1a2529546 Merge changes from topic "skip_with_native_bridge"
* changes:
  Skip pthread_leak* tests with native_bridge
  Add util to skip tests with native_bridge
2020-06-09 19:38:23 +00:00
Evgeny Eltsin
45b36c2921 Skip pthread_leak* tests with native_bridge
Bug: 37920774
Bug: 157394871
Test: bionic-unit-tests --gtest_filter=*leak*
Change-Id: Ifc5b66e4b640d1abae4dcf8dbc28612d24c7e972
2020-06-09 19:24:25 +02:00
Evgeny Eltsin
b4f7aaac5c Skip pthread.pthread_create__mmap_failures with native_bridge
The test reserves all memory but the minimum required to create a
thread. However, after the thread is created, native_bridge needs more
memory to translate and run the thread function.

This might be prevented by native_bridge preallocating a memory buffer
to be used for translation. But, first, this complication seems to be
needed just for this kind of tests, and, second, it is pretty flaky
regarding changes both in native_bridge and bionic.

Looks better to disable this test with native_bridge.

Bug: 67745607
Bug: 148608153
Bug: 157394871
Test: bionic-unit-tests --gtest_filter=pthread.pthread_create__mmap_failures
Change-Id: I42ce2b5a01a7d9f10d952a5fc7b75d51fa89072a
2020-06-09 15:58:49 +02:00
Evgeny Eltsin
b56d1182d1 Add util to skip tests with native_bridge
Bug: 37920774
Bug: 157394871
Test: bionic-unit-tests
Change-Id: Id949c9e568fd068daaf405a377813ee1480c2df7
2020-06-08 21:12:56 +02:00
Treehugger Robot
9f2e171900 Merge "Remove dead code." 2020-06-08 17:25:01 +00:00
Treehugger Robot
4dd8760cc4 Merge "Factor out error reporting in WriteProtected." 2020-06-08 17:12:04 +00:00
Elliott Hughes
1e381a2429 Factor out error reporting in WriteProtected.
Partly to buff our coverage numbers, but also for improved consistency
in error reporting.

Test: treehugger
Change-Id: Iffc32833a35f9e9535c1bc3e0f7cb3c4bbba5f7f
2020-06-08 08:41:27 -07:00
Elliott Hughes
9253757ff2 Remove dead code.
pirama made me do this.

Test: treehugger
Change-Id: I3af9157e246ae4f3d4dc388332dc63b730066f91
2020-06-08 08:33:54 -07:00
Treehugger Robot
86345218ce Merge "Need prebuilt linker executable for host Bionic." 2020-06-08 13:28:37 +00:00