Commit graph

2601 commits

Author SHA1 Message Date
Rubin Xu
f2e846f153 Remove excess logging in secdiscard
Remove all debug logs to reduce logspam a bit.

Bug: 64349233
Test: manual
Change-Id: I234fae7b9fb719b09af27985736f43f085dad301
2019-03-21 19:13:51 +00:00
Paul Crowley
04017039b7 Merge "Shell no longer globs, so glob in pushBackContents"
am: a41b7849d0

Change-Id: Iedd9a6d6834adc844e13e9ec596062032588fd53
2019-03-19 12:31:37 -07:00
Paul Crowley
a41b7849d0 Merge "Shell no longer globs, so glob in pushBackContents" 2019-03-19 19:13:56 +00:00
Paul Lawrence
4c5ce24e80 Merge "Add vdc checkpoint supportsBlockCheckpoint"
am: 860c731158

Change-Id: I61a7059649e8dc0ff5096f3494d5e4b0f8f3b787
2019-03-18 16:08:51 -07:00
Treehugger Robot
860c731158 Merge "Add vdc checkpoint supportsBlockCheckpoint" 2019-03-18 22:56:47 +00:00
Paul Lawrence
c5c79c5679 Add vdc checkpoint supportsBlockCheckpoint
Also add vdc checkpoint supportsFileCheckpoint
This is to allow tests to be specific to supported checkpoint mode.

Test: Built on Taimen and Crosshatch, made sure both new functions work
as expected

Change-Id: I0eab7453b13c0a2e31840ef9ad24a692cec55b00
2019-03-18 13:40:00 -07:00
Paul Crowley
51209e9e40 Shell no longer globs, so glob in pushBackContents
Bug: 113246065
Bug: 123057215

Test: As described in b/113246065 comment 1
Change-Id: Id766773ed4abe80a9fc1d5305f099aedfe8eed90
2019-03-18 10:26:47 -07:00
Chris Fries
3a38070bbf Merge "Fsync directories before delete key"
am: 7573874d3f

Change-Id: I568638b5de3c58d868024f959f890094eb1bd501
2019-03-14 08:34:06 -07:00
Chris Fries
7573874d3f Merge "Fsync directories before delete key" 2019-03-14 15:19:20 +00:00
Woody Lin
37c82f5c0f Fsync directories before delete key
The boot failure symptom is reproduced on Walleye devices. System boots
up after taking OTA and try to upgrade key, but keymaster returns "failed
to ugprade key". Device reboots to recovery mode because of the failure,
and finally trapped in bootloader screen. Possible scenario is:

(After taking OTA)
vold sends old key and op=UPGRADE to keymaster
keymaster creates and saves new key to RPMB, responses new key to vold
vold saves new key as temp key
vold renames temp key to main key -------------- (1) -- still in cache
vold sends old key and op=DELETE_KEY to keymaster
keymaster removes old key from RPMB ------------ (2) -- write directly to RPMB
==> SYSTEM INTERRUPTED BY CRASH OR SOMETHING; ALL CACHE LOST.
==> System boots up, key in RPMB is deleted but key in storage is old key.

Solution: A Fsync is required between (1) and (2) to cover this case.

Detail analysis: b/124279741#comment21

Bug: 112145641
Bug: 124279741
Test: Insert fault right after deleteKey in vold::begin (KeyStorage.cpp),
      original boot failure symptom is NOT reproducible.
Change-Id: Ib8c349d6d033f86b247f4b35b8354d97cf249d26
2019-03-14 16:48:32 +08:00
The Android Open Source Project
e1d82ea744 [automerger skipped] Merge "DO NOT MERGE - Skip PPRL.190305.001 into master"
am: 027fe9217c -s ours
am skip reason: subject contains skip directive

Change-Id: I2dc06015f2c873a8d9a62d743d97fc489937b644
2019-03-11 16:55:26 -07:00
The Android Open Source Project
1a158c67a0 [automerger skipped] DO NOT MERGE - Skip PPRL.190305.001 into master
am: 37c6ce4fb0 -s ours
am skip reason: subject contains skip directive

Change-Id: I6fa5c1108107e07e1d6c77592eaa6269672fdd2b
2019-03-11 16:54:31 -07:00
Treehugger Robot
027fe9217c Merge "DO NOT MERGE - Skip PPRL.190305.001 into master" 2019-03-11 23:16:31 +00:00
The Android Open Source Project
37c6ce4fb0 DO NOT MERGE - Skip PPRL.190305.001 into master
Bug: 127812889
Change-Id: I5bff7948e2fc254d0595329bd7a7262586de0c32
2019-03-11 14:57:55 -07:00
Jiyong Park
b5acb5bfba Merge "Don't unmount /storage for early native processes"
am: ee9554b2d9

Change-Id: I985413323a86816b392bd00211c550aef93328ae
2019-03-08 17:55:15 -08:00
Treehugger Robot
ee9554b2d9 Merge "Don't unmount /storage for early native processes" 2019-03-09 01:33:40 +00:00
Daniel Rosenberg
84ceaedb59 Merge changes I91cf0def,I47570e8e
am: 5f01cf3cac

Change-Id: If269c0d3134dc98683982a96224885503b2f8434
2019-03-07 18:43:46 -08:00
Treehugger Robot
5f01cf3cac Merge changes I91cf0def,I47570e8e
* changes:
  Make Checkpoint restore resume safe
  Add vdc checkpoint restoreCheckpointPart
2019-03-07 23:56:21 +00:00
Daniel Rosenberg
5298593b1b Make Checkpoint restore resume safe
This allows us to resume rolling back in the event of an unexpected
shutdown during the restore process. We save  progress after we process
each log sector, and whenever restarting the current log sector would
result in invalid data.

Test: Run restore, interrupt it, and attempt to resume
Change-Id: I91cf0defb0d22fc5afdb9debc2963c956e9e171c
2019-03-07 13:58:49 -08:00
Daniel Rosenberg
dda598103d Add vdc checkpoint restoreCheckpointPart
Restores the first n entries of a checkpoint. Allows automated testing
of interrupted restores.

Test: vdc checkpoint restoreCheckpoint [device] [n]
Change-Id: I47570e8eba0bc3c6549a04a33600df05d393990b
2019-03-07 13:58:49 -08:00
Daniel Rosenberg
73cfd4918b Merge "Switch Checkpoint Restore code to c style File ops"
am: bc1901f8af

Change-Id: I52f3551d5a86d7e2edbb116bec98e8d2a11535df
2019-03-06 22:16:41 -08:00
Daniel Rosenberg
bc1901f8af Merge "Switch Checkpoint Restore code to c style File ops" 2019-03-07 06:10:58 +00:00
Daniel Rosenberg
8271ae986e Switch Checkpoint Restore code to c style File ops
In preparation for restore code, we need to guarantee fsync happens.
Switch over to fd based operations to prepare for that.

Test: Successfully restores device over reboots
Change-Id: Ic9901779e8a4258bf8090d6a62fa9829e343fd39
2019-03-06 22:05:09 -08:00
Jiyong Park
8d21c924d7 Don't unmount /storage for early native processes
Motivation:

Early processes launched before the runtime APEX - that hosts the bionic
libs - is activated can't use the bionic libs from the APEX, but from the
system partition (which we call the bootstrap bionic). Other processes
after the APEX activation should use the bionic libs from the APEX.
In order to let both types of processes to access the bionic libs via
the same standard paths /system/lib/{libc|libdl|libm}.so, some mount
namespace magic is used.

To be specific, when the device boots, the init initially bind-mounts
the bootstrap bionic libs to the standard paths with MS_PRIVATE. Early
processes are then executed with their own mount namespaces (via
unshare(CLONE_NEWNS)). After the runtime APEX is activated, init
bind-mounts the bionic libs in the APEX to the same standard paths.
Processes launched thereafter use the bionic libs from the APEX (which
can be updated.)

Important thing is that, since the propagation type of the mount points
(the standard paths) is 'private', the new bind-mount events for the
updated bionic libs should not affect the early processes. Otherwise,
they would experience sudden change of bionic libs at runtime. However,
other mount/unmounts events outside of the private mount points are
still shared across early/late processes as before. This is made possible
because the propagation type of / is 'shared' .

Problem:

vold uses the equality of the mount namespace to filter-out processes
that share the global mount namespace (the namespace of the init). However,
due to the aforementioned change, the early processes are not filtered
out because they have different mount namespaces. As a result,
umount2("/storage/") is executed on them and this unmount event
becomes visible to the global mount namespace (because as mentioned before /
is 'shared').

Solution:

Fiter-out the early processes by skipping a native (non-Java) process
whose UID is < AID_APP. The former condition is because all early
processes are native ones; i.e., zygote is started after the runtime
APEX is activated. The latter condition is to not filter-out native
processes created locally by apps.

Bug: 120266448
Test: m; device boots

Change-Id: I054deedc4af8421854cf35be84e14995523a259a
2019-03-04 16:22:41 +09:00
Paul Lawrence
2962054d72 Merge "Make restore validation fast by using a map"
am: decda14f02

Change-Id: I92c5bdf046ac7e6b2211021698990592fe5f3895
2019-03-01 13:35:24 -08:00
Paul Lawrence
decda14f02 Merge "Make restore validation fast by using a map" 2019-03-01 21:19:27 +00:00
Paul Lawrence
d41a939d51 Make restore validation fast by using a map
Test: Successfully restores device over reboots
Change-Id: I4f1c5bbe6c07697a925a1a4efb92aefd15b61332
2019-02-28 09:49:54 -08:00
Xin Li
464294d159 DO NOT MERGE - Merge pi-dev@5234907 into stage-aosp-master
Bug: 120848293
Change-Id: Ia3e46d3c5ca83da01e78e076d2810620812f5115
2019-02-20 16:20:13 -08:00
Paul Lawrence
9de5e3c028 Merge "Do not trim unless we are actually checkpointing"
am: 2268c285a5

Change-Id: I031a25204269ea7d3d65349a3f281a3f1e07eadd
2019-02-20 04:22:43 -08:00
Treehugger Robot
2268c285a5 Merge "Do not trim unless we are actually checkpointing" 2019-02-20 12:09:31 +00:00
Paul Lawrence
db08694bb1 Do not trim unless we are actually checkpointing
I'm not convinced this explains the full regression, but it's a
worthwhile fix anyway.

Bug: 124774357
Test: Booted in checkpoint mode and non checkpoint mode

Change-Id: I6e0e1e59e27bd127feac218fff7d88bb3570b530
2019-02-19 14:41:53 -08:00
Xin Li
c3df248685 Merge "DO NOT MERGE - Skip pi-platform-release (PPRL.190205.001) into stage-aosp-master" into stage-aosp-master 2019-02-14 22:11:30 +00:00
David Anderson
8b90acafcd Merge "Enable metadata encryption for userdata_gsi."
am: 99046b75c4

Change-Id: I90d530403f635427c7695e6a106526b51a7fc146
2019-02-14 12:41:46 -08:00
David Anderson
99046b75c4 Merge "Enable metadata encryption for userdata_gsi." 2019-02-14 20:27:05 +00:00
David Anderson
0d71c4b5f7 Enable metadata encryption for userdata_gsi.
When running a live GSI, userdata is a logical partition. If we don't
fix up the fstab we'll derive the underlying block device instead of
the device-mapper node for userdat_gsi, resulting in a corrupt data
partition for both images.

Bug: 123906417
Test: manual test
Change-Id: Ic0101f30504de26e725442da2da3888008c31b63
2019-02-14 08:29:26 -08:00
Xin Li
29633ddd06 DO NOT MERGE - Skip pi-platform-release (PPRL.190205.001) into stage-aosp-master
Bug: 124234733
Change-Id: I5f6bd6a42230b0c9e54dc6221cfa12f366585e40
2019-02-12 16:41:37 -08:00
android-build-team Robot
c03435f532 Snap for 5180536 from 2ab3b948d7 to pi-platform-release
Change-Id: Idc5557adef8d2cbc60a594ab3ea1aa3669140926
2019-02-09 02:36:27 +00:00
Paul Lawrence
06181f3605 Merge "Support header versioning in dm-bow"
am: 96336c716b

Change-Id: I8d71b57c51e2290c2633b286ea91a54a3ea0d582
2019-02-08 14:00:32 -08:00
Treehugger Robot
96336c716b Merge "Support header versioning in dm-bow" 2019-02-08 21:55:29 +00:00
Paul Lawrence
fdac3684c4 Merge "Suport variable blocksizes in dm-bow restore"
am: 73c0028901

Change-Id: I42cf7db1bca5905e93546b1df78b8439c22ef198
2019-02-08 13:27:49 -08:00
Treehugger Robot
73c0028901 Merge "Suport variable blocksizes in dm-bow restore" 2019-02-08 21:16:58 +00:00
Paul Lawrence
f507768981 Support header versioning in dm-bow
Test: Make sure still boots, restores
Change-Id: I903f58cb22472dbbbbb4c27ed1d88ed1f7c7dc5d
2019-02-08 08:43:40 -08:00
Paul Lawrence
4f13a90a58 Suport variable blocksizes in dm-bow restore
Test: Test that restore still works
Change-Id: I7259e3efd1cd0ee13c74336a7e53158b6bceed57
2019-02-08 08:43:40 -08:00
Daniel Rosenberg
294a252092 Merge "Mark A/B Boot success before committing checkpoint"
am: d6bbe746d7

Change-Id: I2876835681d42bade620081d508a7490d664c8aa
2019-02-07 17:49:55 -08:00
Daniel Rosenberg
d6bbe746d7 Merge "Mark A/B Boot success before committing checkpoint" 2019-02-08 01:40:54 +00:00
Paul Crowley
56715503b5 Merge "Fix search for values in blkId output"
am: 0fbc5af676

Change-Id: Ica4be0ea315c0aa6a2d6289139a88a8fa944deac
2019-02-05 19:33:46 -08:00
Treehugger Robot
0fbc5af676 Merge "Fix search for values in blkId output" 2019-02-06 03:19:32 +00:00
Paul Crowley
95abfa0cfd Fix search for values in blkId output
Bug: 122497152
Test: atest tests/Utils_test.cpp
Test: adb shell sm partition disk:7,32 private ; adb logcat -d
Change-Id: Ic7d32bdbc0c55ce1d21f7f9e74c6a6fb3dcf332a
2019-02-05 16:57:40 -08:00
Daniel Rosenberg
886915bb6f Mark A/B Boot success before committing checkpoint
This marks the slot as successful within commitChanges, increasing the
available roll back window significantly.

Test: When taking an update on a checkpoint enabled device, it
      marks the slot as successful just before committing the
      checkpoint. Visible in logs as call to vdc commitChanges,
      followed by "Marked slot as booted succesfully."
Bug: 123260515
Change-Id: If71fcde57b3bdee2cfaabb590f123a2d00da3228
2019-02-05 16:56:55 -08:00
Daniel Rosenberg
fd5d1b173c Merge "Use global default_fstab instead of re-reading"
am: 64f5e5bb38

Change-Id: Ief94647963db3c48f1aeb89e7d8ccd5f7cb63da7
2019-02-04 15:25:00 -08:00