Commit graph

86459 commits

Author SHA1 Message Date
Daniel Zheng
3376e2c24c Merge changes I19568d11,I08204e2d into main am: 9270152900
Original change: https://android-review.googlesource.com/c/platform/system/core/+/2828280

Change-Id: I9115b7de5e1fc255f91cdd1e6732910ec328ba34
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-11-14 20:42:53 +00:00
Akilesh Kailash
a9e02133dc Merge "libsnapshot: Check if OTA update in progress during reboot" into main am: 41305c3870
Original change: https://android-review.googlesource.com/c/platform/system/core/+/2829570

Change-Id: Ica2c1c8454a32700c05ecf742b8f02815a7ae1c8
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-11-14 20:42:40 +00:00
Treehugger Robot
d5462260cd Merge "Attempt process kill even if cgroup is already removed" into main am: b37d7cbef8
Original change: https://android-review.googlesource.com/c/platform/system/core/+/2828279

Change-Id: I8307139f5da756a2db54edd836021fac4803f9ed
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-11-14 20:42:10 +00:00
Daniel Zheng
59ce7a45d1 libsnapshot: update offset functions
Since these functions are used across both parser and writer, updating
it as inline functions in cow_format.

Test: cow_api_test
Change-Id: I9824684e3b9b48947accce935335d4019d745ae0
2023-11-14 12:40:12 -08:00
Daniel Zheng
3200697586 Merge "libsnapshot: resume_point_count" into main 2023-11-14 20:39:42 +00:00
Daniel Zheng
9270152900 Merge changes I19568d11,I08204e2d into main
* changes:
  libsnapshot: update FindResumeOp type
  libsnapshot: v3 writer GetCowSize
2023-11-14 20:30:19 +00:00
Akilesh Kailash
41305c3870 Merge "libsnapshot: Check if OTA update in progress during reboot" into main 2023-11-14 20:14:57 +00:00
Treehugger Robot
b37d7cbef8 Merge "Attempt process kill even if cgroup is already removed" into main 2023-11-14 20:10:34 +00:00
Kelvin Zhang
109932146d Attempt process kill even if cgroup is already removed
Test: th
Bug: 308900853
Change-Id: I21ae5bacf4a25cc06a1fd47e2aadbf5ae22661a7
2023-11-14 11:13:28 -08:00
Akilesh Kailash
f1f06f8678 libsnapshot: Check if OTA update in progress during reboot
If any of the read-only partitions are mounted off dm-user
then certainly update is in-progress.

Bug: 308900853
Test: OTA on Pixel, reboot during OTA.
Change-Id: I36121e1d99ec7c1f1110a65fc67996190875af18
Signed-off-by: Akilesh Kailash <akailash@google.com>
2023-11-14 16:04:17 +00:00
Daniel Zheng
f897650f6e libsnapshot: resume_point_count
We want to add a resume_point_count in the header to represent how many
resume points we've written. In the case that we've written less than
resume_buffer_size, we only want to read the valid resume points.

without these changes incremental OTA runs into segfault or have faulty
data when trying to FindResumeOp() as our resume points contain invalid
entries

Test: full ota followed by inc ota on cuttlefish
Change-Id: I0a8971955439639f2d0f39d9d518c1145ae15c3d
2023-11-13 15:57:25 -08:00
Daniel Zheng
a503453767 libsnapshot: update FindResumeOp type
Update FindResumeOp to take in a uint64_t to match the value of the
caller function

Test: ota with following CL
Change-Id: I19568d119b7ebd75ea9e98970b311ae7da92ff0e
2023-11-13 15:57:24 -08:00
Daniel Zheng
c1a18756dc libsnapshot: v3 writer GetCowSize
Cow size should just be wherever the last data position is written. In
v3 we no longer have a footer, so this calculation is simple. This
function is used by cow estimator

Test: cow_api_test
Change-Id: I08204e2d560b120450019a529baa41de9b8e66d5
2023-11-13 13:17:50 -08:00
Daniel Zheng
d37e54207e Merge "libsnapshot: update cow estimation" into main am: e343580f72
Original change: https://android-review.googlesource.com/c/platform/system/core/+/2825163

Change-Id: Ifb609f19c9c7108074f9187ecc96661874faf12c
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-11-13 19:06:49 +00:00
Daniel Zheng
7786db0ae7 Merge "libsnapshot: implement resume buffer" into main am: a4f80e5ca3
Original change: https://android-review.googlesource.com/c/platform/system/core/+/2816891

Change-Id: I4e089b84434a56a62c16e08b0a7050079be3d002
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-11-13 19:01:10 +00:00
Daniel Zheng
e343580f72 Merge "libsnapshot: update cow estimation" into main 2023-11-13 18:13:09 +00:00
Daniel Zheng
a4f80e5ca3 Merge "libsnapshot: implement resume buffer" into main 2023-11-13 18:13:01 +00:00
Elliott Hughes
4b149f35f0 Merge "run-as: remove a special case." into main am: dbb4a11156
Original change: https://android-review.googlesource.com/c/platform/system/core/+/2826237

Change-Id: Ie40491d7a1815f44c299293e6aa8cd5fb7a1ad2f
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-11-13 16:11:24 +00:00
Elliott Hughes
dbb4a11156 Merge "run-as: remove a special case." into main 2023-11-13 15:43:37 +00:00
David Anderson
a5c2601e5d Merge "libsnapshot: Add a test case for recent decompress regression." into main am: 06f29501c7
Original change: https://android-review.googlesource.com/c/platform/system/core/+/2826242

Change-Id: I0e575a9f91165c4a310e3bddc774c09f9ca80205
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-11-11 04:41:57 +00:00
David Anderson
06f29501c7 Merge "libsnapshot: Add a test case for recent decompress regression." into main 2023-11-11 04:03:18 +00:00
David Anderson
92b29e1925 libsnapshot: Add a test case for recent decompress regression.
The attached test data is a 4096 length byte run that gz compresses to
exactly 4096 bytes. This exposes an edge case in CowReader::ReadData
with v2 snapshot files.

Bug: 310191184
Test: cow_api_test
Change-Id: I35e8d7e939d607d1dc118285ebc2f636c2291a20
2023-11-11 00:29:41 +00:00
Elliott Hughes
84e41ca0e2 run-as: remove a special case.
This is a change for some system apps that have /data/user_de/0/ in the
package list, but it's easier to reason about and more consistent to
always go down the same path.

Bug: http://b/308990322
Test: treehugger
Change-Id: I479485655c61e8a31fb23f779c66d54b0bb476c0
2023-11-10 22:02:00 +00:00
Christopher Ferris
1503890fc6 Update to support new shared_ptr returns.
Bug: 309857311

Test: All unit tests pass.
Change-Id: Ia44ebeb558d3d1101ab63b064731656f0f89c487
2023-11-10 00:05:49 -08:00
Daniel Zheng
79a68a934b libsnapshot: update cow estimation
Cow estimator needs to update next_data_pos_ to be in the correct
position

Test: th
Change-Id: I1e3f2c9434573197e840be5637a90c679610ac4e
2023-11-09 15:49:15 -08:00
Daniel Zheng
c2ce084889 libsnapshot: implement resume buffer
Add resume space to cow v3. Resume buffer goes after header and scratch
space, and is currently set to contain 4 resume points. When AddLabel is
called, the oldest label is replaced with newest one.

Parser will parse up until the last resumable op from a given label.

Test: cow_api_test
Change-Id: Ie072f245721776887d59c96dad296965ad31a5cc
2023-11-09 15:48:42 -08:00
Daniel Zheng
f18e9ae66e Merge "libsnapshot: add compatibility check" into main am: 0ac91e1f02
Original change: https://android-review.googlesource.com/c/platform/system/core/+/2820944

Change-Id: I525d46ab5e20db8144c22782c7117e31387519b6
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-11-09 20:47:12 +00:00
Daniel Zheng
0ac91e1f02 Merge "libsnapshot: add compatibility check" into main 2023-11-09 19:38:18 +00:00
Daniel Zheng
04ca59d6ff libsnapshot: add compatibility check
Ensure that cow was written by v3 writer for the data_length check to
work. All ops written by v2 writer should go through the decompressor
path if a compressor was used.

Test: cow_api_test
Change-Id: I053d6fdaf29ef7001e68f43b45d5a3ff1a36b1c3
2023-11-09 11:32:02 -08:00
Elliott Hughes
b3a427ec71 Merge "run-as: remove unecessary code." into main am: ec63f6f10a
Original change: https://android-review.googlesource.com/c/platform/system/core/+/2822612

Change-Id: I4ce56a700073c4219274c5883f9c1d6d02449028
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-11-09 16:21:15 +00:00
Elliott Hughes
ec63f6f10a Merge "run-as: remove unecessary code." into main 2023-11-09 16:00:51 +00:00
Treehugger Robot
6566580573 Merge "Updated liblp fuzzers." into main am: c3ef20c326
Original change: https://android-review.googlesource.com/c/platform/system/core/+/2811834

Change-Id: I2b69c620d9c4d34930913d067b079f3d8433ac36
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-11-09 10:27:24 +00:00
Treehugger Robot
c3ef20c326 Merge "Updated liblp fuzzers." into main 2023-11-09 10:02:11 +00:00
Christopher Ferris
d30f47c452 Merge "debuggerd_test: Scale timeouts by HwTimeoutMultiplier" into main am: 580e728696
Original change: https://android-review.googlesource.com/c/platform/system/core/+/2821831

Change-Id: I82e0e713bac0242942039890cb09e8b7845e4054
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-11-09 01:57:41 +00:00
Christopher Ferris
580e728696 Merge "debuggerd_test: Scale timeouts by HwTimeoutMultiplier" into main 2023-11-09 01:41:35 +00:00
Mattias Simonsson
38ab045342 debuggerd_test: Scale timeouts by HwTimeoutMultiplier
Timeouts in tombstoned.cpp and intercept_manager.cpp are scaled
by HwTimeoutMultiplier, but the timeouts in debuggerd_test.cpp
are not, which means the CrasherTest#intercept_timeout test will
fail for any platform that has a high enough HwTimeoutMultiplier.

Bug: 309532789
Test: debuggerd_test.CrasherTest#intercept_timeout
Change-Id: I83cd01e87644c011efa155a32fd5d92cc8a43a95
2023-11-08 14:56:48 -08:00
Akilesh Kailash
37b50e3ff0 Merge "init: Start snapuserd_proxy after early-init" into main am: 14270410cf
Original change: https://android-review.googlesource.com/c/platform/system/core/+/2820943

Change-Id: I1e7a70f44ac76dabd528c9864ceaf5babae0e9fb
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-11-08 20:56:26 +00:00
Akilesh Kailash
14270410cf Merge "init: Start snapuserd_proxy after early-init" into main 2023-11-08 20:37:28 +00:00
Elliott Hughes
d291d68c4c run-as: remove unecessary code.
We haven't had a symlink here for many years, so there's no reason to
allow one any more.

Test: treehugger
Change-Id: Ic10d547a88fc6d9c442a5dfb228c5914ea48a32d
2023-11-08 10:46:51 -08:00
Elliott Hughes
3a3a7c4dc3 Merge "run-as: reduce the scope of changed egid." into main am: 1b86c0dd7d
Original change: https://android-review.googlesource.com/c/platform/system/core/+/2820457

Change-Id: Id17c41d7b22f6626cdde4d6a8bb9ef5beaa1aa60
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-11-08 16:24:09 +00:00
Elliott Hughes
1b86c0dd7d Merge "run-as: reduce the scope of changed egid." into main 2023-11-08 16:02:33 +00:00
Akilesh Kailash
76b553c93b init: Start snapuserd_proxy after early-init
When service is started prior to early init and if per-app memcg is enabled, service start will fail as the required directories for memcg isn't present viz /dev/memcg/apps.

Bug: 308818430
Test: th and CF OTA test with per-app memcg enabled
Change-Id: Ic65e8d179fbfb8e2135f2de5cc7c77d6c29ea7d2
Signed-off-by: Akilesh Kailash <akailash@google.com>
2023-11-08 15:07:57 +00:00
Daniel Zheng
c35222c502 Merge "libsnapshot: Add single threaded compression to v3 writer" into main am: 5e83e63bd7
Original change: https://android-review.googlesource.com/c/platform/system/core/+/2816298

Change-Id: Iad66f1f38f911f93cf361512b6f44b2a9e10f3cd
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-11-08 05:56:59 +00:00
Daniel Zheng
5e83e63bd7 Merge "libsnapshot: Add single threaded compression to v3 writer" into main 2023-11-08 05:41:09 +00:00
Treehugger Robot
a621f52726 Merge changes I5e259fdd,I5b9ab456 into main am: 7d1f582d36
Original change: https://android-review.googlesource.com/c/platform/system/core/+/2818001

Change-Id: I173207fb3382baf2436a420429034d281c84786d
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-11-08 02:20:27 +00:00
Treehugger Robot
7d1f582d36 Merge changes I5e259fdd,I5b9ab456 into main
* changes:
  init: Make WaitToBeReaped() wait less long
  init: Create different file descriptors for SIGCHLD and SIGTERM
2023-11-08 01:35:58 +00:00
Elliott Hughes
bfc115311e run-as: reduce the scope of changed egid.
There's no bug here that I can see, but having a larger than necessary
scope just seems like a bad idea in case anyone adds anything later.

Also switch to modern struct initialization syntax.

Bug: http://b/308990322
Test: treehugger
Change-Id: If2576f902de62e8c24d4a643c224df8ea6cff5d5
2023-11-07 14:46:25 -08:00
Daniel Zheng
e363841e75 libsnapshot: Add single threaded compression to v3 writer
Add compression path back into Cow operations. Main change is that the
compression algorithm is stored in the header instead of each individaul
op. Have the writer_v3 set this algorithm when parsing options.

There looks to be a lot of code we'll be able to factor out into the
base class, but we can leave that to a later CL.

Test: cow_api_test
Change-Id: Ie9a8eceb5fbdaecae50911119c75f2e51d776a28
2023-11-07 14:28:57 -08:00
Bart Van Assche
a75f210398 init: Make WaitToBeReaped() wait less long
Reduce the time spent in WaitToBeReaped() by waiting for SIGCHLD instead
of waiting for 50 ms.

Bug: 308687042
Change-Id: I5e259fdd22dec68e45d27205def2fc6463c06ca3
Signed-off-by: Bart Van Assche <bvanassche@google.com>
2023-11-07 10:52:26 -08:00
T.J. Mercier
2aa0085abd Merge "libprocessgroup: Internal linkage for removeAllProcessGroupsInternal" into main am: cf35a2ed4b
Original change: https://android-review.googlesource.com/c/platform/system/core/+/2817305

Change-Id: I5ccbd7b3b3248a4f04516b0a7af8e2c85fbc84b3
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-11-07 16:26:37 +00:00