Commit graph

840 commits

Author SHA1 Message Date
Hamzeh Zawawy
b425404633 Merge "Resolved UAF issue in RefBase fuzzer" am: 9a79c84499 am: da2960df35 am: 5a8869456e
Original change: https://android-review.googlesource.com/c/platform/system/core/+/1424812

Change-Id: Iac76b32d88a3618434669f6b1e00c3591340c849
2020-12-01 19:30:18 +00:00
Dylan Katz
55107c195d Resolved UAF issue in RefBase fuzzer
Restrucures this fuzzer to be far more robust and less brittle.
Fix: 163727995
Fix: 163449137
Test: libutils_fuzz_refbase clusterfuzz-testcase-minimized-libutils_fuzz_refbase-5674315436261376
Test: libutils_fuzz_refbase clusterfuzz-testcase-minimized-libutils_fuzz_refbase-5731662044069888
Test: libutils_fuzz_refbase clusterfuzz-testcase-minimized-libutils_fuzz_refbase-5081777218256896

Signed-off-by: Dylan Katz <dylan.katz@leviathansecurity.com>
Change-Id: I239298dc2895a06af5a126e9ca2ae452579e5cc0
2020-11-30 16:18:27 -08:00
Devin Moore
5f9490712b Merge "libutils: add unit tests for invalid utf-8 and utf-16 strings" am: eb85221dcf am: c21e63ea26 am: ddc33e4f85 am: cc2f1917ac
Original change: https://android-review.googlesource.com/c/platform/system/core/+/1470423

Change-Id: Ie9f981fb869868a3acc2ca60e1a1a727b0905ad5
2020-11-12 17:47:51 +00:00
Devin Moore
eb85221dcf Merge "libutils: add unit tests for invalid utf-8 and utf-16 strings" 2020-11-12 16:05:38 +00:00
Devin Moore
6bcbeeafba libutils: add unit tests for invalid utf-8 and utf-16 strings
Characters get dropped during the conversionis between 8 and 16.

Test: atest libutils_test
Change-Id: Ie76dd38e97968137555ba2ab7ce188c9122ed06e
2020-11-10 02:54:39 +00:00
Yifan Hong
65e2660523 libcutils: make vendor_ramdisk_available. am: 55015ffb82 am: 861fd6376b am: 9485558332 am: 304ae82046
Original change: https://android-review.googlesource.com/c/platform/system/core/+/1477501

Change-Id: I3c7e80aa56ee9d406e7650ea809a97cad97b3f09
2020-10-29 19:15:59 +00:00
Yifan Hong
861fd6376b libcutils: make vendor_ramdisk_available. am: 55015ffb82
Original change: https://android-review.googlesource.com/c/platform/system/core/+/1477501

Change-Id: I68d5532918c31209c61733fb546b1fd4ee836eb7
2020-10-29 17:49:19 +00:00
Yifan Hong
0248561ae6 Merge changes from topic "vendor_ramdisk"
* changes:
  libprocessgroup_headers: make vendor_ramdisk_available.
  libdebuggerd_handler_fallback: make vendor_ramdisk_available.
  libcutils: make vendor_ramdisk_available.
  libpropertyinfoparser: make vendor_ramdisk_available.
2020-10-29 17:17:27 +00:00
Yifan Hong
55015ffb82 libcutils: make vendor_ramdisk_available.
Test: builds
Bug: 156098440
Change-Id: I663a3839e402a83ebf31b8a680c61f1e269548f6
2020-10-28 10:57:51 -07:00
Elliott Hughes
a330a676e3 Merge "Remove unused utf8_length()." am: 52dac2f8b7 am: 0ee0648569 am: a7f8cdbfff am: 6add13eba2
Original change: https://android-review.googlesource.com/c/platform/system/core/+/1474916

Change-Id: Ie0948010f2e0f246c89a58ac055e75e9829f3905
2020-10-27 16:15:02 +00:00
Elliott Hughes
939e43e66e Remove unused utf8_length().
Test: treehugger
Change-Id: Idcebc4ae1dcad102873d50f199f5e8745e589da4
2020-10-26 13:14:47 -07:00
Jason Chiu
311735f981 Merge "Disable callstack for mac too." am: 7e93bd24b2 am: e9e08faf3a am: b5cc09e765 am: 99c8599198
Original change: https://android-review.googlesource.com/c/platform/system/core/+/1468408

Change-Id: Icecd6f66d345196b44aa42c7760446cef9f5adee
2020-10-21 09:30:04 +00:00
Christopher Ferris
8377b10f29 Disable callstack for mac too.
Bug: 171353386

Test: Builds.
Change-Id: Id8a5cce170682ea43aa641c187c22cb31b6fd017
2020-10-21 06:04:00 +00:00
Christopher Ferris
08491d6c1c Merge "Remove include/backtrace symlink." am: 5c573b45ec am: f75f38308b am: 0c53abc313 am: bbf44c1494
Original change: https://android-review.googlesource.com/c/platform/system/core/+/1467958

Change-Id: I2f9f8df7c8ee4d9b41b2f881546e6cd6afb5dfc7
2020-10-21 00:24:29 +00:00
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
Christopher Ferris
0e69160ebc Remove include/backtrace symlink.
This requires a few other changes to support building libutils
properly. It does appear the windows versions of libutils is
referencing CallStack code, but it doesn't seem to cause any problems.
However, I removed those references completely for the windows build.

Also removed a few extra spaces that seem to have accumulated in the
RefBase.cpp.

Bug: 170465278

Test: Builds and libutils unit tests pass.
Change-Id: Ibeee7791b13636b34bdd592c5420fd91620f752a
2020-10-20 12:46:14 -07: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