Commit graph

675 commits

Author SHA1 Message Date
Elliott Hughes
5dba989281 Merge "Fix SharedBuffer tests to pass under hwasan." am: 2d697d330f am: 7266e44305 am: 1c8f0bad6b am: f9ff52ef3f
Original change: https://android-review.googlesource.com/c/platform/system/core/+/1466463

Change-Id: Ic03befb80608e15b21ac703810bb0a45308dcad3
2020-10-20 20:40:37 +00:00
Elliott Hughes
f2f016e741 Fix SharedBuffer tests to pass under hwasan.
Allocating the entire address space is sufficiently unreasonable that
hwasan blows you out of the water if you try to do that. Half the
address space feels like it's large enough to be guaranteed to fail
(which is all I think this intended to test) without being quite so
obviously incorrect that tools like hwasan are going to object...

...except hwasan actually has a 2GiB limit. So let's keep the cleanup,
but also just disable these tests if they're running under hwasan for
now.

Bug: https://issuetracker.google.com/171054277
Test: treehugger
Change-Id: I41f3def5c3a43aa7f9ca3a130b4306ebed659d6a
2020-10-19 16:51:58 -07:00
The Android Open Source Project
7fd5f8d2bc DO NOT MERGE - Merge RP1A.201005.006
Bug: 168212094
Change-Id: I79a7517bce1c012eac2a2a7c1c2cffc5a3516eaa
Merged-In: Ia85067d4258bde4b875c832d6223db5dd26b8838
2020-10-06 04:30:21 +00:00
Steven Moreland
4749998c88 Merge "Adds license header" am: 754c6b2924 am: 967bacd0dd am: 9b445e0cb8 am: e4c07f8eaf am: 2f766bbb7d
Original change: https://android-review.googlesource.com/c/platform/system/core/+/1446918

Change-Id: I600e7d1b4de4ba8ad0279235013c9ad5ee003df5
2020-10-02 22:31:42 +00:00
Steven Moreland
9b445e0cb8 Merge "Adds license header" am: 754c6b2924 am: 967bacd0dd
Original change: https://android-review.googlesource.com/c/platform/system/core/+/1446918

Change-Id: If3d1f1676f6d1d1d085c1b1ce706c0925fa628de
2020-10-02 21:16:38 +00:00
Dylan Katz
50ed92a7e0 Adds license header
Missed a review point made, added the license header to FuzzFormatTypes
Test: Compiled code

Signed-off-by: Dylan Katz <dylan.katz@leviathansecurity.com>
Change-Id: Ib8f32b802ec207d0483772c38a0a741e0dd1f151
2020-10-02 11:08:15 -07:00
Steven Moreland
087e53f295 Merge "Fixes to String8 fuzzer" am: 3e3e44c740 am: ee59f6b3b3 am: d2060583cd am: d9188a4eed am: 7e8affb180
Original change: https://android-review.googlesource.com/c/platform/system/core/+/1439322

Change-Id: I5754d7ae0902ac4bed61b85cb5c06ee100e03d77
2020-09-29 01:03:57 +00:00
Steven Moreland
d2060583cd Merge "Fixes to String8 fuzzer" am: 3e3e44c740 am: ee59f6b3b3
Original change: https://android-review.googlesource.com/c/platform/system/core/+/1439322

Change-Id: I996789a1a891fc111b6340d40aa0e8beca8b1bf0
2020-09-28 23:40:52 +00:00
Steven Moreland
3e3e44c740 Merge "Fixes to String8 fuzzer" 2020-09-28 22:35:38 +00:00
Rick Yiu
64ffe82e7b Merge changes from topic "revert_androidSetThreadPriority_api" am: 2b1c37a3e4 am: 75595e006e am: 9bb11eb78e am: ae8504a46f am: 40a80c8bef
Original change: https://android-review.googlesource.com/c/platform/system/core/+/1440132

Change-Id: Ie437b5fcb686d5e4d9effe4765a0fd13d138c747
2020-09-28 04:06:29 +00:00
Rick Yiu
9bb11eb78e Merge changes from topic "revert_androidSetThreadPriority_api" am: 2b1c37a3e4 am: 75595e006e
Original change: https://android-review.googlesource.com/c/platform/system/core/+/1440132

Change-Id: I1595b5fbebfa9dfb775b79ffa980b9e5a60bd03a
2020-09-28 02:52:44 +00:00
Rick Yiu
fa02bb9952 Revert "Add choice for changing sched policy when setting thread priority"
This reverts commit 57affbf91d.

Reason for revert: new API is no longer used

Change-Id: I97128c1d367e161aa50deaefa8b73a0f25e29af4
2020-09-27 11:21:11 +08:00
Rick Yiu
290efe38b6 Revert "Fix API for C compatibility"
This reverts commit b473061c5a.

Reason for revert: new API is no longer used

Change-Id: I2c4f9f37736faeb5d0403c2ba531c792d2531505
2020-09-27 11:20:03 +08:00
Dylan Katz
98e14de057 Fixes to String8 fuzzer
Adds support for format fuzzing, fixes several bugs.
Fix: 163680603
Fix: 162926178
Fix: 157469647
Test: libutils_fuzz_string8 clusterfuzz-testcase-minimized-libutils_fuzz_string8-6188353572306944
Test: libutils_fuzz_string8 clusterfuzz-testcase-minimized-libutils_fuzz_string8-6413754773012480
Test: libutils_fuzz_string8 clusterfuzz-testcase-minimized-libutils_fuzz_string8-5691524777246720

Signed-off-by: Dylan Katz <dylan.katz@leviathansecurity.com>
Change-Id: I7107c3637a4befccab345e17171a1119f8677557
2020-09-25 16:28:49 -07:00
Treehugger Robot
ec484d34fd Merge "Removed RWLock fuzzer" am: 928910999f am: 48507b1c27 am: 01cf1878c9 am: 6579e89b78 am: 7d50d0c41b
Original change: https://android-review.googlesource.com/c/platform/system/core/+/1434261

Change-Id: I77045246577762c6d475244a11aa8e3ddd1628fb
2020-09-22 20:06:53 +00:00
Treehugger Robot
01cf1878c9 Merge "Removed RWLock fuzzer" am: 928910999f am: 48507b1c27
Original change: https://android-review.googlesource.com/c/platform/system/core/+/1434261

Change-Id: I5f8a6f78dcfff5118ded304cae1e6e9bcf7c8e89
2020-09-22 19:17:04 +00:00
Dylan Katz
806b3d8619 Removed RWLock fuzzer
The class being fuzzed here was too simple for a fuzzer to be effective at finding crashes that were not working as intended.
To resolve the issue noted in 163775285 would require the fuzzer to simply use RWLock exactly as intended, defeating the point of fuzzing it.
Because of this, we have made the decision to remove this class. It should have a fairly small impact on coverage. In the future,
perhaps a better approach would be fuzzing pthread's rwlock methods directly.
Test: Made sure the project still builds without RWLock_fuzz.

Signed-off-by: Dylan Katz <dylan.katz@leviathansecurity.com>
Change-Id: Id5e77d053dc800a982176802dc506d26b54d810f
2020-09-11 11:03:02 -07:00
Treehugger Robot
e54b85b9ad Merge "Move PropertyMap from libutils to libinput" am: 01a30c0d2b am: 91f3227436 am: f535386aa7 am: 05a8129c88 am: 50fc3dc833
Original change: https://android-review.googlesource.com/c/platform/system/core/+/1396177

Change-Id: Iab2a30fce6d5e0569b01b894babe33ef416dd53b
2020-09-08 17:13:30 +00:00
Treehugger Robot
f535386aa7 Merge "Move PropertyMap from libutils to libinput" am: 01a30c0d2b am: 91f3227436
Original change: https://android-review.googlesource.com/c/platform/system/core/+/1396177

Change-Id: I04748c0a73394f593c70b8f6863e40dce0eb3616
2020-09-08 16:22:37 +00:00
Treehugger Robot
91f3227436 Merge "Move PropertyMap from libutils to libinput" am: 01a30c0d2b
Original change: https://android-review.googlesource.com/c/platform/system/core/+/1396177

Change-Id: I02919926ccbc4127f9c9c2a2b66eb2a7334c7270
2020-09-08 16:17:05 +00:00
Siarhei Vishniakou
1329696700 Move PropertyMap from libutils to libinput
The input code is the only customer of PropertyMap. For easier
maintenance and eventual removal of it, move it to libinput.

Currently, the caller is responsible for managing the lifecycle of the
returned outMap when calling PropertyMap::load. However, the fact that
the function call allocates new memory is not obvious from the function
signature.

In a separate commit, I will refactor the function to return
Result<unique_ptr<>> to make it less errorprone.
In this commit, only move the files around to make code reviews easier.

Bug: 163171599
Test: atest inputflinger_tests
Change-Id: I316084886c3f09a1776fdb449d2f03d0563b66c1
2020-09-02 20:54:38 -07:00
Xin Li
0a112d52f8 Merge Android R (rvc-dev-plus-aosp-without-vendor@6692709)
Bug: 166295507
Merged-In: Id18cb0e2d2f3e776a42b566c4a1af2e250890896
Change-Id: Iba7cab32ab3aa6f47952c840ff6dc8492e8d0704
2020-08-29 01:42:13 -07:00
Treehugger Robot
aa86d0ae3c Merge "Fix API for C compatibility" am: 6f3e974ab5 am: 909219ccc2
Original change: https://android-review.googlesource.com/c/platform/system/core/+/1408797

Change-Id: I5c4a960756ba710fd1e70294f0f10414f87113bf
2020-08-26 01:28:41 +00:00
Greg Kaiser
b473061c5a Fix API for C compatibility
In https://android-review.googlesource.com/c/platform/system/core/+/1224544
when we introduced a default argument to androidSetThreadPriority(),
we broke C compatibility with this API, and with the header file
in general.

We fix this up by instead introducing a new method that takes
three arguments.  This gets this header file compiling for C again,
and keeps this particular API C compatible.

Any C++ callers of the three argument version of
androidSetThreadPriority() will need to switch to using
androidSetThreadPriorityAndPolicy().  Although since this was
a recent change, we believe there is only one such user, which
we are fixing at the same time.

Test: TreeHugger
Bug: 165009705
Merged-In: Iab0b7e6c91a8e32a17ba1b186fd0c2fe96b601e4
Change-Id: Iab0b7e6c91a8e32a17ba1b186fd0c2fe96b601e4
2020-08-24 17:29:25 +00:00
Greg Kaiser
39c7fa9ffe Fix API for C compatibility
In https://android-review.googlesource.com/c/platform/system/core/+/1224544
when we introduced a default argument to androidSetThreadPriority(),
we broke C compatibility with this API, and with the header file
in general.

We fix this up by instead introducing a new method that takes
three arguments.  This gets this header file compiling for C again,
and keeps this particular API C compatible.

Any C++ callers of the three argument version of
androidSetThreadPriority() will need to switch to using
androidSetThreadPriorityAndPolicy().  Although since this was
a recent change, we believe there is only one such user, which
we are fixing at the same time.

Test: TreeHugger
Bug: 165009705
Change-Id: Iab0b7e6c91a8e32a17ba1b186fd0c2fe96b601e4
2020-08-24 10:25:03 -07:00
Elliott Hughes
bb791bc97e Merge "Deprecate <utils/Debug.h>." am: 5d0eb66590 am: f2587f3698 am: d6e98167a5 am: a83f7cb606 am: ee858fe0b8
Original change: https://android-review.googlesource.com/c/platform/system/core/+/1402847

Change-Id: Iea7d4bc16f35d998baa17da206badc9f8236e0a8
2020-08-17 21:40:04 +00:00
Elliott Hughes
79ce0a5ca6 Merge "Don't #include <utils/Debug.h> from <utils/Flattenable.h>." am: af99e1e88a am: 80a8682fff am: ca308a093f am: a304bb12d2 am: 97dd36c274
Original change: https://android-review.googlesource.com/c/platform/system/core/+/1402848

Change-Id: Iceae4c8fb882517685439d34737df8990e7d5e08
2020-08-17 21:39:36 +00:00
Elliott Hughes
d6e98167a5 Merge "Deprecate <utils/Debug.h>." am: 5d0eb66590 am: f2587f3698
Original change: https://android-review.googlesource.com/c/platform/system/core/+/1402847

Change-Id: I570616eaa8976ee45ed78425f6b1ba7b78650dc3
2020-08-17 20:59:50 +00:00
Elliott Hughes
ca308a093f Merge "Don't #include <utils/Debug.h> from <utils/Flattenable.h>." am: af99e1e88a am: 80a8682fff
Original change: https://android-review.googlesource.com/c/platform/system/core/+/1402848

Change-Id: I9afda802fb1bde38c086ba9e7b8ba995e6e4db4c
2020-08-17 20:59:22 +00:00
Elliott Hughes
5d0eb66590 Merge "Deprecate <utils/Debug.h>." 2020-08-17 20:36:10 +00:00
Elliott Hughes
884cedc770 Don't #include <utils/Debug.h> from <utils/Flattenable.h>.
It's not used, and shouldn't be used.

Also switch to `#pragma once`.

Test: treehugger
Change-Id: I464d3de1b0e1d536cea06362e6c73fddaad967d1
2020-08-17 10:14:16 -07:00
Elliott Hughes
832815151f Deprecate <utils/Debug.h>.
I stumbled across this because of the `#ifdef __cplusplus` inside an
unguarded `namespace`, but this whole file should be deprecated and
removed in favor of static_assert.

Test: treehugger
Change-Id: I2b65db67e694115e915f0cc9d762b0fd41a7d2af
2020-08-17 10:07:29 -07:00
Steven Moreland
bad50ed24f libutils: check vsnprintf error
For encoding errors, this function will return a negative value which
causes problems down the line. Check for an error and return. Also,
integer overflows are guarded.

Bug: 161894517
Test: fuzzer test case
Change-Id: Ia85067d4258bde4b875c832d6223db5dd26b8838
Merged-In: Ia85067d4258bde4b875c832d6223db5dd26b8838
(cherry picked from commit ee22384c54)
2020-08-12 21:45:05 +00:00
Elliott Hughes
c11ce1d769 Merge "Add second batch of fuzzers for libutils" am: 2cfea97ba3 am: 354d814409 am: 20fc570cd2 am: f5d5edbb8d am: ec11814f57
Original change: https://android-review.googlesource.com/c/platform/system/core/+/1356122

Change-Id: I3f66b6200d83defd2e2cfaa2517b8b43f02bbe47
2020-08-10 17:06:45 +00:00
Elliott Hughes
20fc570cd2 Merge "Add second batch of fuzzers for libutils" am: 2cfea97ba3 am: 354d814409
Original change: https://android-review.googlesource.com/c/platform/system/core/+/1356122

Change-Id: Ia72091a216e548beb007c4f30ba3412fe54fa1b8
2020-08-10 16:10:54 +00:00
Elliott Hughes
2cfea97ba3 Merge "Add second batch of fuzzers for libutils" 2020-08-10 15:40:44 +00:00
Treehugger Robot
388a02c78a Merge "Add uptimeNanos to SystemClock" am: 52c8422ea1 am: c7a2225665 am: ba7efc63cc am: 11a0227d2a am: e2269017ad
Original change: https://android-review.googlesource.com/c/platform/system/core/+/1394287

Change-Id: I4594a62d40bee62362f72d0aed1f01e40d337256
2020-08-08 02:33:21 +00:00
Treehugger Robot
ba7efc63cc Merge "Add uptimeNanos to SystemClock" am: 52c8422ea1 am: c7a2225665
Original change: https://android-review.googlesource.com/c/platform/system/core/+/1394287

Change-Id: I8dd8c3e148a011b250260a2ebc329fdeb06433a6
2020-08-08 01:37:29 +00:00
Treehugger Robot
52c8422ea1 Merge "Add uptimeNanos to SystemClock" 2020-08-08 01:04:09 +00:00
Dylan Katz
7168f2726e Add second batch of fuzzers for libutils
This adds fuzzers for:
- CallStack
- Looper
- LruCache
- Printer
- ProcessCallStack
- PropertyMap
- RWLock
- RefBase
- StopWatch.
Test: Ran each fuzzer for 10 minutes. Rough coverage est. (likely far below actual value): 10.97%

Signed-off-by: Dylan Katz <dylan.katz@leviathansecurity.com>
Change-Id: I2f9f35c18b13338c282fb7f9c3ea4099ecb2c56f
2020-08-07 15:36:39 -07:00
Suprabh Shukla
a55ef96ea7 Add uptimeNanos to SystemClock
Test: system/core/libutils/SystemClock_test.cpp

Bug: 162791194
Change-Id: I0e3ea2004146eb7442c89bb35a9f3a2171d9c4b8
2020-08-07 14:36:07 -07:00
Steven Moreland
f1c0be76ab Merge "libutils: check vsnprintf error" into oc-dev am: a03d37d542 am: d8801aaad8 am: d05ecb8d9d am: dc99a094dd am: 64b312bbd8 am: 0cb14f1fe7 am: ce44c8ac3c
Original change: https://googleplex-android-review.googlesource.com/c/platform/system/core/+/12254459

Change-Id: I6fb2a6370b202cbe476aee558e09c702605d8328
2020-08-04 23:38:00 +00:00
Steven Moreland
ce44c8ac3c Merge "libutils: check vsnprintf error" into oc-dev am: a03d37d542 am: d8801aaad8 am: d05ecb8d9d am: dc99a094dd am: 64b312bbd8 am: 0cb14f1fe7
Original change: https://googleplex-android-review.googlesource.com/c/platform/system/core/+/12254459

Change-Id: I1cb83a4a22e205dddd10536f61392215d5cb33dc
2020-08-04 23:19:46 +00:00
Steven Moreland
64b312bbd8 Merge "libutils: check vsnprintf error" into oc-dev am: a03d37d542 am: d8801aaad8 am: d05ecb8d9d am: dc99a094dd
Original change: https://googleplex-android-review.googlesource.com/c/platform/system/core/+/12254459

Change-Id: I79dcbb310a2515e7f17ad2ebbb0367070084dab2
2020-08-04 22:46:49 +00:00
Steven Moreland
dc99a094dd Merge "libutils: check vsnprintf error" into oc-dev am: a03d37d542 am: d8801aaad8 am: d05ecb8d9d
Original change: https://googleplex-android-review.googlesource.com/c/platform/system/core/+/12254459

Change-Id: I816b8858c69e6481299f942401a16b5b39cd8b69
2020-08-04 22:21:36 +00:00
Steven Moreland
d05ecb8d9d Merge "libutils: check vsnprintf error" into oc-dev am: a03d37d542 am: d8801aaad8
Original change: https://googleplex-android-review.googlesource.com/c/platform/system/core/+/12254459

Change-Id: Ifa0692e4966e78f4e180a2efc53db991177b6006
2020-08-04 22:03:55 +00:00
Steven Moreland
d8801aaad8 Merge "libutils: check vsnprintf error" into oc-dev am: a03d37d542
Original change: https://googleplex-android-review.googlesource.com/c/platform/system/core/+/12254459

Change-Id: Id247c7079c146da8eaf52f098027d5daa25ce8d8
2020-08-04 21:37:54 +00:00
Steven Moreland
a03d37d542 Merge "libutils: check vsnprintf error" into oc-dev 2020-08-04 21:20:36 +00:00
TreeHugger Robot
cf6c14c850 Merge "Fail explicitly on length overflow." into oc-dev am: ea8d38e77f am: cf91151364 am: 84dcff4c6b
Original change: https://googleplex-android-review.googlesource.com/c/platform/system/core/+/11619803

Change-Id: Ie7b7a57f55ead23f8d382ac98eb5087a2c614b1b
2020-07-31 20:24:42 +00:00
TreeHugger Robot
84dcff4c6b Merge "Fail explicitly on length overflow." into oc-dev am: ea8d38e77f am: cf91151364
Original change: https://googleplex-android-review.googlesource.com/c/platform/system/core/+/11619803

Change-Id: Idb480f2a4dc1aa0d929e17e7e568a9c1b05c8489
2020-07-31 20:03:44 +00:00