Commit graph

86606 commits

Author SHA1 Message Date
Daniel Zheng
29be15feda Merge "libsnapshot: Implement CowWriterV3::EmitzeroBlocks." into main am: 9f53082e3b
Original change: https://android-review.googlesource.com/c/platform/system/core/+/2800836

Change-Id: I283bcab4786b09a37baf066e96183d49fbcfcdc1
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-11-02 22:15:34 +00:00
Daniel Zheng
fb2098be51 Merge "libsnapshot: Parser v3 implementation" into main am: cdb935e95f
Original change: https://android-review.googlesource.com/c/platform/system/core/+/2792195

Change-Id: Id88f9ef10bf543a8d37f6dc22ef24e3fa3c1611f
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-11-02 22:15:24 +00:00
Daniel Zheng
9f53082e3b Merge "libsnapshot: Implement CowWriterV3::EmitzeroBlocks." into main 2023-11-02 21:52:18 +00:00
Daniel Zheng
cdb935e95f Merge "libsnapshot: Parser v3 implementation" into main 2023-11-02 21:51:45 +00:00
Daniel Zheng
a1014852a1 libsnapshot: Implement CowWriterV3::EmitCopy
Add copy operation to v3 writer

Test: cow_api_test
Bug: 307452468
Change-Id: I5956084bfadff4536bad11f3683d639408a79892
2023-11-02 14:40:23 -07:00
Daniel Zheng
805d10fa16 libsnapshot: Implement CowWriterV3:EmitBlocks
Add in replace ops to WriterV3 without compression support (will be
added in later). CowReader also has to be changed since we no longer
have a CowFooter (our checks need to be updated correspondingly).
We need next_data_pos_ to be pointed to after the operation buffer. This
section is appended to incrementally as we write replace + xor
operations

Test: cow_api_test
Change-Id: Ie979c72f842edd04337d900fd43dac8031207517
2023-11-02 14:38:37 -07:00
David Anderson
53bd5585e9 libsnapshot: Implement CowWriterV3::EmitzeroBlocks.
Add zero block operation to writer v3. We currently write this operation
to after the scratch space. Once resume point support is added we may
need to change this to write after the resume point. This CL only
supports zero blocks, so writeoperation does not take in data yet.

Bug: 307452468
Test: cow_api_test
Change-Id: I659b2e2e4f6e0d96e374ed29012318cc34b4158d
2023-11-02 13:38:37 -07:00
Daniel Zheng
ee35a8184c libsnapshot: Parser v3 implementation
Also adds a test for CowWriterV3 + CowParserV3.

Bug: 307452468
Test: read a header written by v3 writer
Change-Id: I77cf048604c82a010cfdbfb38d0f8beef597d112
2023-11-02 13:38:37 -07:00
Daniel Zheng
a2f148ddb3 Merge "libsnapshot: Add Parser v3 + stub" into main am: c9c120e0b1
Original change: https://android-review.googlesource.com/c/platform/system/core/+/2815834

Change-Id: I74fe8f0af192a71b66c7f068653d17a78304cd0a
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-11-02 20:30:40 +00:00
Daniel Zheng
0ec664a592 Merge "libsnapshot: Add Parser base class" into main am: cb618c18c9
Original change: https://android-review.googlesource.com/c/platform/system/core/+/2815833

Change-Id: I14db9eddc90667e326ab9ba8660c67c1634f9b4e
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-11-02 20:30:09 +00:00
Daniel Zheng
c9c120e0b1 Merge "libsnapshot: Add Parser v3 + stub" into main 2023-11-02 20:07:54 +00:00
Daniel Zheng
cb618c18c9 Merge "libsnapshot: Add Parser base class" into main 2023-11-02 20:07:50 +00:00
Bart Van Assche
7ce6453aa8 init: Fix a bug in the WaitToBeReaped() logging code
Only report status information for the processes that are still running.
Additionally, make the logging output look better by starting the
process information from /proc start on a new line.

Fixes: ea595ba2a0 ("init: Log more information if stopping times out")
Change-Id: I3c882c364f11278087a78efb7a8e8fee8e582417
Signed-off-by: Bart Van Assche <bvanassche@google.com>
2023-11-02 13:06:23 -07:00
Bart Van Assche
4844092066 init/host_init_verifier: Fix a compiler warning
Fix the following compiler warning:

//system/core/init:host_init_verifier clang++ host_init_verifier.cp
system/core/init/host_init_verifier.cpp:112:9: warning: ISO C++ requires field designators to be specified in declaration order; field 'pw_shell' will be initialized after field 'pw_uid' [-Wreorder-init-list]
        .pw_uid = 0,
        ^~~~~~~~~~~
system/core/init/host_init_verifier.cpp:111:21: note: previous initialization for field 'pw_shell' is here
        .pw_shell = static_shell,
                    ^~~~~~~~~~~~

Change-Id: I930c668d7fb1d12ebe9307b1549776da71a9a95a
Signed-off-by: Bart Van Assche <bvanassche@google.com>
2023-11-02 13:06:23 -07:00
Bart Van Assche
ac8b5bd0bc init: Fix a compiler warning
Fix the following compiler warning:

system/core/init/init.cpp:754:57: warning: ISO C++ requires field designators to be specified in declaration order; field '' will be initialized after field 'sa_flags' [-Wreorder-init-list]
    const struct sigaction act { .sa_handler = SIG_DFL, .sa_flags = SA_NOCLDSTOP };
                                                        ^~~~~~~~~~~~~~~~~~~~~~~~
system/core/init/init.cpp:754:34: note: previous initialization for field '' is here
    const struct sigaction act { .sa_handler = SIG_DFL, .sa_flags = SA_NOCLDSTOP };
                                 ^~~~~~~~~~~~~~~~~~~~~

Change-Id: I29e2d51dfdff85212a33eebfd51b241268cdfe9a
Signed-off-by: Bart Van Assche <bvanassche@google.com>
2023-11-02 13:06:22 -07:00
Dennis Shen
2854ab55d0 Merge "Move staging value application logic to persistent_properties and add unit tests" into main am: fa21f12e3b
Original change: https://android-review.googlesource.com/c/platform/system/core/+/2801973

Change-Id: Iab84061afd32ac75b4251ee7d23252f8c584ea06
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-11-02 17:49:00 +00:00
Daniel Zheng
875df3436d libsnapshot: Add Parser v3 + stub
previously upload patch broke build -> bug id: 308868619

This patch updates the unimplemnted pure virtual method data_loc()
Adding in parser v3 plus stub implementation.

Bug: 307452468
Test: th
Change-Id: I815a741b01c46a11a2e60f59305843ce8329a065
2023-11-02 10:20:48 -07:00
David Anderson
e5a343b1af libsnapshot: Add Parser base class
Add in Parser base class and refactor code to work with it. Base class
will have ops() method which returns a vector of v3 operations.
v2_parser translates it's v2 operations to v3 operations with this
method.

Bug: 307452468
Test: Test with critical OTA paths?
Change-Id: I52d0d0554973714189a6e1013d026f96503238b6
2023-11-02 10:19:31 -07:00
Dennis Shen
fa21f12e3b Merge "Move staging value application logic to persistent_properties and add unit tests" into main 2023-11-02 17:00:44 +00:00
Dennis Shen
79283ef377 Move staging value application logic to persistent_properties and add
unit tests

1, Previous implementation has the staged prop application done in
property_service, which caused a number of unnecessary changes which
including exposing apis like AddPersistentProperty. In addition, it made
the property_service logic complicated. A better design is to have the
staged value application done while reading the persistent properties
from file. This way, no change to property service. In addition, unit
test is much cleaner and efficient.

2, add a unit test to lock down the behavior. Specifically, it locks down that when a prop is staged, it should be applied the next time when the persistent prop is loaded. In addition, it should lock down that other persistent props are not overwritten.

Bug: b/307752841, b/300111812, b/306062513

Change-Id: I43c603efbb803195065dda3f0bc2145716302bbc
2023-11-02 14:17:33 +00:00
Hsiu-Chang Chen
f51ad72a78 Merge changes from topic "revert-2781730-YHMBOJWFHT" into main am: 77aa824423
Original change: https://android-review.googlesource.com/c/platform/system/core/+/2813983

Change-Id: If7bad9bba06657cea3990885cdb891c37fafb891
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-11-02 04:45:20 +00:00
Hsiu-Chang Chen
77aa824423 Merge changes from topic "revert-2781730-YHMBOJWFHT" into main
* changes:
  Revert "libsnapshot: Add Parser base class"
  Revert "libsnapshot: Add Parser v3 + stub"
2023-11-02 04:24:16 +00:00
Hsiu-Chang Chen
e2ce495aa2 Revert "libsnapshot: Add Parser base class"
Revert submission 2781730

Reason for revert: It breaks build

Reverted changes: /q/submissionid:2781730

Bug: 308868619
Change-Id: I255263d14a1ced57b80efd373dd22eb22bb6efc1
2023-11-02 03:25:24 +00:00
Hsiu-Chang Chen
ad37351bd1 Revert "libsnapshot: Add Parser v3 + stub"
Revert submission 2781730

Reason for revert: It breaks build

Reverted changes: /q/submissionid:2781730

Bug: 308868619
Change-Id: I53b6b619635f150455cdba00237d130cae5df347
2023-11-02 03:25:24 +00:00
Daniel Zheng
d36d4fbce5 Merge changes Ie01f94d0,Iccc9755a into main am: a4c2d78763
Original change: https://android-review.googlesource.com/c/platform/system/core/+/2781730

Change-Id: I6e79298c4643293e46a7f7de20d7aaa93e8db973
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-11-02 01:22:15 +00:00
Daniel Zheng
a4c2d78763 Merge changes Ie01f94d0,Iccc9755a into main
* changes:
  libsnapshot: Add Parser v3 + stub
  libsnapshot: Add Parser base class
2023-11-02 01:05:42 +00:00
Daniel Zheng
4ca81f26d8 libsnapshot: Add Parser v3 + stub
Adding in parser v3 plus stub implementation.

Bug: 307452468
Test: th
Change-Id: Ie01f94d036c2062e34dbdf32456dc0a4612492d3
2023-11-01 13:06:55 -07:00
David Anderson
c165e84b15 libsnapshot: Add Parser base class
Add in Parser base class and refactor code to work with it. Base class
will have ops() method which returns a vector of v3 operations.
v2_parser translates it's v2 operations to v3 operations with this
method.

Bug: 307452468
Test: Test with critical OTA paths?
Change-Id: Iccc9755a892911a1638f5b62d7d6a2402c68ab20
2023-11-01 13:06:54 -07:00
Henri Chataing
6bdb5f86cd Update fmtlib to 10.1.1
Test: m
Change-Id: I1f23ea1a07c792c3b4974414aef9aeb9ae8f11d7
2023-11-01 17:25:37 +00:00
Shin-Yu Wang
0e40a61f58 Merge "Revert "Reapply "Migrate the blkio controller to the v2 cgroup hierarchy""" into main am: 8ebc82576e
Original change: https://android-review.googlesource.com/c/platform/system/core/+/2814153

Change-Id: Ic85dd5e7e655c4724d73a2b6d8908f37972cbb54
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-11-01 07:45:24 +00:00
Shin-Yu Wang
8ebc82576e Merge "Revert "Reapply "Migrate the blkio controller to the v2 cgroup hierarchy""" into main 2023-11-01 07:28:26 +00:00
Shin-Yu Wang
3b16967f0f Revert "Reapply "Migrate the blkio controller to the v2 cgroup hierarchy""
This reverts commit d71f9e5fbb.

Reason for revert: p0 failed test (b/308687042)

Change-Id: I3d8cb899d79634bb1c80f7d05af5c1311358c25c
2023-11-01 06:26:31 +00:00
Christopher Ferris
60feabcabe Merge "Add new segv type SEGV_CPERR." into main am: cb8ee7580d
Original change: https://android-review.googlesource.com/c/platform/system/core/+/2813255

Change-Id: Id4aa6c6640523dfb42bca7285153937a8978155f
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-11-01 02:45:15 +00:00
Christopher Ferris
cb8ee7580d Merge "Add new segv type SEGV_CPERR." into main 2023-11-01 02:14:31 +00:00
Christopher Ferris
6aa72490dc Add new segv type SEGV_CPERR.
The new 6.6 kernel headers added a new segv type, SEGV_CPERR. Add this
to the switch statement.

Test: Unit tests pass.
Change-Id: I77eb4748e51c7e7d7291bfd2180b0ccb3b5a6ded
2023-10-31 14:01:09 -07:00
Treehugger Robot
ba70760164 Merge "Reapply "Migrate the blkio controller to the v2 cgroup hierarchy"" into main am: 848b36c254
Original change: https://android-review.googlesource.com/c/platform/system/core/+/2794128

Change-Id: Iea107d8fad14ea228a716244b6bee47e72df2ac7
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-10-31 20:40:50 +00:00
Treehugger Robot
848b36c254 Merge "Reapply "Migrate the blkio controller to the v2 cgroup hierarchy"" into main 2023-10-31 20:00:51 +00:00
Akilesh Kailash
12449ed672 Merge "libsnapshot: Wait for COW path" into main am: 9eeebf7043
Original change: https://android-review.googlesource.com/c/platform/system/core/+/2810376

Change-Id: Id87d7ff48f35ff1ea83f227a56a216db2bf221ff
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-10-31 17:57:05 +00:00
Akilesh Kailash
9eeebf7043 Merge "libsnapshot: Wait for COW path" into main 2023-10-31 17:44:36 +00:00
T.J. Mercier
599d979126 libprocessgroup: Remove max_processes from KillProcessGroup API
The max_processes calculation is incorrect for KillProcessGroup because
the set of processes in cgroup.procs can differ between the multiple
reads in the implementation. Luckily the exact value isn't very
important because it's just logged. Remove max_processes from the API
and remove the warning about the new behavior in Android 11.

Note that we still always LOG(INFO) that any cgroup is being killed.

Bug: 301871933
Change-Id: I8e449f5089d4a48dbc1797b6d979539e87026f43
2023-10-31 16:31:44 +00:00
Harsh Abichandani
5249953d0b Updated liblp fuzzers.
Added a check to avoid possible NPD when duplicate partitions are created and changed slot value range which is being fetched using FuzzedDataProvider.

exec/s: 16440
Test: ./liblp_builder_fuzzer
exec/s: 26412
Test: ./liblp_super_layout_builder_fuzzer
exec/s: 9178
Test: ./liblp_apis_fuzzer
Bug: 307978015

Change-Id: I63abc828cc3f4c44c1dd89a01acfb33dc08813b8
2023-10-31 12:01:53 +05:30
Treehugger Robot
d7095f37f9 Merge "Initialize the appcompat system property folder" into main am: 1f5e877185
Original change: https://android-review.googlesource.com/c/platform/system/core/+/2786943

Change-Id: Id48871f6813e0501e9ff112d841c8a27ca7a304f
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-10-31 02:54:00 +00:00
Treehugger Robot
1f5e877185 Merge "Initialize the appcompat system property folder" into main 2023-10-31 02:29:56 +00:00
Bart Van Assche
d71f9e5fbb Reapply "Migrate the blkio controller to the v2 cgroup hierarchy"
This reverts commit c7a6fe684c.
Repply the blkio controller migration because it was not responsible
for the test failures that led to the revert. See also the following bugs:
* https://b.corp.google.com/issues/260143932
  (v2/android-virtual-infra/test_mapping/presubmit-avd test failure)
* https://b.corp.google.com/issues/264620181
  (CtsInitTestCases.RebootTest#StopServicesSIGKILL failure)

The only change compared with the previous version is that the io
controller has been declared optional. This is necessary because some
devices have a kernel that does not support the io controller.

Bug: 213617178
Test: Cuttlefish and various phones
Change-Id: I490740e1c9ee4f7bb5bb7afba721a083f952c8f2
Signed-off-by: Bart Van Assche <bvanassche@google.com>
2023-10-30 16:55:14 -07:00
Akilesh Kailash
8fb49bc0a2 libsnapshot: Wait for COW path
After mapping COW device, wait for the device to appear
before initializing it.

Bug: 305829996
Test: OTA on Pixel
Change-Id: If9e0e1ce684aa15bc9f3fd5a01e4f0421de87e81
Signed-off-by: Akilesh Kailash <akailash@google.com>
2023-10-30 12:14:15 -07:00
Yi-Yo Chiang
db620ef531 fs_mgr_overlayfs: Fix "/" mount propagation type after remount
If remounting "/system" caused "/" to be set to MS_PRIVATE, restore it
to MS_SHARED after remount.

Bug: 306124139
Test: adb-remount-test
Test: remount /system and verify /proc/self/mountinfo
Change-Id: I12bc2ccdaf7d2b2de330064b61a8533b96defe00
2023-10-30 16:24:55 +00:00
Yi-Yo Chiang
686bff6e5c fs_mgr_overlayfs: Fix submount propagation type after remount
When juggling submounts, the temp dir holding the references to
submounts should be MS_PRIVATE. Otherwise the submount propagation type
would be changed according to section 5d,
https://www.kernel.org/doc/Documentation/filesystems/sharedsubtree.txt

For example, a root mount tree of
  <mountpoint> <shared/private>
  /dev         shared
  /product     shared
  /product/app private

When executing "remount /product", "/product/app" would be moved to a
temp dir under "/dev", which is MS_SHARED. This would also change the
state of the mount to MS_SHARED.
  /dev         shared
  /product     shared
  /dev/temp    shared  (moved from /product/app)

Thus after "/product" overlay is mounted, and "/dev/temp" is moved back,
"/product/app" would be unintentionally changed to MS_SHARED.
  /dev         shared
  /product     private
  /product     shared  (overlayfs override)
  /product/app shared  (moved from /dev/temp)


This change fixes this issue by setting up a standalone mount tree under
/dev to hold the temporary moved submounts.
This way we don't need to modify the state of "/dev" whatsoever, and can
guarantee the propagation type of mounts moved in and out of the temp
dir are not changed.

Bug: 306124139
Test: adb-remount-test
Test: remount a parent mount and then verify the mount flag of submount
Change-Id: I8174257cff6b93dd95303c6ab49b42f90b02df0c
2023-10-30 16:24:55 +00:00
Kiyoung Kim
05c59f1233 Merge "Deprecate Vendor Overlay when VNDK is deprecated" into main am: dfe80e48f9
Original change: https://android-review.googlesource.com/c/platform/system/core/+/2806073

Change-Id: Ib45734e98b4ef8deea7cb093691eaaef34d3b6cd
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-10-30 05:45:26 +00:00
Kiyoung Kim
dfe80e48f9 Merge "Deprecate Vendor Overlay when VNDK is deprecated" into main 2023-10-30 05:12:37 +00:00
Kiyoung Kim
260e48f07e Deprecate Vendor Overlay when VNDK is deprecated
Vendor overlay was introduced to enable system-only update with small
changes on the vendor, but this is no longer required with same reason
of VNDK deprecation - more frequent Vendor update than expected, and
makes system-vendor interface unstable. This change adds more comments
to explain that Vendor overlay will be deprecated along with VNDK, and
skip test if VNDK is deprecated.

Bug: 307925435
Bug: 307902290
Test: fs_mgr_vendor_overlay_test passed with CF trunk-staging device
Change-Id: I7b9359a5754e8740e749c48f6265a1b0f92f13af
2023-10-30 13:19:12 +09:00