Commit graph

54889 commits

Author SHA1 Message Date
Nikita Ioffe
cafa75ca22 Merge "FscryptInstallKeyring: don't re-create keyring if it's already created" 2019-12-04 19:27:52 +00:00
Nikita Ioffe
9f71d6193a Merge "Add basic support for remounting ext4 userdata into checkpoint" 2019-12-04 19:22:50 +00:00
Tom Cherry
8fa4d6c382 Merge "init: always kill oneshot services' process groups." 2019-12-04 18:16:19 +00:00
Tom Cherry
ab96d9dec1 Merge "Remove warning from VNDK's <cutils/log.h>" 2019-12-04 18:16:05 +00:00
Nikita Ioffe
1f40c94a1f FscryptInstallKeyring: don't re-create keyring if it's already created
During userspace reboot FscryptInstallKeyring will be called again, this
CL will make it second call a no-op, which IMHO is better than having a
special logic in init to conditionally call FscryptInstallKeyring
depending on whenever it's normal boot, or userspace reboot.

Test: adb reboot userspace
Test: checked in kernel logs that new keyring is not created
Bug: 135984674
Change-Id: I4ad5aee6887b7318fb1cd02bf1c7be8da6ece599
2019-12-04 17:47:37 +00:00
Erwin Jansen
10fdfeb7b8 Merge "Dup the correct fd for qemu pipe." 2019-12-04 17:15:20 +00:00
Christopher Ferris
2da8e3c2ee Merge "Fix support finding global variables." 2019-12-04 17:03:44 +00:00
Tom Cherry
2d5cfa9fa6 Remove warning from VNDK's <cutils/log.h>
We're never going to fix this warning and it's not causing any active
issues that vendors are using this header.  It is however causing
active issues that we have extraneous warning messages in the log.

Bug: 123758136
Test: no build warnings from <cutils/log.h>
Change-Id: Iccf702bf2536ba106a00ac04467d54401cbe2a50
2019-12-04 08:33:49 -08:00
Treehugger Robot
fea51309dc Merge "libsnapshot: Call EnsureImageManager before RemoveAllImages" 2019-12-04 13:53:36 +00:00
Yifan Hong
e62591ec3b libsnapshot: Call EnsureImageManager before RemoveAllImages
Calls to RemoveAllImages may be on uninitialized
image manager.

Test: apply OTA to self

Change-Id: Id57c01ddfdb6985fb2c3c142ee19fd65eef6c131
2019-12-04 00:24:55 -08:00
Christopher Ferris
df683b7439 Fix support finding global variables.
The code was not properly getting the variable addresses and using
the offset and address fields of the .data section.

Fix all of that, and update the tests.

Bug: 145162678

Test: Unit tests pass.
Test: ./art/test/run-test --dex2oat-jobs 4 --host --prebuild --compact-dex-level fast --jit --no-relocate --runtime-option -Xcheck:jni  137-cfi
Test: ./art/test/testrunner/testrunner.py -t 137 --host
Change-Id: Ic61c4487334fd2273cda9c56eb1a3b525a03edb7
2019-12-03 17:35:00 -08:00
Yifan Hong
51fb2a0855 Merge "libsnapshot: start in background" 2019-12-04 00:04:54 +00:00
Wei Wang
6db520807d libsnapshot: start in background
so that it won't block init starting other services on boot_completed.

Test: build
Bug: 145612906
Change-Id: I1ca325b9ef191c4689e925da2e797271ec9c7979
2019-12-03 13:27:05 -08:00
Yifan Hong
3a8001476d Merge changes I8c5ab552,If8546dea
* changes:
  libsnapshot: tests uses common MapUpdateSnapshot/WriteSnapshotAndHash
  libsnapshot: Add test for accounting for hash tree
2019-12-03 19:44:51 +00:00
Yifan Hong
8b8ffbb2df Merge "SOURCE_COPY operation: implement src == dst" 2019-12-03 19:44:35 +00:00
David Anderson
332360fece Merge "libsnapshot: Remove all image data and metadata when cancelling an update."
am: 710d6cc419

Change-Id: If47a068143c7416f1b6aa5e479996f26403a6dd6
2019-12-02 16:46:49 -08:00
David Anderson
710d6cc419 Merge "libsnapshot: Remove all image data and metadata when cancelling an update." 2019-12-03 00:36:56 +00:00
Hans Boehm
174f8d8b1e Merge "Add check to sp<> raw pointer constructor"
am: c532941e54

Change-Id: I10e6b0bc269709e19665f9bd2d5c0b0b2622700d
2019-12-02 15:52:05 -08:00
Hans Boehm
c532941e54 Merge "Add check to sp<> raw pointer constructor" 2019-12-02 23:44:48 +00:00
Alessio Balsini
ef2c39bd6b SOURCE_COPY operation: implement src == dst
Helper function to compare the source and destination extents of a
SOURCE_COPY InstallOperation.
The function returns true iff source and destination are identical with
the use of std::equal().

Bug: 141207436
Test: build
Change-Id: I146aeba1c8ede35f21cfef8e21d4af62274bda84
Signed-off-by: Alessio Balsini <balsini@google.com>
2019-12-02 14:58:17 -08:00
Alessio Balsini
dff772c226 Merge "PartitionCowCreator accounts for extra extents"
am: adb98df120

Change-Id: I0df9eb0def72ea3fdcb1fa8b9c034010cabf21b5
2019-12-02 14:21:13 -08:00
Treehugger Robot
adb98df120 Merge "PartitionCowCreator accounts for extra extents" 2019-12-02 22:08:49 +00:00
Yifan Hong
18a78959ab libsnapshot: tests uses common MapUpdateSnapshot/WriteSnapshotAndHash
Factor out duplicated code.
Test: run it

Change-Id: I8c5ab552b97837b0e37cada6263eeda23f7f71b4
2019-12-02 13:59:48 -08:00
Yifan Hong
defcbb4b7f libsnapshot: Add test for accounting for hash tree
Test: libsnapshot_Test
Bug: 145180464
Change-Id: If8546dea89fdd7ec7499522a232a777699c52d82
2019-12-02 13:59:48 -08:00
Alessio Balsini
33836a6061 PartitionCowCreator accounts for extra extents
dm-verity and error correction use part of the partitions using these
features to store their data.  Their data may be modified during an
update, so the COW device for the dm-snapshot must reserve some extra
space for them.
This patch extends the PartitionCowCreator data structure with the
extra_extents field that will store the (optional) additional extents,
e.g., the hash table extent for dm-verity or the error correction
extent.

Test: incremental OTA apply
Test: libsnapshot_test
Bug: 145180464
Change-Id: I387a6cc8438507ad41a85cc3400241ecaf627b8f
Signed-off-by: Alessio Balsini <balsini@google.com>
2019-12-02 12:49:38 -08:00
Erwin Jansen
4f138b2ce8 Dup the correct fd for qemu pipe.
Logcat dup-es STDOUT and used the dup-ed file descriptor to write logging
information. Because of this writes happen on that fd and not on stdout.
This in turn causes no output in the LogcatService in the emulator.

The qemu-pipe forwarder now dup-es the same fd as logcat is using so
that we receive data again.

Bug: b/145214141
Test: Logcat works again in emulator 29.2.10
Change-Id: Ia6e2430f1d7a0476a5b438d315a9ea337c13806d
2019-12-02 18:56:27 +00:00
Nikita Ioffe
eea98abcb3 Merge "Fix typo in userspace reboot watchdog"
am: 4ac630b562

Change-Id: I825d646a7f86e17b43b75cd4c422867fb110a6cb
2019-12-02 10:44:37 -08:00
Nikita Ioffe
4ac630b562 Merge "Fix typo in userspace reboot watchdog" 2019-12-02 18:38:01 +00:00
Bowgo Tsai
903f7bee11 Merge "Adding require_root for libfs_avb_device_test"
am: b99ead6b24

Change-Id: Ic8cf2e479ef312dea1ff8964ea99de9a0b0f75f7
2019-12-02 10:34:35 -08:00
Treehugger Robot
b99ead6b24 Merge "Adding require_root for libfs_avb_device_test" 2019-12-02 18:30:23 +00:00
Maciej Żenczykowski
bfa5a805a2 Merge "Properly size response buffer in ifc_act_on_address"
am: b407aca123

Change-Id: I18198ddedf133aaeff3c3a8e10fd8b3304beef0a
2019-12-02 04:57:32 -08:00
Maciej Żenczykowski
b407aca123 Merge "Properly size response buffer in ifc_act_on_address" 2019-12-02 12:50:08 +00:00
Nikita Ioffe
bee7b8c811 Add basic support for remounting ext4 userdata into checkpoint
Metadata encrypted ext4 userdata and v2 encryption keys will be
supported in follow up CLs.

Test: adb shell /system/bin/vdc checkpoint startCheckpoint 1
Test: adb reboot userspace
Bug: 135984674
Bug: 143970043
Change-Id: I8dbf3bddd811cf54d3f2b2ee2c1ea64159d8c6e0
2019-12-02 11:59:51 +00:00
Lorenzo Colitti
a9027581bd Properly size response buffer in ifc_act_on_address
Currently, any netlink error reported in ifc_act_on_address is
reported as EINVAL, because the receive buffer is too short and
the NLMSG_OK check fails on it.

Make the buffer long enough so the function can return the
correct netlink error to the caller.

Test: new test coverage in other CL in this topic
Change-Id: Ica752db834a0fd614312b800d88721826be08d56
2019-12-02 17:37:39 +09:00
Maciej Żenczykowski
1de06e942f Merge "Return a valid error code when adding an invalid IP address."
am: f3ff94b702

Change-Id: I55425950fe2f328c7e7ce46af5eda52e2c53b311
2019-12-01 23:34:41 -08:00
Maciej Żenczykowski
f3ff94b702 Merge "Return a valid error code when adding an invalid IP address." 2019-12-02 07:31:28 +00:00
Bowgo Tsai
110988d57a Adding require_root for libfs_avb_device_test
The test requires to load and verify vbmeta struct from partitions,
and thus needs adb root.

Bug: None
Test: atest libfs_avb_device_test
Change-Id: I4924d6e41edc78898d9ef9c3d7f52c9066f750b1
2019-12-02 15:07:58 +08:00
Lorenzo Colitti
c3d38969ca Return a valid error code when adding an invalid IP address.
Currently, passing an invalid IP address to interfaceAddAddress
and friends results in an invalid error message:

    12-02 13:00:42.675 interfaceAddAddress("testtap2355", "2001:db8::1/64", 64) -> ServiceSpecificException(-8, "InterfaceController error: Unknown error -8") <1.63ms>

This is due to confusion between getaddrinfo error codes and
errno values.

Test: new unit test added to IpClientIntegrationTest
Change-Id: Ifdaa4281a9bcf3998e3216472c5c1df0f5285214
2019-12-02 13:42:20 +09:00
Martijn Coenen
9d1a6c3636 Merge "Remove bootstrapping the passthrough mount."
am: 58bd37f1e3

Change-Id: I31db20bfedf19311c1146d0ae3420a72ec23e8e5
2019-11-29 00:46:24 -08:00
Martijn Coenen
58bd37f1e3 Merge "Remove bootstrapping the passthrough mount." 2019-11-29 08:41:37 +00:00
Josh Gao
faa9de5223 Merge "[adb] Optimize adbd's usb reading"
am: 4372726afd

Change-Id: I6c058784cae994a2a7add951659c986763db6523
2019-11-28 23:42:42 -08:00
Josh Gao
4372726afd Merge "[adb] Optimize adbd's usb reading" 2019-11-29 07:39:10 +00:00
Yurii Zubrytskyi
5dda7f6cea [adb] Optimize adbd's usb reading
Try to not allocate as many blocks on the heap, and reuse
memory instead of copying it

Get rid of unique_ptr and shared_ptr where possible, move
the Block objects themselves

Overall this reduces the time spent in memcpy() from 30% to
15% of the whole 'adb push' command, and gets rid of about 5%
of the time spent in the malloc/free calls

Test: builds
Change-Id: I8995115274b6f08a4df13c58183c928ef384a767
2019-11-28 18:24:01 -08:00
Nikita Ioffe
57d7bb695b Fix typo in userspace reboot watchdog
Test: adb reboot userspace
Bug: 135984674
Change-Id: I4003683307a22e8d744748fb1311c16eb5ee1428
2019-11-28 18:25:24 +00:00
Yifan Hong
c3e0ca1911 Merge "libsnapshot: Fix test UpdateBootControlHal"
am: 834e4751e6

Change-Id: I93a3e5a36b5980f004b18257fcd74b16a13fe735
2019-11-27 13:13:03 -08:00
Yifan Hong
834e4751e6 Merge "libsnapshot: Fix test UpdateBootControlHal" 2019-11-27 21:04:39 +00:00
Shuo Qian
3b469dea10 Merge "A system folder for emergency number database OTA"
am: 8834223ff8

Change-Id: I86dc6f417c2e78a34bc374755c3dd2a12cc41513
2019-11-27 12:06:48 -08:00
Shuo Qian
8834223ff8 Merge "A system folder for emergency number database OTA" 2019-11-27 19:14:50 +00:00
Shuo Qian
f0e65d852a A system folder for emergency number database OTA
Test: Manual; tested with the other CL in the same topic
Bug: 136027884
Change-Id: Ia5675613b9ae19927108d089955d2900d97c892c
2019-11-27 19:04:39 +00:00
Yifan Hong
7004dbaa36 Merge changes Ifc76203e,I194d15cf
am: 217e10e3d4

Change-Id: I16185fb60a4d74f04b9dade807896f2e8c8a4449
2019-11-27 10:52:58 -08:00