Commit graph

31652 commits

Author SHA1 Message Date
Stephen Hines
9c6d60d073 Merge "Specify sections to merge in segment_gap_outer.lds more precisely" 2020-07-24 22:10:28 +00:00
Stephen Hines
15027e048f Specify sections to merge in segment_gap_outer.lds more precisely
https://reviews.llvm.org/D75225 changed the way that orphan sections are
retained, breaking this test. The test relied on these sections being
merged in an implementation-defined order that no longer holds true. We
can use custom sections to place the symbols we want more precisely.

Bug: http://b/161943302
Test: adb shell /data/nativetest64/bionic-unit-tests/bionic-unit-tests --gtest_filter=dlfcn.segment_gap --no_isolate
Change-Id: I65656080e39be16833191cb92d3d4c41e409b216
2020-07-24 10:57:48 -07:00
Treehugger Robot
a83577ab13 Merge "Cleanup for #inclusivefixit." 2020-07-24 16:51:35 +00:00
Treehugger Robot
613334b302 Merge "Cleanup for #inclusivefixit." 2020-07-24 10:28:07 +00:00
Elliott Hughes
3f3161093b Cleanup for #inclusivefixit.
Test: treehugger
Change-Id: Iec1af942b5dee37f08ad390afe9fbdb79c47c085
2020-07-23 13:43:23 -07:00
Elliott Hughes
cfd8f581fa Cleanup for #inclusivefixit.
The comment and pragma for GCC genuinely don't seem to be needed for
Clang.

Clarify the comment about the two ways in which clang_fortify_tests.cpp
is used.

Test: treehugger
Change-Id: Icb48a5848c005104ab2d2456da3978bbaf7e158c
2020-07-23 13:41:53 -07:00
Elliott Hughes
6ba173a3f6 Merge "Changes for #inclusivefixit." 2020-07-22 19:26:37 +00:00
Neil Fuller
9b7338c6bb Merge "Track name changes in the tzdata format" 2020-07-22 09:50:10 +00:00
Bram Bonné
4378ced55d Merge "Resolve interface flags using SIOCGIFFLAGS ioctl" 2020-07-22 07:45:56 +00:00
Elliott Hughes
68ae6ad12e Changes for #inclusivefixit.
Test: treehugger
Change-Id: I7ff0496c5c2792a41781e74634247f55b0548213
2020-07-21 16:34:58 -07:00
Evgenii Stepanov
c79ea23941 Merge "Remove stack address check in cfi_basic test." 2020-07-21 19:58:18 +00:00
Evgenii Stepanov
67406dced7 Merge "Pagetable-friendly shared library address randomization." 2020-07-21 19:50:55 +00:00
Bram Bonné
8e20ac4413 Resolve interface flags using SIOCGIFFLAGS ioctl
Normally, getifaddrs() gets its information about interface flags from
RTM_NEWLINK messages. With the ability for non-system apps to send
RTM_GETLINK messages going away, resolve these flags by performing a
SIOCGIFFLAGS ioctl call instead.

This fixes a bug where the flags were erroneously copied over from an
ifaddrmsg's ifa_flags.

Bug: 141455849
Test: atest bionic-unit-tests-static
Test: Connect to wireless network.
Test: Call getifaddrs() from a non-system app targeting API R+, verify
that the interface flags are correct.

Change-Id: I552f3b9d21072f59ee6f0890f47cb1bdf3cfcf20
2020-07-21 19:14:12 +02:00
Evgenii Stepanov
0f6b504e0c Remove stack address check in cfi_basic test.
This is not actually a property that is guaranteed by the bionic
implementation of CFI shadow. Since the gaps between libraries are not
completely inaccessible, it is possible for a stack mapping to sneak in,
which would cause the callback to register in the test library.

This is not a correctness issue in CFI as the actual __cfi_check
callback will reject such address anyway, at a small CPU cost.

Bug: 156218352
Test: CtsBionicTestCases-cfi_test#basic
Change-Id: I8d04fb7132e1eac2a8abfbc48a37c8eac6e25a09
2020-07-20 15:52:06 -07:00
Evgenii Stepanov
e0848bbf89 Pagetable-friendly shared library address randomization.
Add inaccessible gaps between shared libraries to make it harder for the
attackers to defeat ASLR by random probing.

To avoid excessive page table bloat, only do this when a library is
about to cross a huge page boundary, effectively allowing several
smaller libraries to be lumped together.

Bug: 158113540
Test: look at /proc/$$/maps
Change-Id: I39c0100b81f72447e8b3c6faafa561111492bf8c
2020-07-16 13:57:20 -07:00
Tom Cherry
a96099e130 Merge "Don't test pw_shell for old vendor images" 2020-07-10 19:26:23 +00:00
Tom Cherry
b9fa04d805 Don't test pw_shell for old vendor images
R GSI on P product tests fail since pw_shell has changed.  This value
has no practical use on Android, so we ignore testing it for older
vendor images.

Bug: 160937247
Test: this test does/doesn't run appropriately
Change-Id: Ie485bd019b3826e71ad19131effcbb002f888d52
2020-07-10 10:42:16 -07:00
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