Commit graph

37122 commits

Author SHA1 Message Date
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
Christopher Ferris
0d07dcc241 Make the unit tests isolated.
Modify the tests that require a single filename, to use a filename
that has the pid as part of the name. This allows multiple different
versions of the test to run on the same machine, and allows
each test to be run at the same time.

Test: Ran unit tests on device.
Test: Ran the unit tests 100 times, no failures.
Change-Id: Ia38483049e7b66bd3da824bcd484c03e46f85280
2022-05-17 17:25:38 -07: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
Florian Mayer
e54a0525e7 Remove unused function.
Change-Id: Iac7b16278868e1d5d267eb9637de6dbcb6bdacfb
2022-05-17 22:54:09 +00:00
Elliott Hughes
b3b0eb6f0e Remove the KSM hack in mmap().
We've been telling people not to use KSM since 2018.

Bug: http://b/115637122
Test: treehugger
Change-Id: Iaa4e0e31e449a74700b6ed47881b9625556f0982
2022-05-17 12:38:38 -07: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
c39fbbd8a3 Merge "mntent_test: don't assume /proc isn't the first mount." am: a2e4fbb366 am: c0bb49b0cc
Original change: https://android-review.googlesource.com/c/platform/bionic/+/2097446

Change-Id: Iee71959044a9405e7245e0e6fdc587868dde2cba
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-05-16 20:18:05 +00:00
Elliott Hughes
c0bb49b0cc Merge "mntent_test: don't assume /proc isn't the first mount." am: a2e4fbb366
Original change: https://android-review.googlesource.com/c/platform/bionic/+/2097446

Change-Id: Ia2a8856db54597b3355aaf1f284ed55b8e439863
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-05-16 19:59:05 +00: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
edc8dc88eb Merge "Add copy_file_range(2) syscall stub to bionic." am: 3d425bb8fb am: 63a79a3af5
Original change: https://android-review.googlesource.com/c/platform/bionic/+/2073827

Change-Id: I2a11f194aeceeb492d4b59b21b66d2f468c221be
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-05-12 18:18:24 +00:00
Zijun Zhao
63a79a3af5 Merge "Add copy_file_range(2) syscall stub to bionic." am: 3d425bb8fb
Original change: https://android-review.googlesource.com/c/platform/bionic/+/2073827

Change-Id: I8961ea4996a93e7a0ae641ead2965da8f95dd67c
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-05-12 17:56:14 +00: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
e9d87ac09d Merge "Add option to force memunreachable check." am: bcd8f15e27 am: 1dcb2b1d6c
Original change: https://android-review.googlesource.com/c/platform/bionic/+/2092709

Change-Id: I267ff9568c98eb02ca601013ba1ac2a41e096fcd
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-05-12 01:20:51 +00:00
Christopher Ferris
1dcb2b1d6c Merge "Add option to force memunreachable check." am: bcd8f15e27
Original change: https://android-review.googlesource.com/c/platform/bionic/+/2092709

Change-Id: I5145f6534f579a40aeee0bf5dbbccefac9332c35
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-05-12 00:54:32 +00:00
Christopher Ferris
bcd8f15e27 Merge "Add option to force memunreachable check." 2022-05-11 23:28:21 +00:00
Florian Mayer
8a1c9db8fe Merge "Remove unnecessary static variable." am: 55d286e98a am: 122ac31625
Original change: https://android-review.googlesource.com/c/platform/bionic/+/2094525

Change-Id: I4486d488cdab68f025db36f31e5a8c7993992385
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-05-11 02:24:48 +00:00
Florian Mayer
122ac31625 Merge "Remove unnecessary static variable." am: 55d286e98a
Original change: https://android-review.googlesource.com/c/platform/bionic/+/2094525

Change-Id: I397b1c89d7d0911c1836b65b5c7b832787669892
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-05-11 01:56:51 +00:00
Florian Mayer
55d286e98a Merge "Remove unnecessary static variable." 2022-05-11 01:22:19 +00:00
Treehugger Robot
ee725afbf9 Merge "Improve the "how to add a system call" doc" am: 08bbabcc45 am: 86810ce097
Original change: https://android-review.googlesource.com/c/platform/bionic/+/2095023

Change-Id: Id7b6d40ae957c1d207a28dd07c64e637c94002f4
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-05-11 01:10:19 +00:00
Treehugger Robot
86810ce097 Merge "Improve the "how to add a system call" doc" am: 08bbabcc45
Original change: https://android-review.googlesource.com/c/platform/bionic/+/2095023

Change-Id: Iec123f5a053915b362cfbd096145c9180c040d33
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-05-11 00:42:22 +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
f270fed0b1 Merge changes I158862fd,Ieb9de996 am: 6087a278e0 am: 815445c51b
Original change: https://android-review.googlesource.com/c/platform/bionic/+/2075515

Change-Id: I46c67cce2855d7228727ead6d59fd08eaeac8e82
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-05-10 23:25:21 +00:00
Alix Espino
815445c51b Merge changes I158862fd,Ieb9de996 am: 6087a278e0
Original change: https://android-review.googlesource.com/c/platform/bionic/+/2075515

Change-Id: Ie689a684e7efa7d363657874cb6179c6ed4c0991
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-05-10 22:56:20 +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
768fd4f906 Merge "add new Linux close_range() system call to bionic" am: c66cb5ba6a am: 9ffb887aa3
Original change: https://android-review.googlesource.com/c/platform/bionic/+/1957446

Change-Id: I388f01e8f56c0e1ba3e34a1086b9617765008a32
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-05-06 23:13:11 +00:00
Treehugger Robot
9ffb887aa3 Merge "add new Linux close_range() system call to bionic" am: c66cb5ba6a
Original change: https://android-review.googlesource.com/c/platform/bionic/+/1957446

Change-Id: I45251562b5b51e8b19ed778607aad790c057d478
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-05-06 22:43:30 +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
cd7937c198 Merge "Mangle the pointers stored in PointerData." am: de9fe1e2de am: 61125825f1
Original change: https://android-review.googlesource.com/c/platform/bionic/+/2086791

Change-Id: Ia5a906f38928eaf7507ea1e4f374f90afff75c85
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-05-05 20:04:43 +00:00
Christopher Ferris
61125825f1 Merge "Mangle the pointers stored in PointerData." am: de9fe1e2de
Original change: https://android-review.googlesource.com/c/platform/bionic/+/2086791

Change-Id: I5ab322cba490aeb3238b711eefdeba1ac876ac24
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-05-05 19:35: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
764b2a87d9 Merge "legacy strtof inline: don't set errno for "inf"" am: 0e91012d42 am: d48b212eaf
Original change: https://android-review.googlesource.com/c/platform/bionic/+/2080270

Change-Id: Ia95363eada221d70f16ce0f83e8c584b6bdc9b00
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-05-04 23:48:49 +00:00
Ryan Prichard
d48b212eaf Merge "legacy strtof inline: don't set errno for "inf"" am: 0e91012d42
Original change: https://android-review.googlesource.com/c/platform/bionic/+/2080270

Change-Id: I421e1dfaddc90b78053b4be0c9590dcd5671872e
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-05-04 23:08:48 +00:00
Florian Mayer
7fef14b499 Merge "Fix missing null-terminator to exec call." am: 7587e20eaf am: bbe7c690f1
Original change: https://googleplex-android-review.googlesource.com/c/platform/bionic/+/18171741

Change-Id: Iac611e0d8fa534750aed246e1fc009915afcb8d2
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-05-04 23:00:51 +00:00
Ryan Prichard
0e91012d42 Merge "legacy strtof inline: don't set errno for "inf"" 2022-05-04 22:47:08 +00:00
Florian Mayer
bbe7c690f1 Merge "Fix missing null-terminator to exec call." am: 7587e20eaf
Original change: https://android-review.googlesource.com/c/platform/bionic/+/2073947

Change-Id: Id15a4a4e86f6bb05378ec1f775fb07693bd9fbda
Ignore-AOSP-First: this is an automerge
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
(cherry picked from commit 0f46547800)
2022-05-04 21:00:22 +00:00
Elliott Hughes
dfed744739 [automerger skipped] seccomp: allow stat() for ubsan. am: 22dfc589ee -s ours
am skip reason: Merged-In Id42cb29c4e943c0080c0d34ce4e5d6d1b32da9e8 with SHA-1 a0745cea5f is already in history

Original change: https://googleplex-android-review.googlesource.com/c/platform/bionic/+/18167201

Change-Id: I7ce779c661bff2d17dc0e29282d6435190c02a0d
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-05-04 19:53:30 +00:00
Elliott Hughes
6e921fb0f6 Merge "seccomp: allow stat() for ubsan." am: 082b9290d0 am: f231c79c8f
Original change: https://android-review.googlesource.com/c/platform/bionic/+/2081859

Change-Id: Iabe74db3b02665ddb16bbd2e9cfa35bc4f3b97bf
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-05-04 17:54:27 +00:00