Commit graph

55882 commits

Author SHA1 Message Date
Alessio Balsini
e7f1087fa1 libsnapshot/test: Re-enable the failing tests
Some tests were temporarily disabled due to errors in Cuttlefish.
Now that the issues were fixed, the tests can be put back in presubmit.

Bug: 148889015
Test: vts_libsnapshot_test (Cuttlefish + Pixel 4)
Signed-off-by: Alessio Balsini <balsini@google.com>
Change-Id: Idcb2b7831b2183b2d734bdf8821fd34746f2beee
2020-02-26 21:49:25 +00:00
Tom Cherry
cfcf684c83 Revert "liblog: disable header_abi_checker"
All planned changes to liblog have been made, so it's time to
re-enable this.

This reverts commit 896fb9e57a.

Test: build
2020-02-26 13:43:31 -08:00
Eric Biggers
91bcfd8d7f fs_mgr: fix checking for casefold feature already enabled
EXT4_FEATURE_INCOMPAT_CASEFOLD is a flag in s_feature_incompat, not in
s_feature_ro_compat.

Bug: 138322712
Test: Treehugger
Change-Id: I07bb1d2b818d423196d8ceebda8900a8adbb19e9
2020-02-26 19:11:48 +00:00
Tom Cherry
b5b162e204 logwrap: add missing O_CLOEXEC
Bug: 150260863
Test: build
Change-Id: Ibe070d5d4f3a7ada0718f74c7cee12db7b9f920e
2020-02-26 10:29:04 -08:00
Steven Moreland
8ef1e1b535 Merge "String*: remove 'StaticLinkage' constructor" 2020-02-26 17:57:07 +00:00
David Anderson
a31834a4b6 Merge "init: Make sure ImageManager status files are labelled." 2020-02-26 17:56:03 +00:00
Victor Hsieh
98296fcf2a Mark fs-verity support for ext4 userdata if first_api_level >= R
fs-verity is required for new devices launched with R. This change
remove a manual setup for vendors going forward. The original fs mgr
flag still allows old devices to opt in, which can only to be done
manually because of kernel dependency.

Test: build
Bug: 150034150
Change-Id: I152b63d7889153d41f29677f72074afb1881b65d
2020-02-26 09:49:45 -08:00
Florian Mayer
fc0adaf89e Always use shared memory for atrace.
Remove ATRACE_SHMEM macro.

Test: atrace ss
      atrace wm
      sanity check output
Bug: 137366208
Change-Id: I1b42243678b9b9a41db18e2ff8cb3cf7bde874de
2020-02-26 15:55:22 +00:00
Steven Moreland
b1d3161b7b String8: operator<<
For parity with String16.

Bug: N/A
Test: N/A
Change-Id: I2d7d207138c96146814da31cf27a49cc310e5362
2020-02-25 17:59:54 -08:00
Matthew Maurer
1010727a48 trusty: keymaster: Remove legacy support
Library based HALs have been deprecated for several years now, and
Keymaster 2 based testing is woefully out of date compared to running
VTS against the modern 3.0 and 4.0 implementations.

Purging these modules and their resulting dependencies will make it
easier for the central system/keymaster repository to move forwards.

Test: mm
Bug: 150239636
Change-Id: Ic2ddbe685a50e65f9db25f682ad33105195efa8a
2020-02-26 00:43:23 +00:00
David Anderson
c991f347b2 init: Make sure ImageManager status files are labelled.
adb remount and snapshot-based updates use ImageManager in first-stage
init. This creates status files, which need to be labelled.

Bug: 148834619
Test: manual test
Change-Id: I72949fca2889f9e5612049844a78bf9355b48797
2020-02-25 09:09:08 -08:00
Jaegeuk Kim
7ef2b1d853 Merge "fs_mgr: use "-T now" for tune2fs" 2020-02-25 16:38:25 +00:00
Tom Cherry
0fcb22868d Merge "init: handle property service callbacks asynchronously" 2020-02-25 16:22:28 +00:00
Tom Cherry
9d04b677e3 Merge "logd: don't coalesce identical log messages in the security buffer" 2020-02-25 16:13:58 +00:00
Jaegeuk Kim
5283816074 fs_mgr: use "-T now" for tune2fs
No functional change.

Bug: 149039306
Signed-off-by: Jaegeuk Kim <jaegeuk@google.com>
Change-Id: Ic9dd04f268fcd949ee2e9b30b1598f35ef37b5bf
2020-02-24 19:59:33 -08:00
Joshua Duong
7445a87101 Merge "Properly remove adb DNS services." 2020-02-24 23:19:11 +00:00
Treehugger Robot
19e4f2b5f3 Merge "Adds AID_CONTEXT_HUB" 2020-02-24 19:19:38 +00:00
Yifan Hong
98dc71f4ff Merge "libsnapshot: dump rollback indicator" 2020-02-24 19:00:11 +00:00
Joshua Duong
79a452a923 Properly remove adb DNS services.
Bug: b/150136878
Bug: b/111434128

Test: make
Change-Id: Ibfb92a7c197a25fd1913107d277fbc5f78108c05
2020-02-24 10:09:35 -08:00
Steven Moreland
bdbd0dde26 Merge "libutils: introduce sp<T>::make" 2020-02-24 17:03:19 +00:00
Tom Cherry
df35dfbc59 Merge changes I09a60e61,I2b898e72
* changes:
  liblog: add benchmark tests for not-printed message
  liblog: add __attribute__((uninitialized)) to liblog buffers
2020-02-24 16:10:57 +00:00
Tom Cherry
d9de138e47 Merge "Refactor libinit_test_utils to not use libinit and expose its libraries" 2020-02-24 16:10:56 +00:00
Jooyung Han
57110a4752 Use optional for nullable types
AIDL generates optional<T> for nullable T types for C++, which is more
efficient and idomatic and easy to use.

Bug: 144773267
Test: build/flash/boot
Merged-In: I6bf4c2017f113f4d326fddb1d76163c2fed34d50
Change-Id: I6bf4c2017f113f4d326fddb1d76163c2fed34d50
(cherry picked from commit 5f7f450fa38e752ae49ae91b1bdaf267ec9deea5)
2020-02-24 09:31:47 +09:00
Treehugger Robot
b9c95f8e6a Merge "Remove various bits of dead code and unused workarounds." 2020-02-23 04:16:25 +00:00
Christopher Ferris
c123b6b139 Merge "Rewrite DwarfSectionImpl::InsertFde" 2020-02-22 21:52:48 +00:00
David Srbecky
a6617cb179 Rewrite DwarfSectionImpl::InsertFde
Simplify and fix the algorithm.

For consecutive functions (eg [10,20] [20,30]) without
padding in between, the old algorithm would drop FDEs.

Test: libunwindstack_test
Change-Id: Ie886922bec262fb64d4b2ecf01c2961d0652dcdb
2020-02-22 11:45:42 -08:00
Treehugger Robot
a40c30d172 Merge "Prevent infinite loop on zero length USB descriptors" 2020-02-22 18:44:37 +00:00
Elliott Hughes
f77f6f003c Remove various bits of dead code and unused workarounds.
Test: treehugger
Change-Id: I68fcd5da304d04ff4da3c3f3712fb79ce6b5791e
Merged-In: I68fcd5da304d04ff4da3c3f3712fb79ce6b5791e
2020-02-22 16:53:24 +00:00
Treehugger Robot
0ea130eab1 Merge "incremental_server: fix a use of uninitalized memory" 2020-02-22 09:18:55 +00:00
Joshua Duong
2b9ac8112a Merge "Add adb_pairing* tests to TEST_MAPPING." 2020-02-22 02:10:24 +00:00
Arthur Ishiguro
b5693bdae7 Adds AID_CONTEXT_HUB
This will be used to access the Context Hub.

Bug: 149981913
Test: Compile
Change-Id: Ic89cf5b1a8a01ea7077bf7dd89501ed3623f217d
2020-02-21 16:56:00 -08:00
Josh Gao
af40ce7d57 Merge "adbd: fix build breakage." 2020-02-22 00:50:27 +00:00
Josh Gao
6d949e89a4 adbd: fix build breakage.
This broke because two CLs touching the Android.bp file both
independently passed presubmit, but failed when combined.

Clean up a misindentation while we're at it.

Bug: http://b/150032367
Test: mma in system/core/adb
Change-Id: I091ef9dec806c767ffb21a5fd73b2bb37ab29ff9
2020-02-22 00:43:55 +00:00
Tom Cherry
662b4691b1 liblog: add benchmark tests for not-printed message
Add a BM_log_verbose_overhead test that measure the overhead of
writing a log message that will not be printed due to verbosity
levels.  This was optimized in R to not format the log messages before
checking if they will be logged.

Results with R:
BM_log_verbose_overhead_null_mean          159 ns     159 ns    100
BM_log_verbose_overhead_null_median        159 ns     159 ns    100
BM_log_verbose_overhead_null_stddev        0.568 ns   0.464 ns  100
Results with Q:
M_log_verbose_overhead_null_mean           601 ns     600 ns    100
BM_log_verbose_overhead_null_median        601 ns     600 ns    100
BM_log_verbose_overhead_null_stddev        2.40 ns    2.23 ns   100

This benchmark shows liblog's overhead when not printing a log message
to be nearly ~4x faster than with Q.

Test: run this benchmark
Change-Id: I09a60e61bf064330bf15a9d0a946acf16e777a6d
2020-02-21 16:38:31 -08:00
Tom Cherry
3574c37f98 liblog: add __attribute__((uninitialized)) to liblog buffers
These buffers are immediately written into with *printf() and are in
the hot path, so do not initialize them.  This saves ~70ns off of each
log message, which is ~14% of the overhead within
__android_log_print() when writing to a no-op logger.

Test: liblog benchmarks
Change-Id: I2b898e72c75b57bc63fee565b49a4e00e377ed1a
2020-02-21 16:37:43 -08:00
Joshua Duong
49dd8e560e Add adb_pairing* tests to TEST_MAPPING.
Bug: 111434128

Test: This is the test
Change-Id: I97e4d4ed6318de34a62b60144e790142d00e1629
Exempt-From-Owner-Approval: missed adding it in previous CL.
2020-02-21 16:06:27 -08:00
Josh Gao
744ba42d2d Merge "adbd: remove static dependency on libcutils." 2020-02-22 00:03:21 +00:00
George Burgess IV
19b500bd50 incremental_server: fix a use of uninitalized memory
Without this, the caller is likely to assume that their buffer is
fully usable, which clang's analyzer doesn't believe is the case.

Another option is to set `*size` to nonzero.

Caught by the static analyzer:
system/core/adb/client/incremental_server.cpp:111:31: warning: 1st
function call argument is an uninitialized value
[clang-analyzer-core.CallAndMessage]

Bug: None
Test: TreeHugger
Change-Id: Ib844aa4ab3ebb297ca8f6f4289bbe3212275275b
2020-02-21 14:36:31 -08:00
Joshua Duong
e20d3a006a Merge changes from topic "adbwifi-system-core"
* changes:
  [adbwifi] Add A_STLS command.
  [adbwifi] Add adbwifi_libs, TLS connection, and MDNS implementation.
  [adbd-apex] Export adbd libraries used by system_server.
  [adbwifi] Add pairing_connection library.
2020-02-21 21:07:27 +00:00
Joshua Duong
5cf7868b7e [adbwifi] Add A_STLS command.
This command will be sent by adbd to notify the client that the
connection will be over TLS.

When client connects, it will send the CNXN packet, as usual. If the
server connection has TLS enabled, it will send the A_STLS packet
(regardless of whether auth is required). At this point, the client's
only valid response is to send a A_STLS packet. Once both sides have
exchanged the A_STLS packet, both will start the TLS handshake.

If auth is required, then the client will receive a CertificateRequest
with a list of known public keys (SHA256 hash) that it can use in its
certificate. Otherwise, the list will be empty and the client can assume
that either any key will work, or none will work.

If the handshake was successful, the server will send the CNXN packet
and the usual adb protocol is resumed over TLS. If the handshake failed,
both sides will disconnect, as there's no point to retry because the
server's known keys have already been communicated.

Bug: 111434128

Test: WIP; will add to adb_test.py/adb_device.py.

Enable wireless debugging in the Settings, then 'adb connect
<ip>:<port>'. Connection should succeed if key is in keystore. Used
wireshark to check for packet encryption.

Change-Id: I3d60647491c6c6b92297e4f628707a6457fa9420
2020-02-21 21:07:13 +00:00
Joshua Duong
d85f5c0130 [adbwifi] Add adbwifi_libs, TLS connection, and MDNS implementation.
Bug: 111434128, 119493510, 119494503

Test: Enable wireless debugging in Settings UI, click "pair with pairing code"
to generate pairing code.
On client, 'adb pair <ip_address>', enter pairing code at prompt and hit
enter. Pairing should complete.
'adb logcat'.
Change-Id: I86527bd3fc52e30a8e08ec5843dc3e100abf91fa
Exempt-From-Owner-Approval: approved already
2020-02-21 21:06:40 +00:00
Joshua Duong
16d5bc6ed5 [adbd-apex] Export adbd libraries used by system_server.
Bug: b/111434128
Bug: b/149181583

Test: cat proc/`pidof system_server`/maps | grep libadb
Test: cat proc/`pidof adbd`/maps | grep libadb
Change-Id: Idd36ca31cba7e4dc2d8836d229b23665e69b42fb
Exempt-From-Owner-Approval: approved already
2020-02-21 21:06:28 +00:00
Joshua Duong
c7a1fb8fd9 [adbwifi] Add pairing_connection library.
Bug: 111434128
Bug: 119494503

Test: atest adb_pairing_connection_test
Change-Id: I54d68c65067809832266d6c3043b63222c98a9cd
Exempt-From-Owner-Approval: approved already
2020-02-21 21:06:12 +00:00
Joshua Duong
df8f1217d0 Merge "[adbwifi] Add pairing_auth library." 2020-02-21 21:04:48 +00:00
Joshua Duong
340a5e86d2 [adbwifi] Add pairing_auth library.
Bug: 111434128
Bug: 119494503

Test: atest adb_pairing_auth_test
Change-Id: Ieada7b8d9d8817292175623af55eac235b938c65
Exempt-From-Owner-Approval: approved already
2020-02-21 21:04:39 +00:00
Joshua Duong
d62c817cce Merge "adbd_auth function signature changes." 2020-02-21 21:02:33 +00:00
Joshua Duong
51378f41a1 adbd_auth function signature changes.
Bug: 111434128

Test: make
Change-Id: If801346e436dc7d7a7dfbbc296f7b2393d1e91af
Exempt-From-Owner-Approval: approved already
2020-02-21 20:12:23 +00:00
Jacob Abrams
43d246c5c2 Prevent infinite loop on zero length USB descriptors
If a USB device descriptor has zero length it is invalid and iteration
should stop otherwise the code iterating will go into an infinite loop.

Bug: 149986186
Test: attach bad USB device with invalid descriptor length 0 then attach
a good USB device and ensure it is recognized properly

Change-Id: I7571a6357bdc13af221cf8be01eba16f5bc976a3
2020-02-21 11:11:02 -08:00
Jaegeuk Kim
04bf79dcb4 Merge "fs_mgr: support metadata_csum for ext4 partition" 2020-02-21 05:40:48 +00:00
Yurii Zubrytskyi
b182a3582c Merge "Initialize |sentBlocksCount|" 2020-02-21 05:29:45 +00:00