Commit graph

36251 commits

Author SHA1 Message Date
Christopher Ferris
8cfc318a87 Merge "In android_set_abort_message, check for nullptr." 2022-04-12 23:33:59 +00:00
Christopher Ferris
bbf9cd86ca In android_set_abort_message, check for nullptr.
If a process is failing due to out of memory, some code calls
android_set_abort_message with a nullptr. Specifically, the libc++
library std::terminate can call do this. In this case, put a
null in the abort message.

Test: Call with nullptr and verify the code does not crash.
Test: Modified crasher to set an abort message and set a null abort
Test: message. Ran both, verified the abort message displays in
Test: first case, and doesn't display in the second case.
Change-Id: Ia9250f47e4537853ce93bbb20b35915a78caa502
2022-04-12 13:46:48 -07:00
Treehugger Robot
a3accda0c7 Merge "[GWP-ASan] Fix bugs in realloc()." 2022-04-12 20:17:14 +00:00
Elliott Hughes
c635150eaf Merge "Polish the syscall docs a bit more." 2022-04-12 15:03:21 +00:00
Mitch Phillips
c70311c296 [GWP-ASan] Fix bugs in realloc().
Two edge cases were found in aosp/2038947:
 1. realloc(p, 0) == free() and returns nullptr. Previously, we just
    returned a new pointer.
 2. If the malloc() part of realloc() fails (e.g. when the size of the
    allocation is 1 << 56), then the old memory shouldn't be destroyed.

Bug: N/A
Test: Covered using atest bionic-unit-tests using aosp/2038947.
Change-Id: Ibafc752787129922a1e0323ffa14221d6a14f108
2022-04-11 13:36:39 -07:00
Elliott Hughes
4ece2d6183 Polish the syscall docs a bit more.
Test: N/A
Change-Id: Ic408e82721bd0446ea99884dc149af4a8ceaa492
2022-04-11 13:36:18 -07:00
Treehugger Robot
f252b7c465 Merge "Make libasync_safe available in com.android.virt" 2022-04-07 13:25:45 +00:00
Florian Mayer
ad3710992d Merge "Skip mallinfo / malloc_info tests on HWASan." 2022-04-07 04:08:26 +00:00
Florian Mayer
0aa87b82e5 Skip mallinfo / malloc_info tests on HWASan.
Those aren't implemented.

Test: passes on forrest.
Change-Id: I1a00f5e8ff1aba8f0e25ce589281ed3bfa9d0a5c
2022-04-06 22:03:19 +00:00
Shikha Panwar
307254c616 Make libasync_safe available in com.android.virt
This is required because virtualization_service use
libtombstoned_client_rust which has transitive dependency on
libasync_safe

Test: atest MicrodroidHostTestCases
Bug: 202153827
Change-Id: I9e670d02995f9ed9e67791aaecb300b6bfdbdb03
2022-04-06 21:00:13 +00:00
Elliott Hughes
4505cd8ced Merge "Remove dimitry and hhb from OWNERS." 2022-04-06 17:19:51 +00:00
Florian Mayer
2f23156692 Merge "Skip other_malloc_functions on HWASan." 2022-04-06 16:57:50 +00:00
dimitry
06335c4ec5 Remove dimitry and hhb from OWNERS.
Removing from owners to avoid confusion for users who
want to find approvers for their CLs.

Bug: n/a
Test: n/a
Change-Id: I56c02b95389c9cb559ca8791d36f9e625db57f69
2022-04-06 14:47:35 +00:00
Florian Mayer
24f276211d Skip other_malloc_functions on HWASan.
Bug: 227801493
Change-Id: I98b0c2d1a9dc450b97d2de5c02c68bcfd38088bf
2022-04-06 00:55:53 +00:00
Jiyong Park
6c378ec6b5 Merge "Deprecate "/apex/<name>/ld.config.txt" 2022-04-05 23:46:09 +00:00
Jiyong Park
2bac1f81c1 Deprecate "/apex/<name>/ld.config.txt
The file is a manually created linker config file for the binaries in
the APEX. This is discouraged since such a manually created linker
config is error-prone and hard to maintain. Since the per-APEX
linker config file is automatically created by the linkerconfig tool as
/linkerconfig/<name>/ld.config.txt, we can safely deprecated the
fallback path.

There currently are two APEXes using these hand-crafted configs. They
can (and should) keep the configs for backwards compatibility; in case
when they run on older devices where the auto-generated configs are not
available. But for newer platforms, the files are simply ignored and no
new APEX should be using that.

Bug: 218933083
Test: m
Change-Id: I84bd8850b626a8506d53af7ebb86b158f6e6414a
2022-04-05 14:07:48 +09:00
Elliott Hughes
8b8cb2d408 Merge "Improve the documentation about adding trivial syscall wrappers." 2022-04-04 17:51:48 +00:00
Elliott Hughes
a96306c60d Improve the documentation about adding trivial syscall wrappers.
Test: treehugger
Change-Id: I49040d0284e1d1254b8571a699a44b43ea8d911b
2022-04-01 15:56:31 -07:00
Elliott Hughes
97ef479dfe Merge "Fix unistd.exec_argv0_null for new kernels." 2022-04-01 21:59:56 +00:00
Elliott Hughes
bb1cc5a82c Fix unistd.exec_argv0_null for new kernels.
There are other options here (see the code comment for details), but
this is the least effort/least disruptive for now.

Bug: http://b/227498625
Test: treehugger
Change-Id: I33be6fbfc022238de2f1846a69af1e712a9d6391
2022-04-01 11:12:36 -07:00
Treehugger Robot
8581029d08 Merge "Extempt calculate_gnu_hash_neon from hwasan." 2022-04-01 00:56:45 +00:00
Florian Mayer
6e8f3a76ee Extempt calculate_gnu_hash_neon from hwasan.
Bug: 227630703
Change-Id: I525c99796c87252050b46faffb3058f7e8b5866c
2022-03-31 22:46:54 +00:00
Elliott Hughes
6bdefa6ca2 Merge "C11 removed gets()." 2022-03-31 16:30:43 +00:00
Elliott Hughes
1063039d19 C11 removed gets().
Test: treehugger
Change-Id: I793e29cbd52dd882b72eb58055cbc0dd05eb0f59
2022-03-30 17:25:10 -07:00
Dan Albert
2d8d2a0064 Disable strict abigail checking pending asm fix.
Test: m ndk
Bug: http://b/190554910
Change-Id: Ideb0c6d8ac5428c2ebe211393929f1d5c891dfba
2022-03-29 15:59:00 -07:00
Ryan Prichard
df41909cf6 Merge "Always process TLS relocs using general code path" 2022-03-28 19:19:12 +00:00
Ryan Prichard
8ea6af53e2 Always process TLS relocs using general code path
This is important for enabling the error about unsupported TLS
relocations to local symbols. The fast path tends to skip this error,
because it fails during lookup_symbol(). Add a test for this error.

I didn't see a performance regression in the linker_relocation
benchmark.

Bug: http://b/226978634
Test: m bionic-unit-tests
Change-Id: Ibef9bde2973cf8c2d420ecc9e8fe2c69a5097ce2
2022-03-25 15:51:11 -07:00
Mitch Phillips
98b49a060f Merge "Add GWP-ASan CTS to bionic TEST_MAPPING" 2022-03-25 17:57:07 +00:00
Mitch Phillips
40d9622c12 Add GWP-ASan CTS to bionic TEST_MAPPING
Bug: N/A
Change-Id: Ia9aac40965ba77823cd3824b0508d4e48c07f43f
Test: presubmit should pick up the new test in TEST_MAPPING.
2022-03-25 00:08:32 +00:00
Treehugger Robot
2b64e4000d Merge "Avoid usage of LONG_BIT in signal headers." 2022-03-24 21:10:41 +00:00
Peter Collingbourne
08b968b282 Avoid usage of LONG_BIT in signal headers.
Clang has its own limits.h which is ahead of ours on the inclusion
path. This header uses include_next to include our header, but only
in hosted mode. This means that in freestanding mode we don't get our
limits.h macro definitions, including LONG_BIT. This ends up causing
our signal.h to produce errors when included in freestanding mode on
32-bit platforms.

Fix the errors by replacing usage of LONG_BIT with (8 * sizeof(long))
in the signal headers.

Change-Id: I18ec7b6876d5f862beae09f0c011128eef97c869
2022-03-24 11:11:11 -07:00
Christopher Ferris
9263a823ea Merge "Update to v5.17 kernel headers." 2022-03-23 18:30:54 +00:00
Christopher Ferris
1ed5534657 Update to v5.17 kernel headers.
Kernel headers coming from:

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

Test: Boots on a flame and all bionic unit tests pass.
Change-Id: I7057d7308241f3acfa600597d287994c39ababbc
2022-03-22 16:48:40 -07:00
Treehugger Robot
8397fadb2e Merge "Add DF_1_ORIGIN to SUPPORTED_DT_FLAGS_1." 2022-03-22 20:25:30 +00:00
Peter Collingbourne
7aa3abc781 Add DF_1_ORIGIN to SUPPORTED_DT_FLAGS_1.
This flag means "$ORIGIN processing required", and since we always
do that, we can claim support for it.

Change-Id: If60ef331963f6bc1e1818d7fa2ee57c1aa8fa343
2022-03-21 19:02:26 -07:00
Treehugger Robot
8321ff1468 Merge "Suppress -Wformat warning" 2022-03-16 18:55:05 +00:00
Yi Kong
f9b1313968 Suppress -Wformat warning
This is exactly what it is testing for.

Original warning:
  bionic/tests/stdio_test.cpp:370:47: error: '%n' specifier not supported on this platform [-Werror,-Wformat]
    EXPECT_DEATH(snprintf(buf, sizeof(buf), "a %n b", &i), "%n not allowed on Android");
                                               ~^

Test: presubmit
Bug: 219872355
Change-Id: I6e378722b2d681cf64f4cf31ef000bd28203b00d
2022-03-16 08:15:15 +00:00
Colin Cross
14e01ac5e2 Merge "Tweak linux_glibc properties for musl builds in bionic" 2022-03-15 03:47:57 +00:00
Elliott Hughes
93f3017e03 Merge "Revert "Disable pointer authentication in app processes."" 2022-03-14 21:09:31 +00:00
Evgenii Stepanov
17185eda89 Merge "Fix mte tests to allow auto-upgrade." 2022-03-14 20:06:52 +00:00
Evgenii Stepanov
9705aac89a Fix mte tests to allow auto-upgrade.
The kernel MTE mode auto-upgrade feature (see mte_tcf_preferred) allows
silent auto-upgrade of Async MTE mode to Asymm or Sync depending on the
OS settings. Relax the tests to allow either Sync or Async faults when
requesting Async mode, and only Sync faults when requesting Sync.

Also tighten the MTENote test to check that both system allocator and
prctl are off when MTE is disabled.

Bug: 214622342
Test: bionic-unit-tests on fvp with all variations of
    /sys/devices/system/cpu/cpu*/mte_tcf_preferred=(async|asymm|sync)

Change-Id: I77a92789d6b330742d00b08c9f0fecc3a6c8fca6
2022-03-10 16:38:06 -08:00
Elliott Hughes
7309177235 Revert "Disable pointer authentication in app processes."
Revert submission 1954983-master-I3030c47be9d02a27505bd4775c1982a20755758c

Reason for revert: PAC has shipped with S, and we're going with app compat outreach rather than regressing security.
Reverted Changes:
I3030c47be:Disable pointer authentication in app processes.
I3030c47be:Disable pointer authentication in app processes.

Change-Id: I8761f08ddbd9077ff98b1a9a0c323de968792778
2022-03-10 18:01:04 +00:00
Colin Cross
da446cc5cc Tweak linux_glibc properties for musl builds in bionic
For convenience, builds against musl libc currently use the
linux_glibc properties because they are almost always linux-specific
and not glibc-specific.  In preparation for removing this hack,
tweak the linux_glibc properties by either moving them to host_linux,
which will apply to linux_glibc, linux_musl and linux_bionic, or
by setting appropriate musl or linux_musl properties.  Properties
that must not be repeated while musl uses linux_musl and also still
uses the linux_glibc properties are moved to glibc properties, which
don't apply to musl.  Whether these stay as glibc properties or get
moved back to linux_glibc later once the musl hack is removed is TBD.

Bug: 223257095
Test: m checkbuild
Test: m USE_HOST_MUSL=true host-native
Change-Id: I809bf1ba783dff02f6491d87fbdc9fa7fc0975b0
2022-03-08 15:07:57 -08:00
Colin Cross
471bef4d34 Merge "Use single module for libclang_rt.builtins-exported" 2022-03-08 06:51:43 +00:00
Christopher Ferris
5fbda5b808 Merge "Update for LocalUnwinder object removal." am: 25de3ac3f1
Original change: https://android-review.googlesource.com/c/platform/bionic/+/2007331

Change-Id: I34b0502a05780af5b5d1068408de6c29e032e4eb
2022-03-04 23:19:56 +00:00
Christopher Ferris
25de3ac3f1 Merge "Update for LocalUnwinder object removal." 2022-03-04 22:56:57 +00:00
Christopher Ferris
459eecb28b Update for LocalUnwinder object removal.
Modify libfdtrack to use the normal Unwinder object. In addition,
update the libfdtrack so that it doesn't record frames in
libfdtrack.so rather than skipping frames it thinks will be in
the library.

Modify the malloc debug code to use the normal Unwinder object.

Bug: 120606663

Test: All unit tests pass.
Change-Id: I3c9612dd10e62389e6219e68045ee87f7b2625f5
2022-03-03 15:23:25 -08:00
Christopher Ferris
fd5fa7d82e Merge "Add documentation about Android 12 bug." am: 39837afad7
Original change: https://android-review.googlesource.com/c/platform/bionic/+/2004748

Change-Id: I441d0cf04f54c239c63bb18a9ad6678c3a2416a0
2022-03-03 01:35:32 +00:00
Christopher Ferris
39837afad7 Merge "Add documentation about Android 12 bug." 2022-03-03 01:06:25 +00:00
Christopher Ferris
02ba051a7c Merge "Remove dead subdirs directive." am: 8029112fab
Original change: https://android-review.googlesource.com/c/platform/bionic/+/2004746

Change-Id: I2f5d601baad17a975b90abb6fe3e1d44eeab19ef
2022-03-02 23:35:56 +00:00