Commit graph

55735 commits

Author SHA1 Message Date
Joshua Duong
663b3c9d88 Some minor fixes to libadb_tls_connection.
Bug: 111434128

Test: atest adb_tls_connection_test
Exempt-From-Owner-Approval: approved
Change-Id: I4c23cc6ba5b14b65122e61297554dedabf43d0b4
2020-02-18 22:14:48 +00:00
Joshua Duong
a71ba615ea Merge changes from topic "adbwifi-client-mdns"
* changes:
  add a version TXT record to adb secure mdns services
  adbd: only register dnsservices via explicit API
  adb client interface for secure services
  get the ip address info for all DNS services
  make the client browse for appropriate mdns services
  Add mDNS services for pairing and connect
2020-02-18 05:14:19 +00:00
Lingfeng Yang
39e54b8c5b add a version TXT record to adb secure mdns services
In the context of secure connect, allows adbd and host adb to reject
each other based on incompatible versions without even having to
actually connect (since it is a DNS TXT).

Bug: 111434128, 119490749

Test: N/A
Exempt-From-Owner-Approval: already approved
Change-Id: I54312d8b67370c397ba81ecdbca1b27e3ee58572
2020-02-18 05:13:06 +00:00
Lingfeng Yang
615036f494 adbd: only register dnsservices via explicit API
For privacy/security reasons, let's not broadcast the adb secure
services on startup automatically, and instead leave that up to
the rest of the adbd code somehow.

Instead, this CL adds an API in daemon/mdns.h that lets the user
control when registration happens, potentially only doing so if
the developer option is enabled or something.

Bug: 111434128, 119490749

Test: N/A
Exempt-From-Owner-Approval: already approved
Change-Id: Idc994a59ef9e5d48f08796c21989883497e19ef8
2020-02-18 05:12:52 +00:00
Lingfeng Yang
cef4ade8e1 adb client interface for secure services
This CL exposes a callback-based interface to perform some action for
each resolved pairing/connect service as a function of their hostname,
ip address, and port.

The ADB client can then use this information to either set up secure
connections directly, or to tell the adb host server to do so, or
something.

Bug: 111434128, 119490749

Test: N/A
Exempt-From-Owner-Approval: already approved
Change-Id: I2dd04c322df5b0597859f44703cfd2f3f29fd737
2020-02-18 05:12:36 +00:00
Lingfeng Yang
4b62bcde04 get the ip address info for all DNS services
This CL adds functionality to the class ResolvedService where the ip
address associated with a resolved DNS service is recorded.

It also avoids connecting to the device unless it is the Things-related
DNS service.

Next step is to add some kind of interface in other parts of adb code
to retrieve these IP addresses.

Bug: 111434128, 119490749

Test: N/A
Exempt-From-Owner-Approval: already approved
Change-Id: I46895a7a5bf5660f524c7323a9454f1e2c7d385c
2020-02-18 05:12:25 +00:00
Lingfeng Yang
c712f2db76 make the client browse for appropriate mdns services
This CL makes it so the client looks for the adb secure pairing
and adb secure connect services. Nothing else should happen,
but this should be useful to see if the right packet traffic for
discoverability is happening.

Bug: 111434128, 119490749

Test: N/A
Exempt-From-Owner-Approval: already approved
Change-Id: I266bdb8526cf39bbfa131344dca2b1bb14c14a7b
2020-02-18 05:10:52 +00:00
Lingfeng Yang
be49d8a2a9 Add mDNS services for pairing and connect
- ADB Secure Pairing
- ADB Secure Connect

Nothing else is implemented.

Bug: 111434128, 119490749

Test: N/A
Exempt-From-Owner-Approval: already approved
Change-Id: I2e7873b62a3c7631451e47f6a301f8c4a5ffa2e2
2020-02-18 05:07:32 +00:00
Treehugger Robot
e87527faa3 Merge "Utility class to measure snapshot merge duration" 2020-02-18 02:12:16 +00:00
Alessio Balsini
cd3915d2e7 Utility class to measure snapshot merge duration
With the Virtual A/B feature, when the device successfully boots after an OTA
update, a dm-snapshot merge operation is performed, which consolidates the
updated images to the base devices.  This merge operation depends on the OTA
size and may affect the device performance until completed.
Create the SnapshotMergeStats class that takes care of measuring the duration
of a merge operation and manages the merge state file to continue tracking the
merge in the case of an interruption due to a reboot.

Bug: 138817833
Test: m
Change-Id: I9dcf1423716c89d8f9b4a0feb4e75bb7b9d18935
Signed-off-by: Alessio Balsini <balsini@google.com>
2020-02-17 16:36:36 +00:00
Treehugger Robot
34ad19f4c4 Merge "snapshot: helper to get access snapshot_state path" 2020-02-17 12:31:49 +00:00
Wei Wang
71fcaf5726 Merge "fsmgr: print unabbreviated log when exec child commands" 2020-02-15 07:06:37 +00:00
Suren Baghdasaryan
36ef05cbde Merge "Set lowmemorykiller kernel driver parameters before lmkd is started" 2020-02-15 01:02:08 +00:00
Treehugger Robot
7550e6f882 Merge "bootstat: enhance last reboot reason property with file backing" 2020-02-14 23:36:49 +00:00
Wei Wang
02e89ecdb5 fsmgr: print unabbreviated log when exec child commands
logs need to be printed at time when it is generated by the child
process which is very useful to understand the boottime impact of
those blocking commands.

Bug: 149418646
Test: boot
Change-Id: Ibee343af6088d57b2976bceb812abb58f3b3f610
2020-02-14 23:34:39 +00:00
Mark Salyzyn
ee016ce0b3 bootstat: enhance last reboot reason property with file backing
Helps with support of recovery and rollback boot reason history, by
also using /metadata/bootstat/persist.sys.boot.reason to file the
reboot reason.

Test: manual
Bug: 129007837
Change-Id: Id1d21c404067414847bef14a0c43f70cafe1a3e2
2020-02-14 13:24:16 -08:00
Alessio Balsini
be0e44d0f1 snapshot: helper to get access snapshot_state path
/metadata/ota/snapshot_state is a temporary file that keeps track of
snapshot merge operations across reboots.

Bug: 138817833
Test: m
Change-Id: I9785db3f73e1575b8ac8a522d938d09f8948e1b0
Signed-off-by: Alessio Balsini <balsini@google.com>
2020-02-14 20:49:08 +00:00
Suren Baghdasaryan
e6f2b7d884 Merge "libprocessgroup: Prevent SetProcessProfiles from using cached fd" 2020-02-14 20:17:39 +00:00
Mark Salyzyn
48c0de4907 Merge changes I5b4a87d6,I131315d4
* changes:
  fs_mgr: overlayfs: test: if wait_for_screen times out, skip later
  fs_mgr: remount: add -v option
2020-02-14 19:20:23 +00:00
Mark Salyzyn
f7aa5403c5 fs_mgr: overlayfs: test: if wait_for_screen times out, skip later
To improve the test period for adb-remount-test.sh, if the device
fails to get to the launcher on the first try when wait_for_screen,
then print a warning to skip all later wait_for_screen conditions.

The wait_for_screen testing is really there to deal with first
confirming that the device is capable of getting to the launcher,
and that later tests that influence corners of adb remount behavior
do not result in a failure to get to the launcher screen.  The
developer should look into ways to fix the failure to get to the
launcher on the first try, but failure to do so should have no
bearing on the remaining tests, so dropping the wait_for_screen
functionality is not an issue.

Signed-off-by: Mark Salyzyn <salyzyn@google.com>
Test: adb-remount-test.sh
Bug: 148881519
Change-Id: I5b4a87d6e1f545a304eb74f2114aadd1128f25b3
2020-02-14 11:19:35 -08:00
Mark Salyzyn
ba2449b6ca fs_mgr: remount: add -v option
By default print only ERROR message, or messages without a source
(eg: [fs_mgr]) library.  Print all messages to stderr if the -v
option is added.  Always log all messages to the Android logger.

Signed-off-by: Mark Salyzyn <salyzyn@google.com>
Test: adb-remount-test.sh
Change-Id: I131315d4bae6ed29991043033811cf22e6032f8b
2020-02-14 11:19:35 -08:00
Joshua Duong
fd8b4ea996 Merge changes from topic "adbwifi-syscore-base"
* changes:
  [adbwifi] Add tls_connection library.
  Move adb RSA utilities into its own library.
  [adbwifi] Add adb protos.
2020-02-14 17:42:40 +00:00
Joshua Duong
4293e322f2 [adbwifi] Add tls_connection library.
Bug: 111434128, 119494503, 119493510

Test: atest adb_tls_connection_test
Exempt-From-Owner-Approval: yolo?
Change-Id: Ie9b629e4cb955702cec890bbb89a6a762e4b71b3
2020-02-14 17:41:36 +00:00
Suren Baghdasaryan
911109c414 libprocessgroup: Prevent SetProcessProfiles from using cached fd
Because we cache file descriptors associated with cgroup "tasks" file it
should not be used with SetProcessProfiles API which operates on entire
processes rather than tasks. Change SetProcessProfiles API to prevent
cache fd usage, modify ExecuteForProcess to not attempt to use cached
fd. Also fix unconditional calls to EnableResourceCaching from
ExecuteForTask which should be called only when SetTaskProfiles is used
with use_fd_cache set to true.

Bug: 149524788
Change-Id: I880efaf8217a4dd7ccfbb4fb167b2295cefc057a
Signed-off-by: Suren Baghdasaryan <surenb@google.com>
2020-02-14 01:42:11 +00:00
Suren Baghdasaryan
6898682275 Set lowmemorykiller kernel driver parameters before lmkd is started
When kernel lowmemorykiller driver is enabled lmkd detects it by
checking write access to /sys/module/lowmemorykiller/parameters/minfree
parameter. By default this file does not have write access and init
process changes that from "on boot" section of init.rc. However
"on boot" is never executed in the charger mode, therefore lmkd fails
to detect the kernel driver. Fix this by setting lowmemorykiller kernel
driver parameters before lmkd is started.

Bug: 148572711
Test: boot into charger mode with kernel lmk driver enabled
Change-Id: Ifc3ef725b95bdb5f7d801031429dc26bae014d1f
Signed-off-by: Suren Baghdasaryan <surenb@google.com>
2020-02-14 01:40:29 +00:00
Treehugger Robot
c7b92ea120 Merge "Consume design capacity in health HAL 2.1" 2020-02-14 01:35:16 +00:00
Jeffrey Huang
fd73daa049 Merge "Add apex available to liblog" 2020-02-14 00:45:22 +00:00
Treehugger Robot
05aff5b211 Merge "Preserving /avb/* keys to /metadata" 2020-02-13 23:52:40 +00:00
Stephane Lee
1c108edc74 Consume design capacity in health HAL 2.1
Bug: 149121450
Test: lshal debug <health hal 2.1>
Change-Id: I005fa47bda7e58f6636fdc87293227622d74187a
2020-02-13 15:14:40 -08:00
Jeffrey Huang
66f58a3ecc Add apex available to liblog
Bug: 145923087
Test: m -j
Change-Id: I3ac890cbc71ad062ff095adfa2272f6f76db466b
2020-02-13 12:46:09 -08:00
Ray Essick
59de77e777 Merge "build code_coverage.policy with Android.bp" 2020-02-13 17:13:23 +00:00
Bowgo Tsai
196cc58781 Preserving /avb/* keys to /metadata
Those keys will be used for key revocation check by DSU installation
service. Note that failing to copy those keys to /metadata is NOT fatal,
because it is auxiliary to perform public key matching prior to booting
into DSU images on next boot. The actual key matching will still be done
on next DSU boot.

Bug: 146910547
Test: boot device, checks the avb keys are copied to /metadata/gsi/dsu/avb/.
Change-Id: I25a4eba82e84288bac7a859205c920628a063651
2020-02-13 15:15:20 +08:00
Jeffrey Huang
ab19b995be Merge "Add apex available to libutils" 2020-02-13 06:06:02 +00:00
Jeffrey Huang
18986cb220 Add apex available to libutils
Bug: 145922701
Test: m -j
Change-Id: I32a15359bc2f97675f8b5e7e112978667f43bf4f
2020-02-12 17:57:04 -08:00
Ray Essick
1dbd649cf7 Merge "build crash_dump.policy files using Android.bp" 2020-02-12 22:43:12 +00:00
Treehugger Robot
4ddb495354 Merge "fs_mgr: fstab: Fix parse warning typo" 2020-02-12 18:20:49 +00:00
Yifan Hong
da8a404473 Merge changes from topic "snapshotctl_log"
* changes:
  libsnapshot callstack files readable by dumpstate
  snapshotctl logs readable by dumpstate
  snapshotctl_log dir readable by dumpstate
2020-02-12 18:18:59 +00:00
Treehugger Robot
684122a264 Merge "fs_mgr: overlayfs: CreateDynamicScratch for *partition_exists" 2020-02-12 18:00:41 +00:00
Felix
92ed423711 fs_mgr: fstab: Fix parse warning typo
Looks like a copy-paste omission.

Change-Id: Ib8ad3a938654786747540690f4bba93d6573d74d
Signed-off-by: Felix <google@ix5.org>
2020-02-12 17:30:28 +01:00
Joshua Duong
ef28ca4cdc Move adb RSA utilities into its own library.
Since both the client and daemon will now be generating keys.

BUG: b/111434128

Test: atest adb_crypto_test
Change-Id: I6fac562ae5629ab30b6639fbd88d822dae6e96bd
2020-02-11 20:49:20 -08:00
Joshua Duong
9e96e71067 [adbwifi] Add adb protos.
BUG: b/111434128

Test: make
Change-Id: I7eef85c773e219e1873c9fbc30d14c17c110c3bf
2020-02-11 20:49:15 -08:00
Treehugger Robot
2929ab63e3 Merge "storaged:Thread out of sync will cause null pointer crash" 2020-02-12 02:04:43 +00:00
Steven Moreland
824418c370 Merge "String16: operator<<" 2020-02-11 22:43:26 +00:00
Treehugger Robot
ef0252108c Merge "Initialize key structure to zero in charger" 2020-02-11 21:41:17 +00:00
Zimuzo Ezeozue
ec9c803503 Merge "Explicitly disable FUSE" 2020-02-11 21:17:53 +00:00
Treehugger Robot
3d6154ffe9 Merge "[vts-core] fix the test error of KernelLibcutilsTest." 2020-02-11 21:15:57 +00:00
Yifan Hong
faa49d1d00 libsnapshot callstack files readable by dumpstate
Set callstack logs as 0644 so that they are readable
by dumpstate.

Test: take OTA, cancel, delete /data/misc/update_engine/prefs/*
manually, retrigger OTA (so that callstack is logged), then re-take bug report
Bug: 148818798

Change-Id: I598e484b57dcd3ce6ed7bb483aee57ce2ba881e7
2020-02-11 10:57:51 -08:00
Yifan Hong
bdf93248a3 snapshotctl logs readable by dumpstate
Set persistent logs for snapshotctl to 0644
so that they are readable by dumpstate.

Not using mode field in open() because it is masked
by umask. Directly use fchmod instead.

Test: reboot and take bugreport
Bug: 148818798

Change-Id: I515f8fd1345fcfb82aa2a1ec0c95da4b6921c039
2020-02-11 10:57:51 -08:00
Yifan Hong
7d28688f96 snapshotctl_log dir readable by dumpstate
Set snapshotctl_log as 0755 so that it is
readable by dumpstate.

Test: bugreport
Bug: 148818798
Change-Id: I6ff52cf0a2e928c74df31aa054ae780f919d6eb0
2020-02-11 10:57:51 -08:00
Ray Essick
1e9375d6ac build code_coverage.policy with Android.bp
use Android.bp instead of Android.mk;
This also allows build to include the files within an apex

Bug: 147914640
Test: build, check filesystem
Change-Id: I574d9ce984e09af95c7673494c8c714169f69b08
2020-02-11 10:33:38 -08:00