Commit graph

2159 commits

Author SHA1 Message Date
Sudheer Shanka
4a923e216d Merge "Use /mnt/storage for bind mounting package sandboxes." 2018-08-24 08:20:31 +00:00
Sudheer Shanka
3a7ee5c2ae Use /mnt/storage for bind mounting package sandboxes.
Create a new slave bind mount at /mnt/storage and use this for
creating package sandboxes. This will help prevent package
specific data directories from getting duplicated and also make
handling bind mounts for packages with sharedUserIds easier.

Bug: 111890351
Test: manual
Change-Id: I0f590cc99a379d93f6db85bf56e8d274e3ea7488
2018-08-23 21:40:07 -07:00
Sudheer Shanka
70a7828f34 Add a new external storage mount mode.
MODE_EXTERNAL_FULL is added which indicates the app
should get access to entire external storage.

Bug: 111890351
Test: manual
Change-Id: Ie2d8c99f4e3bf064ed238ade7bbf625aa2d1e907
2018-08-21 19:19:03 -07:00
Jaegeuk Kim
f2ccd56e7a Merge "vold: Grant root group" am: 732def209c am: 66166118d2
am: 0b254f317b

Change-Id: Ie712749a4acd29cafb217d2a3875df224dddd789
2018-08-13 16:19:27 -07:00
Jaegeuk Kim
0b254f317b Merge "vold: Grant root group" am: 732def209c
am: 66166118d2

Change-Id: I4fa1f6c4f0c58ef8c51e1648bf00daab2aa0f5a6
2018-08-13 15:42:34 -07:00
Jaegeuk Kim
66166118d2 Merge "vold: Grant root group"
am: 732def209c

Change-Id: If13da04a9cff5a54665626397b9c6bc165df10c7
2018-08-13 14:06:05 -07:00
Treehugger Robot
732def209c Merge "vold: Grant root group" 2018-08-13 20:54:13 +00:00
Paul Crowley
1ffa22e2ff Merge "Switch pattern/PIN constants to match values in cryptfs.h" am: 92f5db4a06 am: 6d418929f0 am: a2c5a6b3c2
am: f92ea9c4ef

Change-Id: I5ce921cb9c1ca0f27424ceb84e49793bb2c81d5d
2018-08-08 23:10:49 -07:00
Jaegeuk Kim
c0eea5736e vold: Grant root group
When using make_f2fs to format a filesystem with quota enabled, make_f2fs
will write quota record with group id equtal to make_f2fs's execution
group id.
Vold shall run as root group so that make_f2fs forked by vold will enherit
vold's root group. Make_f2fs can then write quota record with group id for
root group and therefore kernel quota driver can find quota record for
root group.

Bug: 111775499
Change-Id: I0c1fef760597d1695586d24365200b25e2cf07e6
Signed-off-by: Light Hsieh <light.hsieh@mediatek.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@google.com>
2018-08-08 17:08:02 -07:00
Paul Crowley
f92ea9c4ef Merge "Switch pattern/PIN constants to match values in cryptfs.h" am: 92f5db4a06 am: 6d418929f0
am: a2c5a6b3c2

Change-Id: I93c28ad038ce7bf45e7eff8a1754272a1669ed67
2018-08-08 12:00:18 -07:00
Greg Kaiser
1db19c2bf3 Merge "cryptfs: Remove Speck support" am: cf0cb0bc1f am: 421e1059b7 am: 1bc4f99b35
am: 60d1ab92cc

Change-Id: Icb65ca14fa9df102d9c531ee871ee8f083cbbcd7
2018-08-08 11:57:16 -07:00
Paul Crowley
a2c5a6b3c2 Merge "Switch pattern/PIN constants to match values in cryptfs.h" am: 92f5db4a06
am: 6d418929f0

Change-Id: I68dc3538393c51c2055535eb55587ebb7b697ba7
2018-08-08 11:33:12 -07:00
Greg Kaiser
60d1ab92cc Merge "cryptfs: Remove Speck support" am: cf0cb0bc1f am: 421e1059b7
am: 1bc4f99b35

Change-Id: I269b8702e27c1849cd121e5152135eeb9136fc50
2018-08-08 11:18:19 -07:00
Greg Kaiser
1bc4f99b35 Merge "cryptfs: Remove Speck support" am: cf0cb0bc1f
am: 421e1059b7

Change-Id: I26fe4bc95f91f410cf1242e698e94ed4231c01ee
2018-08-08 11:05:38 -07:00
Paul Crowley
6d418929f0 Merge "Switch pattern/PIN constants to match values in cryptfs.h"
am: 92f5db4a06

Change-Id: I6eb0b99b9fbd25ed8f189cbc914a9a3bd7cb3069
2018-08-08 11:01:30 -07:00
Greg Kaiser
421e1059b7 Merge "cryptfs: Remove Speck support"
am: cf0cb0bc1f

Change-Id: I4e44dd132d94b7583ab2df50469ac80bf9ae7a9b
2018-08-08 10:41:09 -07:00
Xin Li
e2407d88c3 Merge "Merge Android Pie into master" am: 7fcaa13d4c am: 2042258f38 am: ae4709298d
am: 6a165eac53

Change-Id: Ibef0f1d529258f9f0f22a55cace39479d8b7a505
2018-08-08 04:48:53 -07:00
Xin Li
6a165eac53 Merge "Merge Android Pie into master" am: 7fcaa13d4c am: 2042258f38
am: ae4709298d

Change-Id: I11cc89572c973a77f8b74c670657225f97c42791
2018-08-07 23:46:10 -07:00
Xin Li
ae4709298d Merge "Merge Android Pie into master" am: 7fcaa13d4c
am: 2042258f38

Change-Id: If376d606aa23dbb916bc8255da9febc5f095ca5a
2018-08-07 19:20:42 -07:00
Xin Li
2042258f38 Merge "Merge Android Pie into master"
am: 7fcaa13d4c

Change-Id: I99ee2ff5662766207659cfa1afc9f337f238c781
2018-08-07 15:51:17 -07:00
Treehugger Robot
92f5db4a06 Merge "Switch pattern/PIN constants to match values in cryptfs.h" 2018-08-07 22:03:11 +00:00
Treehugger Robot
cf0cb0bc1f Merge "cryptfs: Remove Speck support" 2018-08-07 21:11:50 +00:00
Sudheer Shanka
5cc0d564c8 Merge "Update sandbox structure for apps with sharedUserIds." 2018-08-07 19:09:06 +00:00
Greg Kaiser
0ba33ed3db cryptfs: Remove Speck support am: 17059fe53b
am: 713e0bf64f

Change-Id: Ib2c7ccd09b4215922f96fa95c5f14bb8d889fb87
2018-08-07 12:04:14 -07:00
Greg Kaiser
713e0bf64f cryptfs: Remove Speck support
am: 17059fe53b

Change-Id: I86d4cc91776ba8c2653d14d609403ab98e98ba64
2018-08-07 11:42:46 -07:00
Sudheer Shanka
f768c271a3 Update sandbox structure for apps with sharedUserIds.
For apps with sharedUserIds, sandbox/shared:<shared-user-id> is
currently used as sandbox root. Given that <shared-user-id> can
be upto 255 characters, adding "shared:" might tip over the
filename limit on ext4 filesystems. So, instead use
sandbox/shared/<shared-user-id> as the sandbox root.

Bug: 111890351
Test: manual
Change-Id: Iba437b3eed59f9eb3094a823e8bf2a5a58410fd7
2018-08-07 10:47:38 -07:00
Sudheer Shanka
d4cb6d4458 Merge "Keep /sdcard working for shell process when isolated storage is enabled." 2018-08-07 17:46:38 +00:00
Greg Kaiser
17059fe53b cryptfs: Remove Speck support
Remove the Speck encryption support. It was eventually
decided not to allow Speck in Android P, so this code
is no longer needed and wasn't used outside of testing.

Note we don't just "git revert" the original commit
(38723f23ff) because we want
to retain the infrastructure for allowing new types of
crypto algorithms in the future.

Bug: 112009351
Test: Attempted to setup a device with ro.crypto.fde_algorithm set to Speck, and Speck was rejected and the system defaulted to AES.
Change-Id: I69a8b4e8632f8d30b5b54783cb986ab42d4397d9
2018-08-07 10:19:23 -07:00
Paul Crowley
ca08c0a724 Switch pattern/PIN constants to match values in cryptfs.h
Bug: 111051602
Test: Steps to reproduce in b/111051602
Change-Id: I21955f41d2594917d5baa1bc4d61da0106cd9170
2018-08-07 10:19:05 -07:00
Greg Kaiser
b353a61292 cryptfs: Remove Speck support
Remove the Speck encryption support. It was eventually
decided not to allow Speck in Android P, so this code
is no longer needed and wasn't used outside of testing.

Note we don't just "git revert" the original commit
(38723f23ff) because we want
to retain the infrastructure for allowing new types of
crypto algorithms in the future.

Bug: 112009351
Test: Attempted to setup a device with ro.crypto.fde_algorithm set to Speck, and Speck was rejected and the system defaulted to AES.
Change-Id: I69a8b4e8632f8d30b5b54783cb986ab42d4397d9
2018-08-07 10:11:05 -07:00
Xin Li
7fcaa13d4c Merge "Merge Android Pie into master" 2018-08-07 16:51:28 +00:00
Xin Li
25f0830ff1 Merge Android Pie into master
Bug: 112104996
Change-Id: Ibda46522d646c0a391c7d19663e4ffdb3d4b30fc
2018-08-06 16:52:51 -07:00
Greg Kaiser
e3f5932979 VoldNativeService: Minor performance improvement
string::find() looks in every position of the string for a match.
We switch to android::base::StartsWith() so we only look for
a match in the first position.

Test: TreeHugger
Change-Id: Idda1a6b60cab8b4eb4b335921fe0fa38eab724dc
2018-08-06 09:08:55 -07:00
Jaegeuk Kim
a8341e8779 Merge "secdiscard: should pin_file to avoid moving blocks in F2FS" am: cb114c36d8 am: b7b419541b am: 2db64225ca
am: 5d07d87701

Change-Id: I74812879d97495154a28c2beeefaba279505730a
2018-08-03 18:23:34 -07:00
Sudheer Shanka
a695f25518 Keep /sdcard working for shell process when isolated storage is enabled.
This is same as what we are doing as of P, symlinking
"/mnt/user/<user-id>/primary" to primary volume path.

Bug: 111890351
Test: manual
Change-Id: I3bc538401bf56fd6243ce7eca424cc4c9b585974
2018-08-03 18:17:03 -07:00
Jaegeuk Kim
5d07d87701 Merge "secdiscard: should pin_file to avoid moving blocks in F2FS" am: cb114c36d8 am: b7b419541b
am: 2db64225ca

Change-Id: I01b1903a5d47188432f1eec5d522ead77db18675
2018-08-03 17:21:37 -07:00
Jaegeuk Kim
2db64225ca Merge "secdiscard: should pin_file to avoid moving blocks in F2FS" am: cb114c36d8
am: b7b419541b

Change-Id: I00d955ad5e8671c57b6a3acbe1e694fbf0b28d69
2018-08-03 17:11:47 -07:00
Jaegeuk Kim
b7b419541b Merge "secdiscard: should pin_file to avoid moving blocks in F2FS"
am: cb114c36d8

Change-Id: I3376ce6a9844d26c4e5658fc95477b8d6c9c0afe
2018-08-03 16:55:37 -07:00
Treehugger Robot
cb114c36d8 Merge "secdiscard: should pin_file to avoid moving blocks in F2FS" 2018-08-03 23:23:40 +00:00
Sudheer Shanka
cc0df59242 Add sanity checks for packageName and sandboxId args in vold.
Bug: 111890351
Test: device boots
Change-Id: Ic5856bc45963ee1264205db874758396f5425093
2018-08-03 12:59:50 -07:00
Jaegeuk Kim
ab515b2011 secdiscard: should pin_file to avoid moving blocks in F2FS
This file should avoid F2FS GC, since it directly access block device based
on fibmap.

Bug: 111659036
Change-Id: I15aef8175c23ba4029eb580e2dba59c77cca8227
Signed-off-by: Jaegeuk Kim <jaegeuk@google.com>
2018-08-02 14:17:17 -07:00
Sudheer Shanka
53947a3662 Update vold to prepare package sandboxes for primary volume.
Vold is updated to create package specific sandboxes for primary
volume and mount them at
"/mnt/user/<user-id>/package/<package-name>/<primary-label>".
This will later be mounted at /storage when a new process starts.

Bug: 111890351
Test: Manually verified that a package has access to "/sdcard" and
      "/storage/emulated/0", both of which are just the package specific
      sandboxes and the package doesn't have access to other sandboxes
      and can't see other package names.

Change-Id: I72dc8ae9eb2260a298159c5de18387dad2f9de48
2018-08-01 10:24:13 -07:00
Sudheer Shanka
62bbb2b1d2 Update vold to handle package info from StorageManagerService.
Bug: 111890351
Test: n/a
Change-Id: I098ad4bc15fae843909d97dad5d301a4e53d51bc
2018-08-01 01:23:15 -07:00
Sudheer Shanka
ebaad1c848 Update IVold interface to take packageNames when a user starts.
Bug: 111890351
Test: n/a
Change-Id: Ia24f15112f9a4ee4994688ff8fedf786cbf479b7
Exempt-From-Owner-Approval: This was approved as part of http://ag/4494673
2018-08-01 07:16:28 +00:00
Sudheer Shanka
76c6bdab9c Merge "Add APIs for pushing package info to vold." 2018-07-31 20:18:24 +00:00
Sudheer Shanka
d484aa9dad Add APIs for pushing package info to vold.
Bug: 111890351
Test: n/a
Change-Id: I3194a88a9ce612a2e4f2c7ea9e3392e0f8020fc1
2018-07-31 10:07:34 -07:00
Jaegeuk Kim
ca772bf314 vold: meta encryption: fix /dev/block/by-name/userdata to dm-3 am: 31e962fe19
am: fe69ce34e6

Change-Id: Ib6d60d8be05fdb666215a54e3eabcdad712ef3eb
2018-07-30 13:26:53 -07:00
Jaegeuk Kim
fe69ce34e6 vold: meta encryption: fix /dev/block/by-name/userdata to dm-3
am: 31e962fe19

Change-Id: Ib7324e29b7384bc7c1c847ce62af5230fa8a0081
2018-07-30 13:22:02 -07:00
Jaegeuk Kim
31e962fe19 vold: meta encryption: fix /dev/block/by-name/userdata to dm-3
This fixes F2FS GC failure in idle-maint.
07-28 18:25:54.838   603 11187 D vold    : idle maintenance started
07-28 18:25:54.846   603 11187 D vold    : Start GC on /sys/fs/f2fs/sda21
07-28 18:25:54.847   603 11187 W vold    : Set discard gralunarity failed on/sys/fs/f2fs/sda21: No such file or directory
07-28 18:25:54.847   603 11187 W vold    : Start GC failed on /sys/fs/f2fs/sda21: No such file or directory

Bug: 111953875
Change-Id: I1d10802121d5641cf9ba780fee249affd2cf6ffe
Signed-off-by: Jaegeuk Kim <jaegeuk@google.com>
2018-07-29 18:22:47 -07:00
Roman Kiryanov
f101236657 Do not crash if secontext is nullptr
LOG(DEBUG) tries to print a string pointed by secontext.get() but
crashed if it was nullptr.

Bug: 111888637
Test: "make -j50" and ran emulator
Change-Id: Iac78f650e7f48781030dc610f7d35cd52c250802
Signed-off-by: Roman Kiryanov <rkir@google.com>
2018-07-26 13:41:14 -07:00