OSDN Git Service
The Android Open Source Project [Mon, 10 Jun 2019 20:17:51 +0000 (13:17 -0700)]
[automerger skipped] DO NOT MERGE - Merge pie-platform-release (PPRL.190605.003) into master am:
1aebde23aa -s ours
am:
d81505cac0 -s ours
am skip reason: subject contains skip directive
Change-Id: I5487c6e6a413585c86d346f0c8bf434bd29b4ecd
The Android Open Source Project [Mon, 10 Jun 2019 20:06:15 +0000 (13:06 -0700)]
[automerger skipped] DO NOT MERGE - Merge pie-platform-release (PPRL.190605.003) into master
am:
1aebde23aa -s ours
am skip reason: subject contains skip directive
Change-Id: Ib9778c146fb82c715408db89cdaf45339f23ef05
The Android Open Source Project [Mon, 10 Jun 2019 16:32:29 +0000 (09:32 -0700)]
DO NOT MERGE - Merge pie-platform-release (PPRL.190605.003) into master
Bug:
134605042
Change-Id: Ie32488cf0d10e1a5622d24f604a7a5e84c56e79c
Daniel Rosenberg [Sat, 8 Jun 2019 01:55:10 +0000 (18:55 -0700)]
Merge "Fix include order" am:
0a0b5b5f02
am:
44c18e1723
Change-Id: I80ae48916a7cb5182bb802c6919387204b860b09
Daniel Rosenberg [Sat, 8 Jun 2019 01:49:05 +0000 (18:49 -0700)]
Merge "Fix include order"
am:
0a0b5b5f02
Change-Id: I002b546d733dd55ced79aeb118c6394ce973d609
Treehugger Robot [Sat, 8 Jun 2019 01:30:38 +0000 (01:30 +0000)]
Merge "Fix include order"
Daniel Rosenberg [Fri, 7 Jun 2019 23:06:51 +0000 (16:06 -0700)]
[automerger skipped] Merge "Defer deleteKey in KeyStorage in Checkpointing mode" am:
fc4ad04ffe
am:
288fca9266 -s ours
am skip reason: change_id Ie5fc2d098355e2d095c53e9a95a6a8c7ab7ed051 with SHA1
8cc5716ef1 is in history
Change-Id: I7d9f111a30c196b86f84cdaa3fd1081733be789f
Daniel Rosenberg [Fri, 7 Jun 2019 23:00:50 +0000 (16:00 -0700)]
Merge "Defer deleteKey in KeyStorage in Checkpointing mode"
am:
fc4ad04ffe
Change-Id: Ib4f127130bdf05fe092fec15d999e5d645441303
Treehugger Robot [Fri, 7 Jun 2019 22:48:00 +0000 (22:48 +0000)]
Merge "Defer deleteKey in KeyStorage in Checkpointing mode"
Xin Li [Fri, 7 Jun 2019 22:23:25 +0000 (15:23 -0700)]
Merge "Restore historical behavior with fsck_msdos (always accept fixes)." am:
a2518c7fe7
am:
8941a145a0
Change-Id: I3ccf537b4802baf6ff43b1ff3b24f44c59e9fa08
Xin Li [Fri, 7 Jun 2019 22:17:24 +0000 (15:17 -0700)]
Merge "Restore historical behavior with fsck_msdos (always accept fixes)."
am:
a2518c7fe7
Change-Id: I91202edd2dbca6e8eb4c58fa25453da22045a062
Treehugger Robot [Fri, 7 Jun 2019 22:05:20 +0000 (22:05 +0000)]
Merge "Restore historical behavior with fsck_msdos (always accept fixes)."
Daniel Rosenberg [Fri, 7 Jun 2019 21:18:14 +0000 (14:18 -0700)]
Fix include order
Change-Id: Id839cc52801f3d0fce2d46faecf813812613e431
Test: None
Daniel Rosenberg [Fri, 7 Jun 2019 03:38:38 +0000 (20:38 -0700)]
Defer deleteKey in KeyStorage in Checkpointing mode
Don't delete keys in checkpointing mode. Instead wait until the
checkpoint has been committed.
Bug:
134631661
Test: Flash A with a working build. Flash B with a broken build. Test
that the device rolls back to A without getting sent to recovery.
Merged-In: Ie5fc2d098355e2d095c53e9a95a6a8c7ab7ed051
Change-Id: Ie5fc2d098355e2d095c53e9a95a6a8c7ab7ed051
Daniel Rosenberg [Fri, 7 Jun 2019 20:05:41 +0000 (13:05 -0700)]
Defer deleteKey in KeyStorage in Checkpointing mode
am:
8cc5716ef1
Change-Id: I38a8d0de1760f0d526cb00c441129dc025049358
Xin Li [Fri, 7 Jun 2019 07:29:27 +0000 (00:29 -0700)]
[automerger skipped] Merge "DO NOT MERGE - Skip pi-platform-release (PPRL.190605.003) into stage-aosp-master" into stage-aosp-master
am:
b02c30cbf3 -s ours
am skip reason: subject contains skip directive
Change-Id: I456b2e5bf172a79d1c6aaf535de73b96897f5a4a
Xin Li [Fri, 7 Jun 2019 07:16:31 +0000 (00:16 -0700)]
[automerger skipped] DO NOT MERGE - Skip pi-platform-release (PPRL.190605.003) into stage-aosp-master
am:
3a6c897d05 -s ours
am skip reason: subject contains skip directive
Change-Id: Ie610a4b4078750bd62db70c8998643689dc6e25c
TreeHugger Robot [Fri, 7 Jun 2019 07:06:19 +0000 (07:06 +0000)]
Merge "DO NOT MERGE - Skip pi-platform-release (PPRL.190605.003) into stage-aosp-master" into stage-aosp-master
Daniel Rosenberg [Fri, 7 Jun 2019 03:38:38 +0000 (20:38 -0700)]
Defer deleteKey in KeyStorage in Checkpointing mode
Don't delete keys in checkpointing mode. Instead wait until the
checkpoint has been committed.
Bug:
134631661
Test: Flash A with a working build. Flash B with a broken build. Test
that the device rolls back to A without getting sent to recovery.
Change-Id: Ie5fc2d098355e2d095c53e9a95a6a8c7ab7ed051
Xin Li [Thu, 6 Jun 2019 18:33:51 +0000 (11:33 -0700)]
Restore historical behavior with fsck_msdos (always accept fixes).
Bug:
133725065
Change-Id: I1d50a7e52fda34e59eb6f051c7fde115a6cd5255
Dan Willemsen [Thu, 6 Jun 2019 04:23:39 +0000 (21:23 -0700)]
Merge "Match src paths with aidl package name" am:
94f300295d
am:
4be1fb5196
Change-Id: I19f23733b9114fe661b2e59b792cb9b1a2490465
Dan Willemsen [Thu, 6 Jun 2019 03:36:52 +0000 (20:36 -0700)]
Merge "Match src paths with aidl package name"
am:
94f300295d
Change-Id: I0e7afb27913038f302e43a97091825a0689dc1b6
Treehugger Robot [Thu, 6 Jun 2019 02:19:19 +0000 (02:19 +0000)]
Merge "Match src paths with aidl package name"
Xin Li [Wed, 5 Jun 2019 22:43:40 +0000 (15:43 -0700)]
DO NOT MERGE - Skip pi-platform-release (PPRL.190605.003) into stage-aosp-master
Bug:
134605042
Change-Id: I6b90349f94ffd8a05d5f04e8a6fb24018d93bedd
Dan Willemsen [Sat, 15 Sep 2018 04:28:50 +0000 (21:28 -0700)]
Match src paths with aidl package name
In order for the build system to track updates to the header files
during incremental builds, always specify the src files using the same
path as the package for C++ compilations.
Bug:
112114177
Test: treehugger
Change-Id: I9a2d638cbde46f67e2d5761f5b5113cc7e068ec5
android-build-team Robot [Wed, 5 Jun 2019 02:04:18 +0000 (02:04 +0000)]
Snap for
5524043 from
a736dde3f4625ffbc6487065c53545e76f7433b4 to pi-platform-release
Change-Id: I9998fe9b732b39b669a06a30fa7a22847c6b65ee
Sudheer Shanka [Fri, 31 May 2019 22:06:48 +0000 (15:06 -0700)]
Support "full" mode when updating bind mounts of a process.
am:
8f2ff80e87
Change-Id: I63eb199ebc731cafa137d8e12802abf2e078e909
Sudheer Shanka [Thu, 30 May 2019 23:40:20 +0000 (16:40 -0700)]
Support "full" mode when updating bind mounts of a process.
Bug:
133829348
Test: manual
Test: atest cts/hostsidetests/appsecurity/src/android/appsecurity/cts/ExternalStorageHostTest.java
Change-Id: I5f48ecbfe8cce243fa75a2e8447ce1d4676003ad
David Anderson [Wed, 22 May 2019 04:12:08 +0000 (21:12 -0700)]
Merge "Replace manual dm ioctls with libdm." am:
bc5818774c
am:
f1fa57d602
Change-Id: I8f49bf924272195c6ae2e827cfb78766d644d154
David Anderson [Wed, 22 May 2019 00:13:45 +0000 (17:13 -0700)]
Merge "Replace manual dm ioctls with libdm."
am:
bc5818774c
Change-Id: Id7ebd240d7c3e16397fcdd044113b54700b11fd5
David Anderson [Tue, 21 May 2019 21:46:38 +0000 (21:46 +0000)]
Merge "Replace manual dm ioctls with libdm."
Nick Kralevich [Wed, 15 May 2019 19:31:03 +0000 (12:31 -0700)]
Merge "FsCrypt.cpp: Do delayed restorecon on /data/vendor_ce" am:
3b290ece1a
am:
07d6eff5d5
Change-Id: I7f461143877014399c9a4f207af94ac75d7aa0a6
Nick Kralevich [Wed, 15 May 2019 19:25:11 +0000 (12:25 -0700)]
Merge "FsCrypt.cpp: Do delayed restorecon on /data/vendor_ce"
am:
3b290ece1a
Change-Id: I7d25b2611fb9c8e84139e3a00ccd88a1cc145f3b
Treehugger Robot [Wed, 15 May 2019 19:06:04 +0000 (19:06 +0000)]
Merge "FsCrypt.cpp: Do delayed restorecon on /data/vendor_ce"
Nick Kralevich [Tue, 14 May 2019 16:30:29 +0000 (09:30 -0700)]
FsCrypt.cpp: Do delayed restorecon on /data/vendor_ce
When Android boots after file_contexts has changed, the boot process
walks the entire /data partition, updating any changed SELinux labels as
appropriate. However, credential encrypted ("ce") directories are
deliberately excluded from this early boot directory walk. Files within
ce directories have their filenames encrypted, and as a result, cannot
match the file_contexts entries. Only after the user has unlocked their
device are the unencrypted filenames available and a restorecon
appropriate.
Ensure that we do a post-unlock restorecon on /data/vendor_ce, like we
do for /data/system_ce and /data/misc_ce. This ensures the labels on
files within these directories are correct after the device has been
unlocked.
(cherrypicked from commit
6a3ef488e5fea4f9c5992c76f4b20e7c800881c1)
Bug:
132349934
Test: See bug
132349934 comment #12 for test procedure
Change-Id: Ifcbef5fdfb236ec6dea418efa9d965db3a3b782f
Nick Kralevich [Wed, 15 May 2019 16:17:58 +0000 (09:17 -0700)]
FsCrypt.cpp: Do delayed restorecon on /data/vendor_ce
am:
6a3ef488e5
Change-Id: I900196a62e3fb2bd806a0f2980dca5aad138a7dd
Nick Kralevich [Tue, 14 May 2019 16:30:29 +0000 (09:30 -0700)]
FsCrypt.cpp: Do delayed restorecon on /data/vendor_ce
When Android boots after file_contexts has changed, the boot process
walks the entire /data partition, updating any changed SELinux labels as
appropriate. However, credential encrypted ("ce") directories are
deliberately excluded from this early boot directory walk. Files within
ce directories have their filenames encrypted, and as a result, cannot
match the file_contexts entries. Only after the user has unlocked their
device are the unencrypted filenames available and a restorecon
appropriate.
Ensure that we do a post-unlock restorecon on /data/vendor_ce, like we
do for /data/system_ce and /data/misc_ce. This ensures the labels on
files within these directories are correct after the device has been
unlocked.
Bug:
132349934
Test: See bug
132349934 comment #12 for test procedure
Change-Id: Ifcbef5fdfb236ec6dea418efa9d965db3a3b782f
David Anderson [Mon, 13 May 2019 20:02:54 +0000 (13:02 -0700)]
Replace manual dm ioctls with libdm.
This mostly 1:1 replaces manual ioctls to device-mapper with calls to
libdm. There were two exceptions:
(1) There is a very old table-load-retry loop to workaround issues with
umount (b/
7220345). This loop has been preserved, however, it now
includes DM_DEV_CREATE as well as DM_TABLE_LOAD.
(2) There was some ancient code to set DM_DEV_GEOMETRY for obb
dm-devices. This never did anything since geometry must be set after
loading a table. When setting it before (as vold was doing), the
subsequent DM_TABLE_LOAD will clear it.
Bug:
132206403
Test: FBE device boots
FBE device w/ metadata encryption boots
FDE device boots
atest StorageManagerIntegrationTest
Change-Id: Ib6db6b47329f093ac7084edaf604eddace8b9ac6
Sudheer Shanka [Fri, 10 May 2019 06:58:25 +0000 (23:58 -0700)]
[automerger skipped] Remove storage sandboxes related code.
am:
ebce4cc16b -s ours
am skip reason: change_id Ib3272a47a901ed106474039e72f123b11f5443ff with SHA1
5fceb48da1 is in history
Change-Id: I0d248b5b041118b318c36858882342d626fcb7b0
Sudheer Shanka [Mon, 29 Apr 2019 17:46:35 +0000 (10:46 -0700)]
Remove storage sandboxes related code.
Bug:
131115422
Test: manual
Test: atest --test-mapping packages/providers/MediaProvider
Test: atest cts/hostsidetests/appsecurity/src/android/appsecurity/cts/ExternalStorageHostTest.java
Test: atest DownloadProviderTests
Test: atest cts/tests/app/src/android/app/cts/DownloadManagerTest.java
Test: atest cts/tests/app/DownloadManagerLegacyTest/src/android/app/cts/DownloadManagerLegacyTest.java
Test: atest cts/tests/app/DownloadManagerApi28Test/src/android/app/cts/DownloadManagerApi28Test.java
Change-Id: Ib3272a47a901ed106474039e72f123b11f5443ff
Merged-In: Ib3272a47a901ed106474039e72f123b11f5443ff
Sudheer Shanka [Mon, 29 Apr 2019 17:46:35 +0000 (10:46 -0700)]
Remove storage sandboxes related code.
Bug:
131115422
Test: manual
Test: atest --test-mapping packages/providers/MediaProvider
Test: atest cts/hostsidetests/appsecurity/src/android/appsecurity/cts/ExternalStorageHostTest.java
Test: atest DownloadProviderTests
Test: atest cts/tests/app/src/android/app/cts/DownloadManagerTest.java
Test: atest cts/tests/app/DownloadManagerLegacyTest/src/android/app/cts/DownloadManagerLegacyTest.java
Test: atest cts/tests/app/DownloadManagerApi28Test/src/android/app/cts/DownloadManagerApi28Test.java
Change-Id: Ib3272a47a901ed106474039e72f123b11f5443ff
Merged-In: Ib3272a47a901ed106474039e72f123b11f5443ff
Martijn Coenen [Tue, 7 May 2019 07:01:48 +0000 (00:01 -0700)]
Merge "Stop using trigger_reset_main." am:
91a6c016ec
am:
19e74b3d1f
Change-Id: Ic1b955827da8e13e60734bd4fbbad7523ac97561
Martijn Coenen [Tue, 7 May 2019 06:57:12 +0000 (23:57 -0700)]
Merge "Stop using trigger_reset_main."
am:
91a6c016ec
Change-Id: Id4baa15b619a941c7059d19c59645a45b9060433
Martijn Coenen [Tue, 7 May 2019 06:41:01 +0000 (06:41 +0000)]
Merge "Stop using trigger_reset_main."
Martijn Coenen [Wed, 1 May 2019 19:42:48 +0000 (12:42 -0700)]
Merge "Stop using trigger_reset_main." into qt-dev
am:
9db42907b5
Change-Id: Ife6711c5e0ad5180ce805c8e1df02487c2a957be
Martijn Coenen [Wed, 1 May 2019 17:45:23 +0000 (17:45 +0000)]
Merge "Stop using trigger_reset_main." into qt-dev
Paul Crowley [Tue, 30 Apr 2019 05:27:14 +0000 (22:27 -0700)]
Create /data/vendor_ce/0/facedata in vold_prepare_subdirs
am:
b409ade4d7
Change-Id: I6b3a1624a1bfc0053c75f842a1c6f219071a3fb5
Martijn Coenen [Wed, 24 Apr 2019 08:41:11 +0000 (10:41 +0200)]
Stop using trigger_reset_main.
This trigger was used on FDE devices to bring down the minimal
framework, and worked by shutting down the 'main' service class.
With APEX being introduced, we want to restart all services that were
started after the tmpfs /data was mounted, as those are the services
that haven't been able to use updated APEXes in the (real) /data.
In order to do this, we need to reset more classes; that in turn
made the 'shutdown_main' trigger pretty much similar to the
previously existing 'trigger_shutdown_framework' trigger; so instead
of keeping two duplicate triggers, use only the
'trigger_shutdown_framework' one.
Bug:
118485723
Test: Taimen configured as FDE boots, Taimen configured as FBE boots
Change-Id: I0d80ef2528bd70870b063a2c580cd00a03de9961
Paul Crowley [Wed, 24 Apr 2019 00:04:35 +0000 (17:04 -0700)]
Create /data/vendor_ce/0/facedata in vold_prepare_subdirs
Bug:
131084614
Test: Modified sepolicy to match, ensured directory was created on
Crosshatch
Change-Id: I0978a630149158eb3b8f446abecb12e137e6fae5
Martijn Coenen [Wed, 24 Apr 2019 08:41:11 +0000 (10:41 +0200)]
Stop using trigger_reset_main.
This trigger was used on FDE devices to bring down the minimal
framework, and worked by shutting down the 'main' service class.
With APEX being introduced, we want to restart all services that were
started after the tmpfs /data was mounted, as those are the services
that haven't been able to use updated APEXes in the (real) /data.
In order to do this, we need to reset more classes; that in turn
made the 'shutdown_main' trigger pretty much similar to the
previously existing 'trigger_shutdown_framework' trigger; so instead
of keeping two duplicate triggers, use only the
'trigger_shutdown_framework' one.
Bug:
118485723
Test: Taimen configured as FDE boots, Taimen configured as FBE boots
Change-Id: I0d80ef2528bd70870b063a2c580cd00a03de9961
Paul Lawrence [Tue, 23 Apr 2019 23:33:08 +0000 (16:33 -0700)]
Merge "Use correct Statuses from Checkpoint code" am:
8d4164f92f
am:
7d9a965419
Change-Id: If69ffb3d977cd545ff04609b1240dbef563f0748
Paul Lawrence [Tue, 23 Apr 2019 23:25:53 +0000 (16:25 -0700)]
Merge "Use correct Statuses from Checkpoint code"
am:
8d4164f92f
Change-Id: I35ffbb3bc89eb695aa86c45f4aa0a8633cfd11b9
Treehugger Robot [Tue, 23 Apr 2019 23:07:27 +0000 (23:07 +0000)]
Merge "Use correct Statuses from Checkpoint code"
xzj [Fri, 19 Apr 2019 22:04:40 +0000 (15:04 -0700)]
Merge "fix data encryption fail when ENCRYPTION_FLAG_NO_UI is set" am:
c222ad20ee
am:
a921b6795e
Change-Id: Ia297c274b7a2b0005b31f69354fb4a7773f02439
Paul Lawrence [Fri, 19 Apr 2019 21:26:39 +0000 (14:26 -0700)]
Use correct Statuses from Checkpoint code
Bug:
130190815
Test: Added fake error to code and checked correct error was caught
Change-Id: If9ab9357f0f961607e15a4ba18d9d85bc9923019
xzj [Fri, 19 Apr 2019 21:15:15 +0000 (14:15 -0700)]
Merge "fix data encryption fail when ENCRYPTION_FLAG_NO_UI is set"
am:
c222ad20ee
Change-Id: I5ebb8825b40c3ce088607f8a4aa6d4fb506f6bd5
Treehugger Robot [Fri, 19 Apr 2019 20:27:44 +0000 (20:27 +0000)]
Merge "fix data encryption fail when ENCRYPTION_FLAG_NO_UI is set"
xzj [Fri, 12 Oct 2018 02:17:11 +0000 (10:17 +0800)]
fix data encryption fail when ENCRYPTION_FLAG_NO_UI is set
cause: data partition not being umount before real encryption
Change-Id: If5cc084c182d96c6205359b76ee0c474f6a77a2e
Sudheer Shanka [Fri, 19 Apr 2019 14:16:04 +0000 (07:16 -0700)]
Update remountUidLegacy to handle "full" mount mode.
am:
36bdf7ab54
Change-Id: I08b881cd744a21cb9127b7a2c22b25c388eb070c
Sudheer Shanka [Thu, 18 Apr 2019 22:18:30 +0000 (15:18 -0700)]
Update remountUidLegacy to handle "full" mount mode.
Bug:
130791955
Test: manual
Change-Id: I078c2922d1d5a8d16bbb213201a3cad7b1bf4b86
Sandeep Patil [Wed, 17 Apr 2019 23:06:43 +0000 (16:06 -0700)]
[automerger skipped] Merge "Add visible logs about fstrim run for block based checkpoints" am:
419528be57
am:
9389f389f5 -s ours
am skip reason: change_id I0cb8b6a85ae787e1ba2cdd7998a46942ca69760f with SHA1
e802d475bf is in history
Change-Id: I9fcc5843f969cbaeda85d4fb296e7416ddb1cde2
Sudheer Shanka [Wed, 17 Apr 2019 22:51:04 +0000 (15:51 -0700)]
Merge "Allow sandboxed apps to access only package specific dirs." into qt-dev
am:
0a9469e923
Change-Id: I66084eae25e8b08d6bdec2ea1f6c7e612a6b8a64
Sandeep Patil [Wed, 17 Apr 2019 22:10:43 +0000 (15:10 -0700)]
Merge "Add visible logs about fstrim run for block based checkpoints"
am:
419528be57
Change-Id: I546d5cb3807cd217e9ab992ee517d4a3164566e5
Sudheer Shanka [Wed, 17 Apr 2019 22:07:47 +0000 (22:07 +0000)]
Merge "Allow sandboxed apps to access only package specific dirs." into qt-dev
Treehugger Robot [Wed, 17 Apr 2019 21:11:04 +0000 (21:11 +0000)]
Merge "Add visible logs about fstrim run for block based checkpoints"
Sandeep Patil [Mon, 15 Apr 2019 15:45:27 +0000 (08:45 -0700)]
Add visible logs about fstrim run for block based checkpoints
Bug:
120095226
Test: Tested by forcing /data/system/last-fstrim last modified time back
2 years & manually trigger checkpoint using 'vdc checkpoint startCheckpoint 1'
Change-Id: I0cb8b6a85ae787e1ba2cdd7998a46942ca69760f
Merged-In: I0cb8b6a85ae787e1ba2cdd7998a46942ca69760f
Signed-off-by: Sandeep Patil <sspatil@google.com>
Sandeep Patil [Wed, 17 Apr 2019 17:07:06 +0000 (10:07 -0700)]
Add visible logs about fstrim run for block based checkpoints
am:
e802d475bf
Change-Id: If021a8803121094807dc232ad08ca6b984032e23
android-build-team Robot [Tue, 16 Apr 2019 22:41:51 +0000 (22:41 +0000)]
Merge cherrypicks of [
7077329,
7077440,
7077330,
7077468,
7076852,
7077469,
7077580,
7077581,
7077582,
7074025,
7077706,
7077707,
7077708,
7077388,
7077583,
7077584,
7077585,
7077726,
7077727,
7077331,
7077332,
7077459,
7077709,
7077710,
7077711,
7077712,
7077460,
7077461,
7077333,
7077334,
7077696] into pi-qpr3-release
Change-Id: Icfc00a7020e3f0589ff268071c8f6d18b6f2a445
Woody Lin [Mon, 11 Mar 2019 12:58:20 +0000 (20:58 +0800)]
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: Ia042b23699c37c94758fb660aecec64d39f39738
Merged-In: Ib8c349d6d033f86b247f4b35b8354d97cf249d26
(cherry picked from commit
a598e04a91c64741f9f71c6511a7ced7f71d194e)
Paul Crowley [Fri, 7 Dec 2018 23:36:09 +0000 (15:36 -0800)]
Fsync directories after creating files
Bug:
112145641
Bug:
124279741
Bug:
120248692
Test: adb shell locksettings set-pin 1111 && \
adb shell "echo b > /proc/sysrq-trigger"
Change-Id: I53d252942c21365983b4f8b6e0948b1864f195c1
Merged-In: I53d252942c21365983b4f8b6e0948b1864f195c1
(cherry picked from commit
2e58acb4123e559fddfd4013af3ead6c055bd71c)
Sandeep Patil [Mon, 15 Apr 2019 15:45:27 +0000 (08:45 -0700)]
Add visible logs about fstrim run for block based checkpoints
Bug:
120095226
Test: Tested by forcing /data/system/last-fstrim last modified time back
2 years & manually trigger checkpoint using 'vdc checkpoint startCheckpoint 1'
Change-Id: I0cb8b6a85ae787e1ba2cdd7998a46942ca69760f
Signed-off-by: Sandeep Patil <sspatil@google.com>
Sudheer Shanka [Fri, 12 Apr 2019 20:55:28 +0000 (13:55 -0700)]
Allow sandboxed apps to access only package specific dirs.
Bug:
130427780
Test: manual
Test: atest cts/hostsidetests/appsecurity/src/android/appsecurity/cts/ExternalStorageHostTest.java
Change-Id: I7afcea090306336c4033860084a2a436d2bb4740
Woody Lin [Wed, 10 Apr 2019 14:16:45 +0000 (07:16 -0700)]
[automerger skipped] Fsync directories before delete key am:
a598e04a91 -s ours
am:
3654986ae5 -s ours
am skip reason: change_id Ib8c349d6d033f86b247f4b35b8354d97cf249d26 with SHA1
37c82f5c0f is in history
Change-Id: I3f8153ebd963a10b1633103ccc941389be0164ee
Paul Crowley [Wed, 10 Apr 2019 14:16:34 +0000 (07:16 -0700)]
[automerger skipped] Fsync directories after creating files am:
2e58acb412 -s ours
am:
c6f4d9d5ae -s ours
am skip reason: change_id I53d252942c21365983b4f8b6e0948b1864f195c1 with SHA1
621d9b9732 is in history
Change-Id: I920346bf310aab6a16cea70d6e213fcff325134c
Woody Lin [Wed, 10 Apr 2019 14:06:41 +0000 (07:06 -0700)]
[automerger skipped] Fsync directories before delete key
am:
a598e04a91 -s ours
am skip reason: change_id Ib8c349d6d033f86b247f4b35b8354d97cf249d26 with SHA1
37c82f5c0f is in history
Change-Id: Ifec2d700dbe6bbe55e65e6e07003d1e77fb3dbc2
Paul Crowley [Wed, 10 Apr 2019 14:06:31 +0000 (07:06 -0700)]
[automerger skipped] Fsync directories after creating files
am:
2e58acb412 -s ours
am skip reason: change_id I53d252942c21365983b4f8b6e0948b1864f195c1 with SHA1
621d9b9732 is in history
Change-Id: Icdb62b1d4e6e7ca7d18df1083020d61d9b215165
Narayan Kamath [Wed, 10 Apr 2019 08:29:07 +0000 (01:29 -0700)]
AppFuseUtil: Call ForceUnmount before PrepareDir.
am:
15ad33a8b1
Change-Id: I39e24afab685cfbdcc492d135937bb2e34110818
Narayan Kamath [Tue, 9 Apr 2019 17:45:32 +0000 (18:45 +0100)]
AppFuseUtil: Call ForceUnmount before PrepareDir.
We'd previously call ForceUnmount after the call to PrepareDir,
which would sometimes fail because the userspace counterpart of a
FUSE FS that was previously mounted at that mountpoint has gone
away. This is usually reproducible after a runtime restart.
Bug:
128459728
Test: Loop (adb shell start; atest MediaStore_Images_MediaTest; adb shell stop;)
Change-Id: I38d3908487123614c338266f983afb04e3ed78d4
Eric Biggers [Tue, 9 Apr 2019 11:11:42 +0000 (04:11 -0700)]
Merge "Don't drop as many caches when evicting CE key" am:
a057b27f2a
am:
a30a907c65
Change-Id: Idaab2ccd2e6ad8afd8f45c20a27d1f34333970c1
Paul Crowley [Tue, 9 Apr 2019 10:57:24 +0000 (03:57 -0700)]
Merge changes I40575081,I1ca8f8cf,I38bfd273 am:
1c6a56b27f
am:
e6c7dffaa8
Change-Id: I2de88cca316040df8dcdcfbce237a9e4350f26bc
Eric Biggers [Fri, 5 Apr 2019 23:00:39 +0000 (16:00 -0700)]
Merge "Don't drop as many caches when evicting CE key"
am:
a057b27f2a
Change-Id: Ic98dbb34e6696de5ddcaeccb4ae0108cbe0a1921
Eric Biggers [Fri, 5 Apr 2019 21:04:22 +0000 (21:04 +0000)]
Merge "Don't drop as many caches when evicting CE key"
Eric Biggers [Wed, 3 Apr 2019 22:44:06 +0000 (15:44 -0700)]
Don't drop as many caches when evicting CE key
When a user's CE key is removed, write "2" to /proc/sys/vm/drop_caches
rather than "3". This avoids unnecessarily evicting the pagecache of
in-use inodes. It's only necessary to evict the inodes of the relevant
encrypted files, and these are already sync'ed and no longer in-use.
For this mode "2" suffices, as this evicts "reclaimable slab objects",
including inodes; and evicting an inode implies evicting its pagecache.
This matches the recommendation I've made in the documentation for the
fscrypt kernel feature at
https://www.kernel.org/doc/html/latest/filesystems/fscrypt.html#online-attacks
Test: Sanity check that directories are still "locked" properly:
Unlock device with PIN. Then in adb shell: 'stop; start;
sleep 10; ls /data/data/' still shows filenames in ciphertext form.
Change-Id: I1bdf3c420ebf63e98cc314498211061ea36f2942
Paul Crowley [Fri, 5 Apr 2019 19:15:24 +0000 (12:15 -0700)]
Merge changes I40575081,I1ca8f8cf,I38bfd273
am:
1c6a56b27f
Change-Id: I8410e8cb691eb0b5e3e721b6b715eb30f28eef51
Paul Crowley [Fri, 5 Apr 2019 18:26:39 +0000 (18:26 +0000)]
Merge changes I40575081,I1ca8f8cf,I38bfd273
* changes:
clang-format Utils.cpp
vold: fsync both file and directory after write keys
vold: Introduce android::vold::writeStringToFile
Sandeep Patil [Fri, 5 Apr 2019 17:08:53 +0000 (10:08 -0700)]
Merge "vdc: print the failed command with failure status." am:
b8d17384c5
am:
880deb6add
Change-Id: Ib680ab944a6e197e4afd3f4e2d36dcd345cbf9c8
Paul Crowley [Fri, 5 Apr 2019 11:09:57 +0000 (04:09 -0700)]
clang-format Utils.cpp
Test: treehugger
Change-Id: I405750812ae037088492bfa7d8db6a8a56cb3425
Tommy Chiu [Tue, 26 Mar 2019 06:14:19 +0000 (14:14 +0800)]
vold: fsync both file and directory after write keys
Use vold version of writeStringToFile which fsync files, and
manually fsync directories after initialize global DE
(cherry picked from commit
a98464f688d6e16ca7558251306ece98058b55ce)
Bug:
71810347
Test: Build pass and reboot stress test.
Original boot failure symptom is NOT reproducible.
Change-Id: I1ca8f8cf0ccfd01075a9c33f79042e58d99aea26
Merged-In: I1ca8f8cf0ccfd01075a9c33f79042e58d99aea26
Tommy Chiu [Tue, 26 Mar 2019 09:18:09 +0000 (17:18 +0800)]
vold: Introduce android::vold::writeStringToFile
Remove static definition of writeStringToFile, and
move it from KeyStorage to Utils
(cherry picked from commit
0bd2d116921ab46312cc4a37246a68d38447a72b)
Bug:
71810347
Test: Build pass and reboot stress test.
Change-Id: I38bfd27370ac2372e446dc699f518122e73c6877
Merged-In: I38bfd27370ac2372e446dc699f518122e73c6877
Sandeep Patil [Thu, 4 Apr 2019 18:39:35 +0000 (11:39 -0700)]
Merge "vdc: print the failed command with failure status."
am:
b8d17384c5
Change-Id: I6d778f903948cfcee5e377ab22502ed4e1b52ba7
Treehugger Robot [Thu, 4 Apr 2019 18:16:27 +0000 (18:16 +0000)]
Merge "vdc: print the failed command with failure status."
Eric Biggers [Thu, 4 Apr 2019 16:55:49 +0000 (09:55 -0700)]
Merge "Add missing null terminator for getopt_long()" am:
4d05e017f9
am:
4e3300374b
Change-Id: Ic91066f2abfdc191fe4d0b517fd65d9744387e7b
Eric Biggers [Thu, 4 Apr 2019 16:37:52 +0000 (09:37 -0700)]
Merge "Add missing null terminator for getopt_long()"
am:
4d05e017f9
Change-Id: I18d49879af84b0d58254eda501e0ed7ea5a3ca11
Sandeep Patil [Thu, 4 Apr 2019 16:35:51 +0000 (09:35 -0700)]
vdc: print the failed command with failure status.
vdc currently only prints generic binder failure status on failure.
This doesn't help debugging early boot failures at all since we don't
know which exact vdc command failed. Fix that by adding the command as
part of the failure message.
Bug:
129946805
Test: Boot cuttlefish
Change-Id: Ic2367cf592d6b5bf23d6d4b1447baa1baf41afe7
Signed-off-by: Sandeep Patil <sspatil@google.com>
Eric Biggers [Thu, 4 Apr 2019 16:18:18 +0000 (16:18 +0000)]
Merge "Add missing null terminator for getopt_long()"
Eric Biggers [Wed, 3 Apr 2019 23:32:24 +0000 (16:32 -0700)]
Add missing null terminator for getopt_long()
getopt_long() assumes an all-zeroes 'struct option' at the end of the
array. Add it.
Fortunately this isn't causing problems in practice because vold is
always passed valid command line options...
Test: Running 'vold --foo' no longer segfaults.
Change-Id: I2cd3af501cc1aa11327a8062ec492be1d23defdf
Eric Biggers [Wed, 3 Apr 2019 21:38:28 +0000 (21:38 +0000)]
Merge "vold: downgrade lookup_key_ref() failure message to DEBUG level"
Daniel Rosenberg [Tue, 2 Apr 2019 22:52:12 +0000 (15:52 -0700)]
Merge "Retry opening loop device" am:
c8f5cbb5b1 am:
de841f6d89
am:
dde25e9167
Change-Id: I14fc99509f8b5f83cc2dd0a035d1b127c581b027
Daniel Rosenberg [Tue, 2 Apr 2019 22:08:19 +0000 (15:08 -0700)]
Merge "Retry opening loop device" am:
c8f5cbb5b1
am:
de841f6d89
Change-Id: Ia0765900543f1778fbbe5d26dcadaff8364a89b5
Daniel Rosenberg [Tue, 2 Apr 2019 21:23:59 +0000 (14:23 -0700)]
Merge "Retry opening loop device"
am:
c8f5cbb5b1
Change-Id: I5657465fe50f61e3c45e7d13eb5953ef7771d5fa