Commit graph

36230 commits

Author SHA1 Message Date
Automerger Merge Worker
f4b3e6c408 Merge "Merge "Merge "Merge "Merge "mntent_test: don't assume /proc isn't the first mount." into android10-tests-dev am: 0462cfb766" into android11-tests-dev am: 0a5cc21c42" into android12-tests-dev am: 46871c040d" into android12L-tests-dev am: e6fb091bba" 2022-05-18 01:29:27 +00:00
Automerger Merge Worker
57ce2d6520 Merge "Merge "Merge "Merge "mntent_test: don't assume /proc isn't the first mount." into android10-tests-dev am: 0462cfb766" into android11-tests-dev am: 0a5cc21c42" into android12-tests-dev am: 46871c040d" into android12L-tests-dev am: e6fb091bba
Original change: https://android-review.googlesource.com/c/platform/bionic/+/2098734

Change-Id: I00dfbcd763718b10c473f4cf8fe41a6ac2dc99d5
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-05-18 01:29:24 +00:00
Automerger Merge Worker
e6fb091bba Merge "Merge "Merge "Merge "mntent_test: don't assume /proc isn't the first mount." into android10-tests-dev am: 0462cfb766" into android11-tests-dev am: 0a5cc21c42" into android12-tests-dev am: 46871c040d" into android12L-tests-dev 2022-05-18 01:11:09 +00:00
Automerger Merge Worker
c3a2e6b232 Merge "Merge "Merge "mntent_test: don't assume /proc isn't the first mount." into android10-tests-dev am: 0462cfb766" into android11-tests-dev am: 0a5cc21c42" into android12-tests-dev am: 46871c040d
Original change: https://android-review.googlesource.com/c/platform/bionic/+/2098734

Change-Id: I10ed03dd6f920e19dc8c62c89217bf583dd21d96
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-05-18 01:11:07 +00:00
Automerger Merge Worker
46871c040d Merge "Merge "Merge "mntent_test: don't assume /proc isn't the first mount." into android10-tests-dev am: 0462cfb766" into android11-tests-dev am: 0a5cc21c42" into android12-tests-dev 2022-05-18 00:51:37 +00:00
Automerger Merge Worker
d285f43605 Merge "Merge "mntent_test: don't assume /proc isn't the first mount." into android10-tests-dev am: 0462cfb766" into android11-tests-dev am: 0a5cc21c42
Original change: https://android-review.googlesource.com/c/platform/bionic/+/2098734

Change-Id: Ic585470d3f383c9dcbc6e989b46ec8d6ce17eefd
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-05-18 00:51:35 +00:00
Automerger Merge Worker
0a5cc21c42 Merge "Merge "mntent_test: don't assume /proc isn't the first mount." into android10-tests-dev am: 0462cfb766" into android11-tests-dev 2022-05-18 00:32:25 +00:00
Shubhangi Pawar
ab9bb66180 Merge "mntent_test: don't assume /proc isn't the first mount." into android10-tests-dev am: 0462cfb766
Original change: https://android-review.googlesource.com/c/platform/bionic/+/2098734

Change-Id: I92a208d548197b48fc35082b5e219895bf16a904
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-05-18 00:32:22 +00:00
Shubhangi Pawar
0462cfb766 Merge "mntent_test: don't assume /proc isn't the first mount." into android10-tests-dev 2022-05-18 00:13:12 +00:00
Christopher Ferris
6f54ff6ca1 Merge "Use new AndroidLocalUnwinder." 2022-05-17 17:35:15 +00:00
Christopher Ferris
dfbc59ae51 Use new AndroidLocalUnwinder.
The new object incorporates all Android specific knowledge into
a single place and makes everything simpler.

Fixed a bug where if backtrace_full was enabled, the AddBacktrace
function would always set the size to the maximum number
of frames instead of the actual number of frames.

Added a new smoke system tests for backtrace_full.

Modified the smoke test to do a malloc/free, so it's really
a smoke test.

Bug: 232575330

Test: Unit tests pass on device.
Test: Verify the full backtrace actually produces valid backtraces.
Test: Run bionic-unit-tests with backtrace_full enabled.
Test: Run bionic-benchmarks --benchmark_filter=stdlib_malloc_free_decay1/512
Change-Id: I23128a73a8691007e1c7f69e0c99bb4dcd713db8
2022-05-16 15:37:21 -07:00
Elliott Hughes
1727595b0e mntent_test: don't assume /proc isn't the first mount.
This test tried to be lazy and test both getmntent() and getmntent_r()
in the same test, but that led to an implicit assumption that /proc
isn't the first mount returned.

This new version is quite a bit more thorough than the old. It does
assume that the mount list doesn't change while the test is running, but
that seems like a reasonable assumption to make during CTS?

Bug: https://issuetracker.google.com/230228681
Test: treehugger
Change-Id: I5c5f0b86ae1c4df9a2ce69d48e1c3accb42c687b
(cherry picked from commit 1e393b0699)
2022-05-16 17:56:24 +00:00
Elliott Hughes
a2e4fbb366 Merge "mntent_test: don't assume /proc isn't the first mount." 2022-05-16 17:55:17 +00:00
Elliott Hughes
1e393b0699 mntent_test: don't assume /proc isn't the first mount.
This test tried to be lazy and test both getmntent() and getmntent_r()
in the same test, but that led to an implicit assumption that /proc
isn't the first mount returned.

This new version is quite a bit more thorough than the old. It does
assume that the mount list doesn't change while the test is running, but
that seems like a reasonable assumption to make during CTS?

Bug: https://issuetracker.google.com/230228681
Test: treehugger
Change-Id: I5c5f0b86ae1c4df9a2ce69d48e1c3accb42c687b
2022-05-13 16:06:54 -07:00
Zijun Zhao
3d425bb8fb Merge "Add copy_file_range(2) syscall stub to bionic." 2022-05-12 17:20:55 +00:00
zijunzhao
c2e412e086 Add copy_file_range(2) syscall stub to bionic.
Test: treehugger
Bug: https://buganizer.corp.google.com/issues/227784687
Change-Id: I543306cd2234189401bf7c9d80d405eeb6e4d41d
2022-05-12 16:53:41 +00:00
Christopher Ferris
bcd8f15e27 Merge "Add option to force memunreachable check." 2022-05-11 23:28:21 +00:00
Florian Mayer
55d286e98a Merge "Remove unnecessary static variable." 2022-05-11 01:22:19 +00:00
Christopher Ferris
b42e8b4dec Add option to force memunreachable check.
The new option is named check_unreachable_on_signal. It is meant
to duplicate dumpsys meminfo --unreachable <PID> for non-java
processes. When enabled, a user can send a signal to a process
which will trigger the unreachable check on the next allocation
call.

Added new unit tests.

Test: New unit tests pass.
Test: Enabled for the entire system, then dumped on the netd
Test: process and also system_server.
Change-Id: I73561b408a947a11ce21a211b065d59fcc39097b
2022-05-10 17:37:19 -07:00
Treehugger Robot
08bbabcc45 Merge "Improve the "how to add a system call" doc" 2022-05-11 00:20:54 +00:00
Alix Espino
6087a278e0 Merge changes I158862fd,Ieb9de996
* changes:
  Removing clang_cflags to check if they're even necessary
  Moved contents of clang_cflags into cflags
2022-05-10 22:17:26 +00:00
zijunzhao
e5e1e4e55a Improve the "how to add a system call" doc
Test: None
Bug: None
Change-Id: Ie4212956836ae057009e6985812efcbbb7859dea
2022-05-10 22:07:31 +00:00
Florian Mayer
3c0f0969b9 Remove unnecessary static variable.
Change-Id: I1e0049895fc493f5e8b728707a076d5ad022f8c1
2022-05-10 20:57:13 +00:00
Treehugger Robot
c66cb5ba6a Merge "add new Linux close_range() system call to bionic" 2022-05-06 22:25:26 +00:00
Maciej Żenczykowski
b65e105047 add new Linux close_range() system call to bionic
See:
  https://man7.org/linux/man-pages/man2/close_range.2.html

Note: 'man close_range' documents 'flags' as unsigned int,
while glibc unistd.h as just 'int'.  Picking 'int' to match glibc,
though it probably doesn't matter.

BYPASS_INCLUSIVE_LANGUAGE_REASON=man is a cli command
Test: TreeHugger
Bug: 229913920
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: I1e2d1c8edc2ea28922d60f3ce3e534a784622cd1
2022-05-06 10:33:04 +00:00
Christopher Ferris
de9fe1e2de Merge "Mangle the pointers stored in PointerData." 2022-05-05 19:12:29 +00:00
Christopher Ferris
f78486f40e Mangle the pointers stored in PointerData.
The libmemunreachable library looks through memory to determine
if pointers are leaked. Unfortunately, the malloc debug code
stores the original pointer in data structures, so it looks like
pointers are still in use. The fix is to mangle the pointers
stored in memory so that it doesn't trick the library into thinking
they are live.

Test: All unit/system tests pass.
Test: Ran libmemunreachable and verified leaks show up.
Change-Id: Ic40a0a5ae73857cde936fd76895d88829686a643
2022-05-04 17:07:40 -07:00
Ryan Prichard
0e91012d42 Merge "legacy strtof inline: don't set errno for "inf"" 2022-05-04 22:47:08 +00:00
Elliott Hughes
082b9290d0 Merge "seccomp: allow stat() for ubsan." 2022-05-04 16:35:26 +00:00
Alix
9dff7da04c Removing clang_cflags to check if they're even necessary
Test: Treehugger & ran mma
Bug: 226636335

Change-Id: I158862fd23ad7050bde0916f24e12934b95f7646
2022-05-03 22:52:50 +00:00
Alix
d256925af4 Moved contents of clang_cflags into cflags
Test: Treehugger
Bug: 226636335
Change-Id: Ieb9de996a61418c8343885ae339589f0f48342d5
2022-05-03 22:50:24 +00:00
Treehugger Robot
0f6d493d28 Merge "Properly fix heap_tagging_helper for HWASan." 2022-05-03 05:34:16 +00:00
Florian Mayer
e2d50fe622 Properly fix heap_tagging_helper for HWASan.
Test: atest bionic-unit-tests
Change-Id: Ia9fbb436676257810d1c379d5d65dd7ccfcf90ac
2022-05-02 18:35:50 +00:00
Elliott Hughes
a0745cea5f seccomp: allow stat() for ubsan.
We've had complaints about ubsan issues for years, but never got to the
bottom of them, or saw them ourselves in testing. For some reason (still
not understood) we've started to see this ourselves in T and downstream
branches. So for now, let's just punch that extra hole.

Longer term, ubsan should stop needing any of this, so once
https://reviews.llvm.org/D124212 is in an LTS NDK, we should be able to
get rid of this _and_ the existing sanitizer-related holes.

Bug: https://github.com/android/ndk/issues/1298
Bug: http://b/229989971
Test: treehugger
Change-Id: Id42cb29c4e943c0080c0d34ce4e5d6d1b32da9e8
2022-04-29 15:48:08 -07:00
Maciej Żenczykowski
668c061986 Merge "allowlist new Linux close_range() system call, use it in posix_spawn()" 2022-04-29 07:07:16 +00:00
Ryan Prichard
88134649ee legacy strtof inline: don't set errno for "inf"
Bug: https://github.com/android/ndk/issues/415
Test: libc++'s std/strings/string.conversions/stof.pass.cpp
Change-Id: I2c6bab9e31fb1c916be991f72b04735b5df279c2
2022-04-28 23:17:33 -07:00
Maciej Żenczykowski
c9c0ebde3c allowlist new Linux close_range() system call, use it in posix_spawn()
Linux kernel's close_range() system call (currently) allows:
  close() unshare() fcntl(F_SETFD, FD_CLOEXEC)
to be performed on ranges of fds.

All 3 of these are already allowed by seccomp bpf:
as such this doesn't allow you to do anything you can't already do.

We can't add close_range() properly to bionic because we'd need to
fiddle about with ltp and it's too late to add new T API anyway,
so let's just make the direct syscall() call.

We'll add proper support in U.

See also:
  https://man7.org/linux/man-pages/man2/close_range.2.html

Test: TreeHugger
Bug: 229913920
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: I85586d544fc23bed6aee59f00bdb79ee7a8150d1
2022-04-28 23:33:38 +00:00
Automerger Merge Worker
966a778a24 Merge "Merge "Merge "Fix unistd.exec_argv0_null for new kernels." into android12-tests-dev am: b4cee37d7d" into android12L-tests-dev am: eec0b88f15" 2022-04-27 21:44:05 +00:00
Automerger Merge Worker
994ccab13e Merge "Merge "Fix unistd.exec_argv0_null for new kernels." into android12-tests-dev am: b4cee37d7d" into android12L-tests-dev am: eec0b88f15
Original change: https://android-review.googlesource.com/c/platform/bionic/+/2078360

Change-Id: I763aa2e4672e54a4fe3df9517b3935740653237e
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-04-27 21:44:02 +00:00
Treehugger Robot
069a25fe57 Merge "Improve the "how to add a system call" documentation." 2022-04-27 21:40:34 +00:00
Automerger Merge Worker
eec0b88f15 Merge "Merge "Fix unistd.exec_argv0_null for new kernels." into android12-tests-dev am: b4cee37d7d" into android12L-tests-dev 2022-04-27 21:26:56 +00:00
Treehugger Robot
7f7994cd16 Merge "Fix unistd.exec_argv0_null for new kernels." into android12-tests-dev am: b4cee37d7d
Original change: https://android-review.googlesource.com/c/platform/bionic/+/2078360

Change-Id: Ia864567dea05116f0b92edd31f5645edbc82e483
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-04-27 21:26:53 +00:00
Treehugger Robot
b4cee37d7d Merge "Fix unistd.exec_argv0_null for new kernels." into android12-tests-dev 2022-04-27 21:07:54 +00:00
Automerger Merge Worker
83e70ab7f3 Merge "Merge "Merge "Merge "Fix unistd.exec_argv0_null for new kernels." into android11-tests-dev am: 9d0912a7b2" into android12-tests-dev am: f14019cf61" into android12L-tests-dev am: dc8f5f7d3a" 2022-04-27 19:51:26 +00:00
Automerger Merge Worker
7294f4a88c Merge "Merge "Merge "Fix unistd.exec_argv0_null for new kernels." into android11-tests-dev am: 9d0912a7b2" into android12-tests-dev am: f14019cf61" into android12L-tests-dev am: dc8f5f7d3a
Original change: https://android-review.googlesource.com/c/platform/bionic/+/2078359

Change-Id: I594cefad36406ac8ff97528f11c7100b212637ae
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-04-27 19:51:23 +00:00
Automerger Merge Worker
dc8f5f7d3a Merge "Merge "Merge "Fix unistd.exec_argv0_null for new kernels." into android11-tests-dev am: 9d0912a7b2" into android12-tests-dev am: f14019cf61" into android12L-tests-dev 2022-04-27 19:30:39 +00:00
Automerger Merge Worker
f4b7c1ecc2 Merge "Merge "Fix unistd.exec_argv0_null for new kernels." into android11-tests-dev am: 9d0912a7b2" into android12-tests-dev am: f14019cf61
Original change: https://android-review.googlesource.com/c/platform/bionic/+/2078359

Change-Id: I162c86e60a34a50eef6079bcab78172c69c76f00
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-04-27 19:30:37 +00:00
Automerger Merge Worker
112a717077 Merge "Merge "Merge "Merge "Merge "Fix unistd.exec_argv0_null for new kernels." into android10-tests-dev am: 16457fd9d0" into android11-tests-dev am: ede618aef2" into android12-tests-dev am: ba0f5b9195" into android12L-tests-dev am: 19dce61545" 2022-04-27 19:22:07 +00:00
Automerger Merge Worker
4f61022f30 Merge "Merge "Merge "Merge "Fix unistd.exec_argv0_null for new kernels." into android10-tests-dev am: 16457fd9d0" into android11-tests-dev am: ede618aef2" into android12-tests-dev am: ba0f5b9195" into android12L-tests-dev am: 19dce61545
Original change: https://android-review.googlesource.com/c/platform/bionic/+/2078358

Change-Id: I0f6ee716bba94d903dae26c11aa6163bcc07e322
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-04-27 19:22:05 +00:00
Automerger Merge Worker
3e8dfcebfb Merge "Merge "Merge "Regression test for scudo crash in resizeTaggedChunk." into android12-tests-dev am: d8fa0f64af" into android12L-tests-dev am: 6c73a7ac6f" 2022-04-27 19:21:53 +00:00