Commit graph

88927 commits

Author SHA1 Message Date
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
Android Culprit Assistant
71179955f7 Revert "start aconfig storage daemon"
This revert was created by Android Culprit Assistant. The culprit was identified in the following culprit search session (http://go/aca-get/2def2bc9-4177-4451-930d-96612adf7d95).

Change-Id: I232a36309883bff892fff5a5d43fd1432d7f1c6e
2024-03-15 19:06:14 +00:00
Treehugger Robot
090f45f3c8 Merge "Add missing header." into main 2024-03-15 18:21:11 +00:00
Justin Yun
47f9182e49 Remove bionic dependency from llndk-versioning.h
llndk-versioning.h only defines macros for LLNDK versioning.
Remove unused bionic header.

Bug: 302113279
Test: lunch cf_x86_64-trunk_staging-userdebug && m && m cts
Change-Id: I8d3ebbd765a223a2241e1a0bc95c84d726bacb9d
2024-03-15 23:05:09 +09:00
Krzysztof Kosiński
eaf7d77e7e Add missing header.
Protobuf 22.x no longer includes <unordered_map>, so it has to
be included explicitly.

Bug: 329747255
Test: presubmit
Change-Id: Icd5055e242e4f58029caf80cbb321222c612a9d0
2024-03-15 06:44:39 +00:00
Jeongik Cha
3652004432 Declare init.*.rc modules in Android.bp
Bug: 322088967
Test: build
Change-Id: Idd8cc0a9fdbcda1d8129056efc0afadc663b955b
2024-03-15 13:49:39 +09:00
Dennis Shen
e7abebc01d Merge "start aconfig storage daemon" into main 2024-03-14 12:17:53 +00:00
Nikita Ioffe
13db31040f Merge changes from topic "derive-microdroid-vendor-dice-node" into main
* changes:
  Add a step to derive microdroid vendor dice node
  Move ForkExecveAndWaitForCompletion to util.h
  Mount /microdroid_resources as tmpfs
2024-03-14 11:20:06 +00:00
Treehugger Robot
9bceea5a7f Merge "Define macros for LLNDK versioning" into main 2024-03-14 05:58:32 +00:00
Daniel Zheng
9ce8219f52 libsnapshot: fix warnings
Fix unused header warning

Test: th
Change-Id: I5c9f22f3f74d6ca44e738e1dc8e9fe146749857f
2024-03-13 22:31:58 -07:00
Daniel Zheng
da960a1341 libsnapshot: remove temporary solution
Remove temporary estimation solution (using 4k to overestimate the cow).
With the updated estimation logic, we should be able to accurately
estimate the cow size with variable block sized compression

Bug: 322279333
Test: th
Change-Id: I199970048605a8d21d3791614ad88ca61662e1a3
2024-03-13 22:28:43 -07:00
Dennis Shen
07afcabf67 start aconfig storage daemon
Bug: b/312444587
Test: m and launch AVD
Change-Id: I92946fc4ec2100d995300c58ef6045ae5b40f13a
2024-03-13 19:16:29 +00:00
Bart Van Assche
f21e60282e Merge "Make foreground and background I/O priority different" into main 2024-03-13 16:15:20 +00:00
Nikita Ioffe
1e114e677b Add a step to derive microdroid vendor dice node
The derivation happens in the derive_microdroid_vendor_dice_node binary
which first_stage_init forks and execvs.

Since the derivation requires talking to the dice driver, its
initialisation is also moved to the first stage init.

The derivation happens before the microdroid vendor partition is
verified & mounted. This should be safe because the first_stage_init
will fail the boot if the verification of the microdroid vendor
partition fails.

Bug: 287593065
Test: run microdroid with and without vendor partition
Test: atest MicrodroidTests
Change-Id: I0d83772eb98a56c315617e66ec64bd03639cfde6
2024-03-13 15:24:44 +00:00
Nikita Ioffe
fe7b83faea Move ForkExecveAndWaitForCompletion to util.h
In the follow up patch this function will also be used in
first_stage_init.

Bug: 287593065
Test: m
Change-Id: Id805f8523596c26ed262d89aa652b27184b612c1
2024-03-13 14:44:46 +00:00
Nikita Ioffe
2384e8abfe Mount /microdroid_resources as tmpfs
This will be used to store the new dice chain generated during
first_stage_init phase in case Microdroid VM is launched with
microdroid vendor partition.

Bug: 287593065
Test: atest MicrodroidTests
Test: start Microdroid VM & check microdroid_resources exists
Change-Id: I40677376bfed14d813ad51c78db6109b2d76d1d1
2024-03-13 14:39:08 +00:00
Treehugger Robot
0c2301240a Merge changes I68f7d46b,I5d5278ab into main
* changes:
  toolbox/modprobe: Fix failure due to blocklist
  libmodprobe: Make IsBlocklisted() public
2024-03-13 05:27:59 +00:00