Commit graph

2961 commits

Author SHA1 Message Date
Sudheer Shanka
4cb696eb0d [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
2019-05-09 23:58:25 -07:00
Sudheer Shanka
5fceb48da1 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
2019-05-09 17:48:04 -07:00
Sudheer Shanka
ebce4cc16b 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
2019-05-09 17:46:30 +00:00
Martijn Coenen
676e2e0221 Merge "Stop using trigger_reset_main." am: 91a6c016ec
am: 19e74b3d1f

Change-Id: Ic1b955827da8e13e60734bd4fbbad7523ac97561
2019-05-07 00:01:48 -07:00
Martijn Coenen
19e74b3d1f Merge "Stop using trigger_reset_main."
am: 91a6c016ec

Change-Id: Id4baa15b619a941c7059d19c59645a45b9060433
2019-05-06 23:57:12 -07:00
Martijn Coenen
91a6c016ec Merge "Stop using trigger_reset_main." 2019-05-07 06:41:01 +00:00
android-build-team Robot
59295fbb94 Snap for 5526913 from a598e04a91 to pi-qpr3-b-release
Change-Id: Ifecb1d932e1c9011dd0c018458f70ef79c289b45
2019-05-03 09:23:35 +00:00
Martijn Coenen
ac62753649 Merge "Stop using trigger_reset_main." into qt-dev
am: 9db42907b5

Change-Id: Ife6711c5e0ad5180ce805c8e1df02487c2a957be
2019-05-01 12:42:48 -07:00
Martijn Coenen
9db42907b5 Merge "Stop using trigger_reset_main." into qt-dev 2019-05-01 17:45:23 +00:00
Paul Crowley
b81297878b Create /data/vendor_ce/0/facedata in vold_prepare_subdirs
am: b409ade4d7

Change-Id: I6b3a1624a1bfc0053c75f842a1c6f219071a3fb5
2019-04-29 22:27:14 -07:00
Martijn Coenen
aec7a0a165 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
2019-04-26 14:05:28 +02:00
Paul Crowley
b409ade4d7 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
2019-04-25 19:27:26 +00:00
Martijn Coenen
f629b009b8 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
2019-04-24 10:41:11 +02:00
Paul Lawrence
f603a1d3b2 Merge "Use correct Statuses from Checkpoint code" am: 8d4164f92f
am: 7d9a965419

Change-Id: If69ffb3d977cd545ff04609b1240dbef563f0748
2019-04-23 16:33:08 -07:00
Paul Lawrence
7d9a965419 Merge "Use correct Statuses from Checkpoint code"
am: 8d4164f92f

Change-Id: I35ffbb3bc89eb695aa86c45f4aa0a8633cfd11b9
2019-04-23 16:25:53 -07:00
Treehugger Robot
8d4164f92f Merge "Use correct Statuses from Checkpoint code" 2019-04-23 23:07:27 +00:00
xzj
3348c6e915 Merge "fix data encryption fail when ENCRYPTION_FLAG_NO_UI is set" am: c222ad20ee
am: a921b6795e

Change-Id: Ia297c274b7a2b0005b31f69354fb4a7773f02439
2019-04-19 15:04:40 -07:00
Paul Lawrence
82b3505e2e Use correct Statuses from Checkpoint code
Bug: 130190815
Test: Added fake error to code and checked correct error was caught
Change-Id: If9ab9357f0f961607e15a4ba18d9d85bc9923019
2019-04-19 14:50:59 -07:00
xzj
a921b6795e Merge "fix data encryption fail when ENCRYPTION_FLAG_NO_UI is set"
am: c222ad20ee

Change-Id: I5ebb8825b40c3ce088607f8a4aa6d4fb506f6bd5
2019-04-19 14:15:15 -07:00
Treehugger Robot
c222ad20ee Merge "fix data encryption fail when ENCRYPTION_FLAG_NO_UI is set" 2019-04-19 20:27:44 +00:00
xzj
7e38a3a3c8 fix data encryption fail when ENCRYPTION_FLAG_NO_UI is set
cause: data partition not being umount before real encryption
Change-Id: If5cc084c182d96c6205359b76ee0c474f6a77a2e
2019-04-19 18:07:13 +00:00
Sudheer Shanka
08a7e13025 Update remountUidLegacy to handle "full" mount mode.
am: 36bdf7ab54

Change-Id: I08b881cd744a21cb9127b7a2c22b25c388eb070c
2019-04-19 07:16:04 -07:00
Sudheer Shanka
36bdf7ab54 Update remountUidLegacy to handle "full" mount mode.
Bug: 130791955
Test: manual
Change-Id: I078c2922d1d5a8d16bbb213201a3cad7b1bf4b86
2019-04-18 15:18:30 -07:00
Sandeep Patil
d085b05c89 [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
2019-04-17 16:06:43 -07:00
Sudheer Shanka
a502c6aa58 Merge "Allow sandboxed apps to access only package specific dirs." into qt-dev
am: 0a9469e923

Change-Id: I66084eae25e8b08d6bdec2ea1f6c7e612a6b8a64
2019-04-17 15:51:04 -07:00
Sandeep Patil
9389f389f5 Merge "Add visible logs about fstrim run for block based checkpoints"
am: 419528be57

Change-Id: I546d5cb3807cd217e9ab992ee517d4a3164566e5
2019-04-17 15:10:43 -07:00
Sudheer Shanka
0a9469e923 Merge "Allow sandboxed apps to access only package specific dirs." into qt-dev 2019-04-17 22:07:47 +00:00
Treehugger Robot
419528be57 Merge "Add visible logs about fstrim run for block based checkpoints" 2019-04-17 21:11:04 +00:00
Sandeep Patil
f8da61f26a 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>
2019-04-17 12:55:58 -07:00
Sandeep Patil
3cf3d31a0b Add visible logs about fstrim run for block based checkpoints
am: e802d475bf

Change-Id: If021a8803121094807dc232ad08ca6b984032e23
2019-04-17 10:07:06 -07:00
android-build-team Robot
a736dde3f4 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
2019-04-16 22:41:51 +00:00
Woody Lin
0496e3698f 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 a598e04a91)
2019-04-16 22:39:59 +00:00
Paul Crowley
4b9c47d70f 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 2e58acb412)
2019-04-16 22:39:52 +00:00
Sandeep Patil
e802d475bf 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>
2019-04-15 10:12:19 -07:00
Sudheer Shanka
a05ea743f0 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
2019-04-12 16:40:57 -07:00
Woody Lin
dbac71e050 [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
2019-04-10 07:16:45 -07:00
Paul Crowley
7886e9359e [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
2019-04-10 07:16:34 -07:00
Woody Lin
3654986ae5 [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
2019-04-10 07:06:41 -07:00
Paul Crowley
c6f4d9d5ae [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
2019-04-10 07:06:31 -07:00
Narayan Kamath
b553c62bf1 AppFuseUtil: Call ForceUnmount before PrepareDir.
am: 15ad33a8b1

Change-Id: I39e24afab685cfbdcc492d135937bb2e34110818
2019-04-10 01:29:07 -07:00
Narayan Kamath
15ad33a8b1 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
2019-04-09 18:45:32 +01:00
Eric Biggers
d019a2950a Merge "Don't drop as many caches when evicting CE key" am: a057b27f2a
am: a30a907c65

Change-Id: Idaab2ccd2e6ad8afd8f45c20a27d1f34333970c1
2019-04-09 04:11:42 -07:00
Paul Crowley
dba96e85f8 Merge changes I40575081,I1ca8f8cf,I38bfd273 am: 1c6a56b27f
am: e6c7dffaa8

Change-Id: I2de88cca316040df8dcdcfbce237a9e4350f26bc
2019-04-09 03:57:24 -07:00
Eric Biggers
a30a907c65 Merge "Don't drop as many caches when evicting CE key"
am: a057b27f2a

Change-Id: Ic98dbb34e6696de5ddcaeccb4ae0108cbe0a1921
2019-04-05 16:00:39 -07:00
Eric Biggers
a057b27f2a Merge "Don't drop as many caches when evicting CE key" 2019-04-05 21:04:22 +00:00
Eric Biggers
ce36868316 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
2019-04-05 12:19:46 -07:00
Paul Crowley
e6c7dffaa8 Merge changes I40575081,I1ca8f8cf,I38bfd273
am: 1c6a56b27f

Change-Id: I8410e8cb691eb0b5e3e721b6b715eb30f28eef51
2019-04-05 12:15:24 -07:00
Paul Crowley
1c6a56b27f Merge changes I40575081,I1ca8f8cf,I38bfd273
* changes:
  clang-format Utils.cpp
  vold: fsync both file and directory after write keys
  vold: Introduce android::vold::writeStringToFile
2019-04-05 18:26:39 +00:00
Sandeep Patil
faad076163 Merge "vdc: print the failed command with failure status." am: b8d17384c5
am: 880deb6add

Change-Id: Ib680ab944a6e197e4afd3f4e2d36dcd345cbf9c8
2019-04-05 10:08:53 -07:00
Paul Crowley
747b421a22 clang-format Utils.cpp
Test: treehugger
Change-Id: I405750812ae037088492bfa7d8db6a8a56cb3425
2019-04-05 04:09:57 -07:00