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
TreeHugger Robot
cf91151364
Merge "Fail explicitly on length overflow." into oc-dev am: ea8d38e77f
...
Original change: https://googleplex-android-review.googlesource.com/c/platform/system/core/+/11619803
Change-Id: I9a6def9ff590fdadb457e9a011df3532829d23f4
2020-07-31 19:45:35 +00:00
TreeHugger Robot
ea8d38e77f
Merge "Fail explicitly on length overflow." into oc-dev
2020-07-31 19:24:50 +00:00
TreeHugger Robot
30a74852b0
Merge "Fail explicitly on length overflow." into qt-dev
2020-07-30 21:21:49 +00:00
Steven Moreland
ee22384c54
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
2020-07-30 17:29:34 +00:00
Treehugger Robot
d882aa06c6
Merge "Update language to comply with Android's inclusive language guidance" am: 98ea1340fb am: b939c5602c am: 3105cca029 am: 9e95eeafbd am: 99813b33da
...
Original change: https://android-review.googlesource.com/c/platform/system/core/+/1373460
Change-Id: I16b163dba73ed43ab95b89930c2046f9fb07bf93
2020-07-29 21:57:38 +00:00
Treehugger Robot
3105cca029
Merge "Update language to comply with Android's inclusive language guidance" am: 98ea1340fb am: b939c5602c
...
Original change: https://android-review.googlesource.com/c/platform/system/core/+/1373460
Change-Id: Id3fd33f2d61182ab18e87d80f0adabca855ffb80
2020-07-29 20:55:31 +00:00
Dan Albert
ac4500e67d
Update language to comply with Android's inclusive language guidance
...
See https://source.android.com/setup/contribute/respectful-code for reference
Bug: http://b/161896447
Test: None
Change-Id: I9e5a37a20012b2f7a8eac55701df03f7b7a9ab6c
2020-07-28 15:58:25 -07:00
Steven Moreland
0f0cb957b2
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
2020-07-28 21:43:13 +00:00
Michael Wright
c3af6fcaa6
Merge "Soften BitSet class comment." am: 2ea91cfe76 am: 009d58d8da am: ec8ff6eed3 am: 80783c1327 am: 413dd3fd72
...
Original change: https://android-review.googlesource.com/c/platform/system/core/+/1360510
Change-Id: I367fcce825cf0568b25678e5f769ac2525575dad
2020-07-16 13:35:01 +00:00
Michael Wright
ec8ff6eed3
Merge "Soften BitSet class comment." am: 2ea91cfe76 am: 009d58d8da
...
Original change: https://android-review.googlesource.com/c/platform/system/core/+/1360510
Change-Id: I3f6493c151e4b75be52cf3e2dbda1db94c9642b6
2020-07-16 13:00:28 +00:00
Michael Wright
f32317c869
Soften BitSet class comment.
...
std::bitset<> doesn't have exact replacements for all of the
functionality of BitSet32/64, so there are still places we want to use
these classes.
Bug: 160010896
Test: test BitSet_test.cpp
Change-Id: Ica59a138e014d82139fb6dcea0597a207faecc2a
2020-07-16 00:04:20 +00:00
Steven Moreland
1275da032f
Merge "String8: explicit int -> char cast." am: 3619489de6 am: 84cdbe20a4 am: 41eaad8e35 am: 607cd4b8c8 am: 8497ea1487
...
Original change: https://android-review.googlesource.com/c/platform/system/core/+/1362304
Change-Id: I4424d63aa9060b2f00ac276a8097823c3be55c00
2020-07-14 18:07:49 +00:00
Steven Moreland
80c46b0541
String16::remove - avoid overflow am: 4048e49956 am: 107f18cb61 am: 9be245c3f0 am: 64fb5012b8 am: 4e27b6992b am: 26b81f59d2 am: 8367a666b5
...
Original change: https://googleplex-android-review.googlesource.com/c/platform/system/core/+/11619802
Change-Id: Ic25dca55b553b062edc4ced44ddef68b96428906
2020-07-14 17:24:42 +00:00
Victor Khimenko
add3b3a137
Merge "Make libbacktrace buildable for native_bridge" into rvc-dev
2020-07-14 17:18:34 +00:00
Steven Moreland
8367a666b5
String16::remove - avoid overflow am: 4048e49956 am: 107f18cb61 am: 9be245c3f0 am: 64fb5012b8 am: 4e27b6992b am: 26b81f59d2
...
Original change: https://googleplex-android-review.googlesource.com/c/platform/system/core/+/11619802
Change-Id: Ib4704bc8a733ace56e7998b7bad5a6c5638900ad
2020-07-14 17:03:30 +00:00
Steven Moreland
3619489de6
Merge "String8: explicit int -> char cast."
2020-07-14 16:30:42 +00:00
Steven Moreland
4e27b6992b
String16::remove - avoid overflow am: 4048e49956 am: 107f18cb61 am: 9be245c3f0 am: 64fb5012b8
...
Original change: https://googleplex-android-review.googlesource.com/c/platform/system/core/+/11619802
Change-Id: I03057c052a24f205c78ee600178d45e0cd51a3c1
2020-07-14 16:29:09 +00:00
Steven Moreland
64fb5012b8
String16::remove - avoid overflow am: 4048e49956 am: 107f18cb61 am: 9be245c3f0
...
Original change: https://googleplex-android-review.googlesource.com/c/platform/system/core/+/11619802
Change-Id: I3ab9771d898eea0158acfd07fbe5a2f4b7dad883
2020-07-14 16:12:53 +00:00
Steven Moreland
9be245c3f0
String16::remove - avoid overflow am: 4048e49956 am: 107f18cb61
...
Original change: https://googleplex-android-review.googlesource.com/c/platform/system/core/+/11619802
Change-Id: I22f6b8299b4b77be31859a10b14efe01b297d531
2020-07-14 15:51:29 +00:00
Steven Moreland
107f18cb61
String16::remove - avoid overflow am: 4048e49956
...
Original change: https://googleplex-android-review.googlesource.com/c/platform/system/core/+/11619802
Change-Id: I4dedf81e3471473e589a858e14d7a9ae5f91b3d9
2020-07-14 15:37:25 +00:00
Steven Moreland
fdbc565dd5
String8: explicit int -> char cast.
...
Since tolower/toupper take and return integer arguments, ascii chars in
the extended range will be converted from positive int values to
negative char values. In order to silence an error here, which was added
recently with integer sanitization here, casting explicitly.
Fixes: 160831549
Test: w/ libutils_fuzz_string8
Change-Id: Iedcd6643f95f84ce662a80e38931d918a200f508
2020-07-13 23:33:25 +00:00
Michael Wright
9d5fcc66ab
Merge "Cast away signedness of built-ins in BitSet." am: 71f4494bd1 am: 1baa61b095 am: 5a5f41e12d am: 82c9d4c52b am: 4c0e768880
...
Original change: https://android-review.googlesource.com/c/platform/system/core/+/1360509
Change-Id: I6d8ff4b06b62786343611dbce0b8231e99eaae81
2020-07-13 16:50:22 +00:00
Michael Wright
71f4494bd1
Merge "Cast away signedness of built-ins in BitSet."
2020-07-13 15:45:40 +00:00
Yo Chiang
8ac8c4cc47
Merge "Move SingletonTest back to libutils_test" am: 9a57044ab3 am: 8cf6a0b69e am: b9930bb2d1 am: 55e3aec8fe am: dda41f845b
...
Original change: https://android-review.googlesource.com/c/platform/system/core/+/1360220
Change-Id: I49a7c0598c7e48032fc6467692431b1a84b83164
2020-07-13 04:58:17 +00:00
Michael Wright
23e1363d55
Cast away signedness of built-ins in BitSet.
...
Most of the built-in functions return signed values but BitSet deals
only in unsigned values. We can safely cast these away though as they're
always indices, which can't be negative.
Bug: 160010896
Test: atest inputflinger_tests, atest libinput_tests
Change-Id: I6e0b33972fabcd41ad1c269ea0e2a07b13b33c12
2020-07-12 01:56:58 +01:00
Victor Khimenko
fb60e6c9ae
Make libbacktrace buildable for native_bridge
...
Bug: http://b/153609531
Test: m -j64 libbacktrace.native_bridge
Change-Id: I2b8a881b4e952f3b68dbcaeb14f147a6d955b406
Merged-In: I2b8a881b4e952f3b68dbcaeb14f147a6d955b406
2020-07-10 20:13:23 +02:00
Yo Chiang
5b028bab2a
Move SingletonTest back to libutils_test
...
Use the new "data_libs:" to specify test library dependency. This is
like "data:" and it treats compiled libraries as test data files.
The result is libutils_test_singleton{1,2} is picked up by libutils_test
and installed next to the test binary.
Mark the test libs libutils_test_singleton{1,2} as uninstallable. This
prevents installing libutils_test_singleton{1,2} directly and only
permits installing via "data_libs:".
```
$ m libutils_test
testcases
└── libutils_test
├── arm
│ ├── libutils_test
│ ├── libutils_test_singleton1.so
│ └── libutils_test_singleton2.so
├── arm64
│ ├── libutils_test
│ ├── libutils_test_singleton1.so
│ └── libutils_test_singleton2.so
└── libutils_test.config
```
Bug: 124838889
Test: atest libutils_test
Change-Id: I432135e128fc9eedb1b8c18a331957e271d8b0f0
2020-07-10 19:34:53 +08:00
Steven Moreland
ce3884af70
Merge "libutils: integer sanitization" am: 1652ac276a am: 313e7de136 am: edf2ad1d1c am: 92cdaf3ce7 am: 57c9b00093
...
Original change: https://android-review.googlesource.com/c/platform/system/core/+/1356015
Change-Id: Ibda4048b917670f25904799917d3db9d60d97d06
2020-07-08 17:49:13 +00:00
Steven Moreland
9c832028c1
libutils: integer sanitization
...
For sanity.
Fixes: 160342252
Test: manually introduce overflow for "ubsan: mul-overflow"
Change-Id: I292039eaef24582f05dd9f0fef011f0ece8364ed
2020-07-07 22:37:07 +00:00
Victor Khimenko
827b861f38
Merge "Make libbacktrace buildable for native_bridge" am: a2f97dbb0f am: f3f15d2867 am: 1c1c0d7fa9 am: b116386279 am: b1c5595e7e
...
Original change: https://android-review.googlesource.com/c/platform/system/core/+/1343519
Change-Id: If2404847d59bb37ca2d0a80a82a2a6bec6e12283
2020-06-19 22:22:26 +00:00
Victor Khimenko
7428c52ef2
Make libbacktrace buildable for native_bridge
...
Bug: http://b/153609531
Test: m -j64 libbacktrace.native_bridge
Change-Id: I2b8a881b4e952f3b68dbcaeb14f147a6d955b406
2020-06-18 22:02:46 +02:00
Christopher Ferris
4d14303653
Fail explicitly on length overflow.
...
Instead of aborting when FileMap::create detects an overflow, detect the
overflow directly and fail the call.
Bug: 156997193
Test: Ran unit tests, including new unit test that aborted before.
Change-Id: Ie49975b8949fd12bbde14346ec9bbb774ef88a51
Merged-In: Ie49975b8949fd12bbde14346ec9bbb774ef88a51
(cherry picked from commit 68604b9c29 )
2020-06-04 11:05:18 -07:00
Christopher Ferris
f846413e62
Fail explicitly on length overflow.
...
Instead of aborting when FileMap::create detects an overflow, detect the
overflow directly and fail the call.
Bug: 156997193
Test: Ran unit tests, including new unit test that aborted before.
Change-Id: Ie49975b8949fd12bbde14346ec9bbb774ef88a51
Merged-In: Ie49975b8949fd12bbde14346ec9bbb774ef88a51
(cherry picked from commit 68604b9c29 )
2020-05-28 18:38:18 -07:00