Commit graph

88943 commits

Author SHA1 Message Date
Akilesh Kailash
bc3476d5dc Merge "libsnapshot: Propagate legacy_snapuserd status during WriteUpdateState" into main 2024-03-27 16:39:44 +00:00
Nikita Ioffe
7400cba410 Merge "Remove check that only allows microdroid vendor partition on debuggable VMs" into main 2024-03-27 12:26:44 +00:00
Akilesh Kailash
b0cf1d2370 libsnapshot: Propagate legacy_snapuserd status during WriteUpdateState
Bug: 304829384
Test: OTA on Pixel
Change-Id: I841612c111148523d13166051512314d6fa1986f
Signed-off-by: Akilesh Kailash <akailash@google.com>
2024-03-26 19:59:02 -07:00
Daniel Zheng
98df25ba2e Merge "libsnapshot: Cache Ops correctly" into main 2024-03-26 21:55:13 +00:00
Daniel Zheng
abd3552713 Merge "libsnapshot: remove temporary solution" into main 2024-03-26 21:55:13 +00:00
Nikita Ioffe
d28f45772f Remove check that only allows microdroid vendor partition on debuggable VMs
The microdroid vendor partition is now verified during Microdroid boot,
so no need for this check.

Bug: 287593065
Test: AVF presubmit
Change-Id: I84811f818ef1140f1fe93d9da5f9ee61341e75dd
2024-03-26 18:04:21 +00:00
Akilesh Kailash
ea88c191e1 Merge "snapuserd: Use snapshots during install" into main 2024-03-26 16:36:09 +00:00
Akilesh Kailash
c375878b8e snapuserd: Use snapshots during install
If on Androd 12, continue to use snapshots

Bug: 304829384
Test: OTA on Pixel
Change-Id: I94890c308e7f297b695ddbd71659ebb1cf4d278c
Signed-off-by: Akilesh Kailash <akailash@google.com>
2024-03-26 16:36:01 +00:00
Akilesh Kailash
ad55fad080 Merge "libsnapshot: Enable snapshots during OTA install for S vendor" into main 2024-03-25 21:15:08 +00:00
Akilesh Kailash
35d5c94bb0 libsnapshot: Enable snapshots during OTA install for S vendor
ro.virtual_ab.userspace.snapshots.enabled is a vendor property which isn't present in Android S. Hence, during OTA install with S vendor, userspace_snapshots is disabled.

However, both update_engine and snapuserd are already on the system partition during install. Hence, forcefully enable userspace_snapshots if this is a path of legacy dm-snapshots with Vendor on Android S.


Bug: 331156940
Test: OTA tests on treehugger, pixel OTA
Change-Id: I3d1c03493d83e670e37df088d4b676c4aa1dc720
Signed-off-by: Akilesh Kailash <akailash@google.com>
2024-03-25 21:10:05 +00:00
Chris Sarbora
7199051aaf Wait for disconnect when rebooting to userspace FB
Wait for the device to disconnect when rebooting to userspace fastboot.
This is a particular problem for USB-over-IP devices, which must tunnel
the USB commands over a relatively-slow network and thus will not
disconnect as quickly as local ones.

Only currently effective for Linux hosts, since LinuxUsbTransport is the
only transport that implements WaitForDisconnect().

Test Plan:
provision with a usbip-attached device, see flash succeed

Change-Id: Ia8903dfa6e40755377870fbeaef9162934f992a0
2024-03-25 14:53:10 -05:00
Akilesh Kailash
da9db4f396 Merge changes Id9263be8,Idd9a60b0 into main
* changes:
  snapuserd: Remove legacy dm-snapshot based snapshot and snapshot-merge
  libsnapshot: Prepare removal of legacy snapshot
2024-03-25 07:50:30 +00:00
Treehugger Robot
ba28275e29 Merge "Add //visibility:any_system_partition" into main 2024-03-25 02:06:17 +00:00
Jeongik Cha
6d7e83fb42 Add //visibility:any_system_partition
system image which is declared in Android.bp should include the module.

Bug: 321000103
Test: m nothing
Change-Id: I6e9d8fa4c1051211ff9ff80c7dfa4a8ee5cbd732
2024-03-23 12:31:32 +09:00
Daniel Zheng
3326685511 Merge "cow_api_test: big replace op" into main 2024-03-22 21:48:13 +00:00
Daniel Zheng
5e8e488c13 libsnapshot: Cache Ops correctly
Change the meaning of batch_size_. Previously, a batch size of 200 meant
200 compressed data ops. With variable block size, each compressed data
op can be up to 256k uncompressed size -> batch size meaning should be
changed to 200 blocks of block size.

With this being said, the default batch size can be increased to 4mb to
better accomodate variable block size

The way we calculate the number of blocks to compress at once also
needs to be changed. Since there's no way of determining the comperssed
data size ahead of time, allow overwriting the cache by batch_size_ and
then flushing the cache as needed

Bug: 322279333
Test: Ota on pixel and measuring system image cow
Change-Id: Ie8e08d109dc5c3b4f5f36a740bbbcd37362a7ab3
2024-03-22 14:47:45 -07:00
Daniel Zheng
d7efbea407 cow_api_test: big replace op
With the modified cache system we might be processing big replace ops at
once. Our old tests didn't catch a case where a big replace op was
chunked into seperate batch writes.

Test: cow_api_test
Change-Id: I3bc80a2f9ed3e4c73dd9f74d9affaba79d49e4d2
2024-03-22 14:47:45 -07:00
Daniel Zheng
6bee318285 Merge "libsnapshot: chunk iov writes" into main 2024-03-22 18:46:08 +00:00
Treehugger Robot
e0b55e5a7c Merge "tombstoned: Rename proto tombstone before text tombstone." into main 2024-03-22 04:58:37 +00:00
Peter Collingbourne
7285c0d1bb tombstoned: Rename proto tombstone before text tombstone.
Because the log message "Tombstone written to: $NAME" is written
before renaming the proto tombstone, it is possible that a tool that
automatically downloads new proto tombstones by watching for this
log message will fail to download the tombstone. For the tool that
I am developing, this occurs < 0.1% of the time. Fix the issue by
renaming the proto tombstone first.

Bug: 328531087
Change-Id: I5b751585f2fce897ca7eb76c0466a0c33a93d851
2024-03-21 18:28:08 -07:00
Daniel Zheng
c60d2fc566 libsnapshot: chunk iov writes
Currently if our iov that we are trying to write is greater than 1024
our write will fail with error "INVALID ARGUMENT". This is because
pwritev() system call takes a max input size of IOV_MAX (which is device
dependant).

With our increased cache size of 1mb or maybe even more (or if user
configures batch size to be large), our write size could be greater than
IOV_MAX, and will fail with an unhelpful error. We should chunk these
writes to ensure they succeed.

Bug: 322279333
Test: cow_api_test + manual testing with large iov write sizes
Change-Id: Ia1fb53cbfc743cfcdfc7256ff9df075ad0c2dd38
2024-03-21 10:52:37 -07:00
Treehugger Robot
a8c6a92f43 Merge "liblp_builder_fuzzer: Bug Fix" into main 2024-03-21 04:29:17 +00:00
Akilesh Kailash
844ce86595 Merge "snapuserd_test: check writer != nullptr" into main 2024-03-21 02:53:03 +00:00
Akilesh Kailash
92b7d837b9 snapuserd_test: check writer != nullptr
Cow Writer used to fail with ENOSPC during initialization.

Try temporaryFile creation with path set to current working directory.

Bug: 328879200
Test: th, snapuserd_test
Change-Id: I7b3833967952c74142f1d5a35cb8d94dd6d894fc
Signed-off-by: Akilesh Kailash <akailash@google.com>
2024-03-21 00:21:11 +00:00
Hansen Kurli
6ec79b5605 Merge "Create directory for /data/misc/connectivityblobdb" into main 2024-03-20 20:27:18 +00:00
Treehugger Robot
12c4de877e Merge "turn on aconfigd in init" into main 2024-03-20 18:49:51 +00:00
Akilesh Kailash
10233e2fc4 snapuserd: Remove legacy dm-snapshot based snapshot and snapshot-merge
Clean up all the legacy dm-snapshot based approach.

This will continue to maintain backward compatibility with vendor
partition on Android S.

Bug: 304829384
Test: OTA on Pixel
th - OTA from Android S to TOT with vendor on S
Change-Id: Id9263be881dd1a06923cd0ace007f1c027e6969d
Signed-off-by: Akilesh Kailash <akailash@google.com>
2024-03-20 11:10:49 -07:00
Akilesh Kailash
25eabc44f5 libsnapshot: Prepare removal of legacy snapshot
During OTA install, when vendor partition is on Android S, add a new flag in SnapshotUpdateStatus file to indicate that we need to support dm-snapshot based snapshot process. This will be used only during post OTA reboot.

The primary change here is the OTA install path. Earlier, dm-snapshot based approach was used; with this change, since both "snapuserd" and "update-engine" resides on system partition, OTA installation will use the userspace snapshot approach.

To maintain backward compatibility, the new flag "legacy_snapuserd" is used only after OTA reboot. This flag will make sure that update-engine will take the dm-snapshot based approach post reboot and for the entire duration of snapshot-merge.

Additionally, during first-stage init if the vendor is on Android S, then "snapuserd" binary will continue to work based off dm-snapshot as none of this change will impact the mount process.

Bug: 304829384
Test: OTA on Pixel
th - OTA from Android S to TOT with vendor on S
Change-Id: Idd9a60b09417cee141b2810e2d4b35e91c845a5c
Signed-off-by: Akilesh Kailash <akailash@google.com>
2024-03-20 11:08:18 -07:00
Dennis Shen
9e17d3a032 turn on aconfigd in init
Bug: b/312444587
Test: avd
Change-Id: Ibc88b57f88f924318d54ae81c70fd8da1fc1b437
2024-03-20 16:33:28 +00:00
Justin Yun
d49456a11f Merge "Avoid duplicated definition in llndk-versioning.h" into main 2024-03-20 00:17:15 +00:00
Treehugger Robot
f52256ea25 Merge "trusty: rpmb_dev: Use socket from init and update init script" into main 2024-03-19 21:28:30 +00:00
Treehugger Robot
b03f02bca4 Merge "toolbox/libmodprobe: add toolbox to vendor_ramdisk" into main 2024-03-19 20:08:30 +00:00
Arve Hjønnevåg
294ba38082 trusty: rpmb_dev: Use socket from init and update init script
Stop creating a socket on a persistent filesystem and use a socket
created by init in /dev/socket/ instead.

Many init script changes to make rpmb_dev.rc usable on cuttlefish.

Test: Build and run aosp_cf_x86_64_phone_trusty_vm-trunk_staging-userdebug
Bug: 309007107
Change-Id: Idc830211b3298d25bbb310dcb7489dd89fe5afc6
2024-03-19 20:02:34 +00:00
Mitch Phillips
da9ec0cd05 Merge "[MTE] Implement permissive (recoverable) MTE for apps" into main 2024-03-19 19:06:13 +00:00
Florian Mayer
effe539c30 Merge "Do not chmod ANRs" into main 2024-03-19 18:25:42 +00:00
Elliott Hughes
0fee60a79a Merge "Use _Fork()." into main 2024-03-19 14:48:20 +00:00
Mitch Phillips
31407917f8 [MTE] Implement permissive (recoverable) MTE for apps
Extends the recoverable native crash handling support to also allow for
MTE crashes to be recovered from in apps. Backs onto the existing
GWP-ASan recoverable handling.

At least for system/core, I've renamed the (now) generic "recoverable
crash" variables to remove the notion of GWP-ASan.

Permissive MTE should no longer crash an app, and crashes are still
visible in the AppExitInfo API and tombstones.

Test: atest CtsTaggingHostTestCases
Bug: 328793166
Change-Id: I4c6ffa85af0e0d9b72d0ccd606bb6e1ca464cfff
2024-03-19 11:26:02 +01:00
Harsh Abichandani
553c9d4fb6 liblp_builder_fuzzer: Bug Fix
Updated FuzzedDataProvider value ranges to avoid Abort due to division by zero.

exec/s: 14786
Test: ./liblp_builder_fuzzer clusterfuzz-testcase-minimized-liblp_builder_fuzzer-5371251289292800
Bug: 328948968

Change-Id: I2568bd104b5fb09744baf42ffca6aabd24797b12
2024-03-19 13:36:07 +05:30
Justin Yun
0fb8da9a05 Avoid duplicated definition in llndk-versioning.h
Non-vendor modules may define llndk versioning macros manually. Avoid
redefining the macros if they are already defined outside of
llndk-versioning.h header.

Bug: 302113279
Test: m && m cts

Change-Id: Ibf984f2f2eed3594c824f2e97e17f2698e0515dd
2024-03-19 16:42:26 +09:00
Daniel Zheng
550a176551 Merge "libsnapshot: reserve 16x space for ops" into main 2024-03-19 07:34:57 +00:00
Daniel Zheng
8e6ab87328 libsnapshot: reserve 16x space for ops
We have updated logic for v3 cow we should allow non-data ops to be
cached at 16x the amount of data ops. Changing the reserve size to match
this.

Test: th
Change-Id: I825ffef4e1a2ce4eb5c105d266bf95cb3d776ed9
2024-03-19 00:34:15 -07:00
Florian Mayer
e95d781041 Do not chmod ANRs
The code was only meant for native tombstones. It might be a good idea
to make ANRs also readable by shell / adb, but in that case we have to
do more changes to make sure all files in /data/anr are. We can revert
if we implement that

Test: m
Bug: 329827513
Change-Id: Ic98c452ca500fe766a70173bef4ac1ea57438989
2024-03-18 17:19:51 -07:00
Treehugger Robot
0b671f4432 Merge "dmctl: add report of IMA" into main 2024-03-18 16:59:31 +00:00
Junki Min
c8dc7ffd5e toolbox/libmodprobe: add toolbox to vendor_ramdisk
toolbox and libmodprobe are required for module loading before
first stage init begin.

BUG: 329807942
Signed-off-by: Junki Min <joonki.min@samsung.com>
Change-Id: Icf04888e602b012758ebf353ed8e4aff2585fd07
2024-03-18 17:35:26 +09:00
Jeongik Cha
4df565db4c Merge "Declare init.*.rc modules in Android.bp" into main 2024-03-18 01:25:16 +00:00
Treehugger Robot
a17fa25959 Merge "Remove bionic dependency from llndk-versioning.h" into main 2024-03-18 00:11:43 +00:00
Jaegeuk Kim
9459f7c09c dmctl: add report of IMA
This adds an option "ima" in dmctl.

$ dmctl ima product-verity
Targets in the device-mapper table for product-verity:
0-7463768: verity, target_name=verity,target_version=1.9.0,hash_failed=V,verity_version=1,data_device_name=254:4,hash_device_name=254:4,verity_algorithm=sha256,root_digest=d7af9fcb04d184219ba5477b97bb2bbc89fd23a46e03d1dea31d674cc4934769,salt=19d4f2345adfc8b7cc22a3c2f21dd413e5020fc7920a08a33f46f3c61492dfcc,ignore_zero_blocks=y,check_at_most_once=n,verity_mode=restart_on_corruption;

Change-Id: I057970b6c786b3f9a394b4919f5f5115b27cbc08
Signed-off-by: Jaegeuk Kim <jaegeuk@google.com>
2024-03-15 16:34:20 -07:00
Treehugger Robot
a09542807f Merge "toolbox/modprobe: Use libmodprobe to load modules from FILE" into main 2024-03-15 23:32:52 +00:00
Will McVicker
7d400f9d8c toolbox/modprobe: Use libmodprobe to load modules from FILE
When a file is provided (via --all=FILE), let's use libmodprobe to load
the modules. This let's us use the logic in libmodprobe to parse the
provided modules load file -- FILE. The functional differences include:

 - Removes the FILE parsing logic in modprobe.
 - Returns early if FILE doesn't exist.
 - Adds Dirname(FILE) to mod_dirs which means libmodprobe will parse the
   modules.* files inside Dirname(FILE). Previously, modprobe would only
   parse the modules.* files in the mod_dirs passed in by `-d DIR`. If
   no directories were provided, we would fallback to the default
   /lib/modules path. This patch removes the mod_dirs.empty() fallback
   path when --all=FILE is used. It's unlikely anyone uses `--all=FILE`
   without `-d DIR` unless FILE is inside the fallback path --
   /lib/modules.

Test: verified lsmod on pixel 6
Bug: 324018983
Change-Id: I8d241832f2a1f18d14207e3e3777e015c1ddb25f
2024-03-15 14:58:31 -07:00
Dennis Shen
a8a6d67f29 Merge "Revert "start aconfig storage daemon"" into main 2024-03-15 19:16:42 +00:00