OSDN Git Service
Rubin Xu [Thu, 11 Oct 2018 23:24:06 +0000 (16:24 -0700)]
[automerger skipped] Merge "[DO NOT MERGE] Fix signedness mismatch and integer underflow" into oc-dev am:
92e63e3f9b am:
b1498d1d87
am:
89858102c2 -s ours
Change-Id: Idf0858840a8472059899bfd565e4182c2c210693
Rubin Xu [Thu, 11 Oct 2018 23:23:55 +0000 (16:23 -0700)]
[automerger skipped] [automerger] [DO NOT MERGE] Fix signedness mismatch and integer underflow am:
ef35553d53 am:
08bd47e9a9 am:
279cc3d65e am:
972b5551f6 skipped:
ded6cb5910 am:
0d2edbd6ab am:
b078fd6b8c
am:
6460a0149b -s ours
Change-Id: Ie581371ca539f2513758529dad38dca903b8dac9
Rubin Xu [Thu, 11 Oct 2018 23:16:03 +0000 (16:16 -0700)]
Merge "[DO NOT MERGE] Fix signedness mismatch and integer underflow" into oc-dev am:
92e63e3f9b
am:
b1498d1d87
Change-Id: Ic7ef94c42d54d4f29c92bad98001bd6e065f5013
Rubin Xu [Thu, 11 Oct 2018 23:15:48 +0000 (16:15 -0700)]
[automerger] [DO NOT MERGE] Fix signedness mismatch and integer underflow am:
ef35553d53 am:
08bd47e9a9 am:
279cc3d65e am:
972b5551f6 skipped:
ded6cb5910 am:
0d2edbd6ab
am:
b078fd6b8c
Change-Id: I163ea50aca6838abcf0c58e042a5fe386f661afe
Rubin Xu [Thu, 11 Oct 2018 23:10:57 +0000 (16:10 -0700)]
Merge "[DO NOT MERGE] Fix signedness mismatch and integer underflow" into oc-dev
am:
92e63e3f9b
Change-Id: Ia169a9fc152f100a9567f2c47ef5a2e46358aa52
Rubin Xu [Thu, 11 Oct 2018 23:10:41 +0000 (16:10 -0700)]
[automerger] [DO NOT MERGE] Fix signedness mismatch and integer underflow am:
ef35553d53 am:
08bd47e9a9 am:
279cc3d65e am:
972b5551f6 skipped:
ded6cb5910
am:
0d2edbd6ab
Change-Id: I5f5e7425c927bdc6de7b401995fccc1f626355c7
TreeHugger Robot [Thu, 11 Oct 2018 23:01:50 +0000 (23:01 +0000)]
Merge "[DO NOT MERGE] Fix signedness mismatch and integer underflow" into oc-dev
Rubin Xu [Tue, 9 Oct 2018 15:13:38 +0000 (16:13 +0100)]
[DO NOT MERGE] Fix signedness mismatch and integer underflow
persist_get_max_entries() is supposed to return an unsigned integer as the
maximum number of entries but it also wrongly returns "-1" as an error
condition. Also fix an issue where an unsigned subtraction in this routine
could lead to integer underflow.
Bug:
112731440
Test: manual
Change-Id: I9672e39bef2c12156dda7806a08c52044962c178
Android Build Merger (Role) [Wed, 10 Oct 2018 10:26:09 +0000 (10:26 +0000)]
[automerger] [DO NOT MERGE] Fix signedness mismatch and integer underflow am:
ef35553d53 am:
08bd47e9a9 am:
279cc3d65e am:
972b5551f6 skipped:
ded6cb5910
Change-Id: I4a1b7a1509d00fba8e35755d2fb198c47e9f3999
Android Build Merger (Role) [Wed, 10 Oct 2018 10:26:07 +0000 (10:26 +0000)]
[automerger] [DO NOT MERGE] Fix signedness mismatch and integer underflow am:
ef35553d53 am:
08bd47e9a9 am:
279cc3d65e am:
972b5551f6
Change-Id: I878947630e3cec949dbfa361a379637a30d67a1d
Android Build Merger (Role) [Wed, 10 Oct 2018 10:26:06 +0000 (10:26 +0000)]
[automerger] [DO NOT MERGE] Fix signedness mismatch and integer underflow am:
ef35553d53 am:
08bd47e9a9 am:
279cc3d65e
Change-Id: If379e03d3998c1267bc66f53b308ea28bcd4c128
Android Build Merger (Role) [Wed, 10 Oct 2018 10:26:04 +0000 (10:26 +0000)]
[automerger] [DO NOT MERGE] Fix signedness mismatch and integer underflow am:
ef35553d53 am:
08bd47e9a9
Change-Id: Ie536c5dd8c447cd3753725040edbec7ce478ea07
Android Build Merger (Role) [Wed, 10 Oct 2018 10:26:02 +0000 (10:26 +0000)]
[automerger] [DO NOT MERGE] Fix signedness mismatch and integer underflow am:
ef35553d53
Change-Id: I094ac59296a118fbacc70b4ead1230b4d8683fa2
Rubin Xu [Tue, 9 Oct 2018 15:05:39 +0000 (16:05 +0100)]
[DO NOT MERGE] Fix signedness mismatch and integer underflow
persist_get_max_entries() is supposed to return an unsigned integer as the
maximum number of entries but it also wrongly returns "-1" as an error
condition. Also fix an issue where an unsigned subtraction in this routine
could lead to integer underflow.
Bug:
112731440
Test: manual
Change-Id: I9672e39bef2c12156dda7806a08c52044962c178
Greg Kaiser [Wed, 1 Aug 2018 20:15:19 +0000 (13:15 -0700)]
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
(
38723f23ff521e95ed295f500e6529c52a994c9f) 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
Jaegeuk Kim [Sun, 29 Jul 2018 13:56:57 +0000 (06:56 -0700)]
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>
Jeff Sharkey [Fri, 1 Jun 2018 22:57:36 +0000 (15:57 -0700)]
[automerger skipped] Merge commit '
635193ab36302e5f65e99c7df2f256cfd37068c7' into am-
b7f1a67b-2024-4274-aa7d-
e88e8cceb407 am:
9a35ab6a4f am:
f707f1bb88
am:
2b9a343319 -s ours
Change-Id: Ibdcc6722750cfe7cb394a52d21de8e73ecdfd650
Jeff Sharkey [Fri, 1 Jun 2018 22:31:32 +0000 (15:31 -0700)]
Merge commit '
635193ab36302e5f65e99c7df2f256cfd37068c7' into am-
b7f1a67b-2024-4274-aa7d-
e88e8cceb407 am:
9a35ab6a4f
am:
f707f1bb88
Change-Id: I4d9e269f34cab043a7c437781187d9a47e0fa652
Jeff Sharkey [Fri, 1 Jun 2018 22:19:33 +0000 (15:19 -0700)]
Merge commit '
635193ab36302e5f65e99c7df2f256cfd37068c7' into am-
b7f1a67b-2024-4274-aa7d-
e88e8cceb407
am:
9a35ab6a4f
Change-Id: I273dc86e0b0580bef81e272a94043b269d7df402
Jeff Sharkey [Fri, 1 Jun 2018 22:03:06 +0000 (16:03 -0600)]
Merge commit '
635193ab36302e5f65e99c7df2f256cfd37068c7' into am-
b7f1a67b-2024-4274-aa7d-
e88e8cceb407
* commit '
635193ab36302e5f65e99c7df2f256cfd37068c7':
Require quotes when searching for blkid keys.
Bug:
80436257
Test: manual
Change-Id: I4cbae2d594edefa10e5e2c5236d17fe3d37818cd
Android Build Merger (Role) [Fri, 1 Jun 2018 21:46:12 +0000 (21:46 +0000)]
[automerger] Require quotes when searching for blkid keys. am:
ee5c7318d7 am:
98bb129cd3 am:
0c5a0d65c9 am:
7e51f8d0c4 am:
53fe89bbad am:
5716ee6d7a am:
4de0e883d0 am:
a7946bf9c6
Change-Id: I831bc503b1fdcf5a6a0c31ac0ded46d301c410ef
Android Build Merger (Role) [Fri, 1 Jun 2018 21:46:11 +0000 (21:46 +0000)]
[automerger] Require quotes when searching for blkid keys. am:
ee5c7318d7 am:
98bb129cd3 am:
0c5a0d65c9 am:
7e51f8d0c4 am:
53fe89bbad am:
5716ee6d7a am:
4de0e883d0
Change-Id: I66ce047987d59d1344cd46e14e07ae0d3cb4bf9a
Android Build Merger (Role) [Fri, 1 Jun 2018 21:46:09 +0000 (21:46 +0000)]
[automerger] Require quotes when searching for blkid keys. am:
ee5c7318d7 am:
98bb129cd3 am:
0c5a0d65c9 am:
7e51f8d0c4 am:
53fe89bbad am:
5716ee6d7a
Change-Id: Icf5c0c0a0c4f4aec605182111dcedf16f5a4ab95
Android Build Merger (Role) [Fri, 1 Jun 2018 21:46:08 +0000 (21:46 +0000)]
[automerger] Require quotes when searching for blkid keys. am:
ee5c7318d7 am:
98bb129cd3 am:
0c5a0d65c9 am:
7e51f8d0c4 am:
53fe89bbad
Change-Id: I87042d7d1d7b2cf9baeb3f28fd9ab31e5f97f62a
Android Build Merger (Role) [Fri, 1 Jun 2018 21:46:06 +0000 (21:46 +0000)]
[automerger] Require quotes when searching for blkid keys. am:
ee5c7318d7 am:
98bb129cd3 am:
0c5a0d65c9 am:
7e51f8d0c4
Change-Id: I5f21e49be9c536e51dbaadde0bd53545dc8cbaae
Android Build Merger (Role) [Fri, 1 Jun 2018 21:46:05 +0000 (21:46 +0000)]
[automerger] Require quotes when searching for blkid keys. am:
ee5c7318d7 am:
98bb129cd3 am:
0c5a0d65c9
Change-Id: I585336447c06e09b499ad2656b731105f1ebc4c4
Android Build Merger (Role) [Fri, 1 Jun 2018 21:46:04 +0000 (21:46 +0000)]
[automerger] Require quotes when searching for blkid keys. am:
ee5c7318d7 am:
98bb129cd3
Change-Id: I91516dfd0a046aa2763df3c09ef6e8570d7f1b55
Android Build Merger (Role) [Fri, 1 Jun 2018 21:46:02 +0000 (21:46 +0000)]
[automerger] Require quotes when searching for blkid keys. am:
ee5c7318d7
Change-Id: If8422cf170db4e05dbe4cf6c1ed4ebf8126b0c71
Jeff Sharkey [Fri, 1 Jun 2018 17:31:39 +0000 (11:31 -0600)]
Require quotes when searching for blkid keys.
In combination with a blkid change, this prevents the parsing logic
from getting confused by key names appearing inside values. (The
blkid change suppresses any quotes that appear inside values.)
Bug:
80436257
Test: manual
Change-Id: I9480ef6eb78254b812c671950875d0b8918a27c6
Shawn Willden [Thu, 17 May 2018 21:24:56 +0000 (15:24 -0600)]
Explain the rationale for not using StrongBox in vold.
Bug:
77338527
Test: Comment-only change.
Change-Id: I9f87e34854eabcc4c183553cf56a033970bb867e
Wei Wang [Tue, 15 May 2018 23:12:20 +0000 (16:12 -0700)]
Add rc file for wait_for_keymaster
Similar to update_verifier, define higher prio and use exec_start for
this binary.
Bug:
79492334
Test: Reboot test
Change-Id: I8d3133cabcc8d4cee8bdead310f2c18d8d07e9dd
TreeHugger Robot [Fri, 11 May 2018 16:38:40 +0000 (16:38 +0000)]
Merge "Do Keymaster HMAC key agreement in vold." into pi-dev
Paul Crowley [Wed, 9 May 2018 20:01:16 +0000 (13:01 -0700)]
Fix spurious error
Bug:
79542247
Test: error no longer appears
Change-Id: I2cf91c8cd937b81041a47e4b64a882445a80eb0b
Shawn Willden [Wed, 9 May 2018 14:12:10 +0000 (08:12 -0600)]
Do Keymaster HMAC key agreement in vold.
Bug:
79307225
Test: Boot
Change-Id: I6682e86076aa568907d94024ef175dbdede86557
Paul Crowley [Wed, 7 Feb 2018 22:41:26 +0000 (14:41 -0800)]
add wait_for_keymaster
Bug:
79228237
Test: boots with patch
Change-Id: I581bcd4c4dd92c5b7be70eb351ecba20225e1eee
TreeHugger Robot [Fri, 20 Apr 2018 23:42:04 +0000 (23:42 +0000)]
Merge "vold: Idle-maint calls device GC" into pi-dev
TreeHugger Robot [Tue, 17 Apr 2018 19:16:55 +0000 (19:16 +0000)]
Merge "Exclude /mnt/vendor from vold's ownership." into pi-dev
Tri Vo [Mon, 16 Apr 2018 21:27:10 +0000 (14:27 -0700)]
Exclude /mnt/vendor from vold's ownership.
Addresses this selinux denial:
avc: denied { search } for name="vendor" dev="tmpfs" ino=11069
scontext=u:r:vold:s0 tcontext=u:object_r:mnt_vendor_file:s0 tclass=dir
permissive=0
Bug:
64905218
Test: fixes above denial.
Change-Id: I670b2148e65c7e0fcabd1e11f5bace0c4f4e18bd
Jaegeuk Kim [Tue, 13 Feb 2018 05:57:04 +0000 (21:57 -0800)]
vold: Idle-maint calls device GC
This activates device GCs in idle time.
F2FS GC = 7 mins
Trim = 1 mins
Dev GC = 2 mins
Bug:
63264275
Bug:
68721792
Change-Id: I843a742ef192ebe00d77c47a216d4200bc9ccb9d
Signed-off-by: Jaegeuk Kim <jaegeuk@google.com>
Jaegeuk Kim [Fri, 6 Apr 2018 05:43:25 +0000 (22:43 -0700)]
vold: set f2fs feature bit
Bug:
74604441
Bug:
67380979
Change-Id: Ifcb43fb4f8fbdf79e70cfa208af73073d815e254
Signed-off-by: Jaegeuk Kim <jaegeuk@google.com>
Shawn Willden [Fri, 30 Mar 2018 23:06:14 +0000 (17:06 -0600)]
Disable use of StrongBox for encryption
Until VerificationTokens are wired up, StrongBox can't work. Also,
this will reduce complications for early StrongBox testing.
Bug:
77338527
Test: Boot the device
Change-Id: I44a1577c388703aeecb2886e7db52084c17e2afd
Paul Crowley [Thu, 29 Mar 2018 20:27:23 +0000 (13:27 -0700)]
Gate use of allow_encrypt_override behind ro.crypto property
Test: use adb set-virtual-disk to create a virtual partition
Bug:
25861755
Change-Id: I6a227a083c82321c8d4d2d9188091a6f7f0451f0
Rubin Xu [Thu, 1 Mar 2018 16:48:27 +0000 (16:48 +0000)]
Remove secdiscard IPC call
No longer used by the framework, hence removing.
Bug:
62140539
Test: builds
Change-Id: I17b9818ea6121d84223a502949186cf679a83a90
Risan [Thu, 1 Mar 2018 02:19:51 +0000 (11:19 +0900)]
Remove libarcmounter dependency in Vold
Due to rerouting ArcBridge call through System Server, Vold doesn't need
to depend on ArcBridge-related C++ library anymore.
Bug:
64500663
Test: Compiled.
Change-Id: Ic93cbc8cec8496784960d5093fb7b12d43574ced
TreeHugger Robot [Sun, 25 Feb 2018 02:45:33 +0000 (02:45 +0000)]
Merge "Use unique_ptr<DIR> to safely release resources."
Jeff Sharkey [Sun, 25 Feb 2018 01:23:35 +0000 (18:23 -0700)]
Trim whitespace from sysfs values.
Test: builds, boots
Bug:
72740079
Change-Id: If364927ea762c7dee99bff5dc307e3b9b5355c2b
Jeff Sharkey [Sun, 25 Feb 2018 01:09:21 +0000 (18:09 -0700)]
Use unique_ptr<DIR> to safely release resources.
Test: builds, boots
Bug:
66995913
Change-Id: Ib580501fc979b63295b180250581dc7527de76b2
TreeHugger Robot [Fri, 23 Feb 2018 20:52:22 +0000 (20:52 +0000)]
Merge "Add ArcService AIDL in Vold"
Risan [Thu, 22 Feb 2018 23:12:37 +0000 (08:12 +0900)]
Add ArcService AIDL in Vold
This is needed to allow ARC++ Vold to interact with ArcBridgeService
through SystemServer.
Bug:
64500663
Test: Compiled, tested on device + cts in master-arc-dev (ag/
3488659)
Change-Id: I3b05b0f456ec99be9163877a2d83cdbf2bb94991
Jaegeuk Kim [Fri, 23 Feb 2018 03:39:10 +0000 (03:39 +0000)]
Merge "vold: Idle-maint issues discards fully"
Jaegeuk Kim [Sat, 17 Feb 2018 14:02:30 +0000 (06:02 -0800)]
vold: Idle-maint issues discards fully
Change-Id: Ib20a55e8761aa740b530803f029ecb36256fe9aa
Signed-off-by: Jaegeuk Kim <jaegeuk@google.com>
Greg Kaiser [Fri, 16 Feb 2018 21:35:35 +0000 (13:35 -0800)]
cryptfs: Optionally get crypto type as a property
Instead of hardcoding to "aes-cbc-essiv:sha256" with a 16 byte
key, we introduce a new property, "ro.crypto.fde_algorithm",
to allow the use of different crypto types. The only other
method we currently support is "speck128-xts-plain64" with
a 32 byte key, although new crypto types are easily added.
We intentionally derive things like the crypto name and the
keysize from the given property name. This means the code
must be changed for each new crypto type we want to support,
but that's worth it to remove the exploit vector of crypto
types with incorrect key sizes.
Due to previous refactoring CLs, this has minimal impact on
the current code other than changing what we return for
cryptfs_get_{keysize,crypto_name}.
Bug:
73079191
Test: Flashed onto a gobo device with the property set for SPECK, and confirmed via kernel debug output we were using SPECK on the device.
Change-Id: I9c9df61590344c5f62114dfbf679031b0c2ceb1f
Greg Kaiser [Fri, 16 Feb 2018 21:13:58 +0000 (13:13 -0800)]
cryptfs: Require ext disk crypt to match code
Our external partitions have no crypto header/footer, so we
only get the keysize and key. Our code has been implicitly
assuming that this keysize off of disk matches the crypto
type we have in our code (and thus matches the keysize our
code is using as well). We now make this assumption
explicit, and check for this and no longer allow external
code to pass a keysize in to cryptfs.
Bug:
73079191
Test: Compiled and tested in combination with other CLs.
Change-Id: I1a1996187e1aaad6f103982652b1bcdfd5be33ce
Greg Kaiser [Fri, 16 Feb 2018 21:01:36 +0000 (13:01 -0800)]
cryptfs: Use the crypt_mnt_ftr keysize
Our code has places where we were reading in the crypt_mnt_ftr
struct from disk, but then proceeding to use a hardcoded constant
for the keysize. We plan to allow crypto with different sized
keys in the future, so we want to just trust the keysize we get
off of disk.
While doing this, we reject any crypt_mnt_ftr we read from disk
which has a keysize in excess of MAX_KEY_LEN. This defends us
against buffer overflows in the case of corrupt disk data.
Bug:
73079191
Test: Compiled and tested in combination with other CLs.
Change-Id: Id6f192b905960e5508833e9cd3b4668d4754dc7e
Gao Xiang [Fri, 16 Feb 2018 01:42:39 +0000 (01:42 +0000)]
Merge "mFusePid should be cleared after waitpid successfully" am:
456483d193 am:
8be3be3167
am:
8fe7f3104b
Change-Id: I18199ce5f972f0a403728e34dec608a01fceb183
Gao Xiang [Fri, 16 Feb 2018 01:24:40 +0000 (01:24 +0000)]
Merge "mFusePid should be cleared after waitpid successfully" am:
456483d193
am:
8be3be3167
Change-Id: Ib55467c9719d5c578a51b0fc49b03dbc9bbe0870
Gao Xiang [Fri, 16 Feb 2018 01:04:45 +0000 (01:04 +0000)]
Merge "mFusePid should be cleared after waitpid successfully"
am:
456483d193
Change-Id: I61bf49cea396ebc8009a54740d7322249025acf0
Treehugger Robot [Thu, 15 Feb 2018 23:46:14 +0000 (23:46 +0000)]
Merge "mFusePid should be cleared after waitpid successfully"
Greg Kaiser [Thu, 15 Feb 2018 04:15:18 +0000 (20:15 -0800)]
cryptfs: Don't use bare integers for key size
Rather than use an integer and have a comment, we use a named
constant for sizing these master key buffers. This will help
avoid confusion when we switch to allowing different sized
master keys.
Bug:
73079191
Test: Build
Change-Id: Ifaffdd94d337bb2d5a178f818dfe00f9386ae03b
Greg Kaiser [Thu, 15 Feb 2018 04:05:54 +0000 (20:05 -0800)]
cryptfs: Clarify sizing of intermediate key
Some parts of the code were intermingling constants for the master
key and the intermediate key. That works at the moment because
these are the same size. But we'll be introducing logic allowing
different sized master keys, while keeping the intermediate the
same. To aid that introduction, we use separate constants for
the intermediate key.
Bug:
73079191
Test: Build
Change-Id: I22b1dbf18aff2f76229df1c898fc606d6c1af3ca
Greg Kaiser [Wed, 14 Feb 2018 19:26:12 +0000 (11:26 -0800)]
Revert "cryptfs: Don't hardcode ikey buffer size"
This reverts commit
f45a70c416e74437bfc10e7a1dab55746f3edf25.
Greg Kaiser [Wed, 14 Feb 2018 19:26:08 +0000 (11:26 -0800)]
Revert "cryptfs: Make decrypted key buffers large enough"
This reverts commit
4a35ef0a53d1f8041adc8bf49585e700bb7af803.
Greg Kaiser [Wed, 14 Feb 2018 19:26:00 +0000 (11:26 -0800)]
Revert "cryptfs: Optionally get crypt type from properties"
This reverts commit
291fec178925fe7cd724b3d345bfcfbb98d87f52.
Greg Kaiser [Sat, 10 Feb 2018 02:24:59 +0000 (18:24 -0800)]
cryptfs: Optionally get crypt type from properties
Instead of hardcoding to "aes-cbc-essiv:sha256", we introduce a
new property, "ro.crypto.crypt_type_name", to allow the use of
different crypt methods. The only other method we currently
support is "speck128-xts-plain64", although new methods are
easily added.
We intentionally derive things like the keysize from the given
crypt name, to reduce exploit vectors. We also only accept
crypt names the code has whitelisted.
The biggest impact is replacing the hard-coded KEY_LEN_BYTES.
For compile-time buffers, we use the MAX_KEY_LEN to assure they
will be big enough for any crypt type. For run-time sizing,
we use the value derived from our property.
Bug:
73079191
Test: On an encrypted gobo, booted successfully with (1) no property set, (2) proproperty set to invalid value (and confirmed we defaulted to aes), and (3) after wiping userdata, with property set to "speck128-xts-plain64", confirmed we were using SPECK.
Change-Id: Ic4e10840d6ee2a4d4df58582448e0f768e6f403f
Greg Kaiser [Sat, 10 Feb 2018 01:01:06 +0000 (17:01 -0800)]
cryptfs: Make decrypted key buffers large enough
Looking at the EVP_DecryptUpdate() documentation, we need a
buffer which isn't just the keysize, but also provides the
cipher block length minus one byte extra. For EVP_aes_128_cbc(),
that block length is 16, but we use the maximum block length to
be safe for any future cipher change.
For two of our decrypted_master_key usages, the buffer was
already sufficiently sized. But for one of our instances,
in cryptfs_enable_internal(), the buffer was previously
smaller than this. So this CL represents a possible behavior
change if we were ever overrunning that buffer.
Bug:
73079191,
73176599
Test: Flashed an encrypted sailfish and it booted.
Change-Id: Ic5043340910dc7d625e6e5baedbca5bd4b2bfb03
Greg Kaiser [Sat, 10 Feb 2018 00:11:38 +0000 (16:11 -0800)]
cryptfs: Don't hardcode ascii buffer size
We're removing hardcoded buffer sizes in anticipation of allowing
different keysizes. In this case, our buffer was sufficiently
large for all current cases. But if we ever changed the
crypt_mnt_ftr struct to allow larger keys, this code will adjust
with the change.
Bug:
73079191
Test: Flashed an encrypted sailfish and it booted.
Change-Id: I261e729a77b351e287fbb55327564fe512a23d47
Greg Kaiser [Fri, 9 Feb 2018 21:41:12 +0000 (13:41 -0800)]
cryptfs: Don't hardcode ikey buffer size
We were hardcoding the size of the ikey buffer, but then had logic
which used KEY_LEN_BYTES and IV_LEN_BYTES to offset into the array
and describe the length of its contents.
In anticipation of allowing the keysize to be set via a property,
instead of at compile time, we change this code to make the relation
between the keysize and the buffer size explicit.
Bug:
73079191
Test: Flashed an encrypted sailfish and it booted.
Change-Id: I109a5dc812662220e53163bfb4b5e51bf5abf185
Greg Kaiser [Fri, 9 Feb 2018 17:19:54 +0000 (09:19 -0800)]
cryptfs: Fix format string
Test: None
Change-Id: Id16acb4ed5e89e759b69ec2d2f2db54cc54f1959
Greg Kaiser [Fri, 9 Feb 2018 17:15:50 +0000 (09:15 -0800)]
cryptfs: Remove unused variable
We'll be allowing modifyable key sizes in the near future,
and want to remove this variable to reduce confusion with this
change.
Bug:
73079191
Test: None
Change-Id: I7047bb375553d8c46ff0724add697a5105ebc68c
Shawn Willden [Wed, 7 Feb 2018 22:06:06 +0000 (15:06 -0700)]
Prevent spurious call to keymaster abort().
During the analysis of b/
72953784 it was noticed that vold was calling
keymaster abort() and failing, though vold was succeeding with its
keymaster operation. This had nothing to do with the bug, but the
presence of the error appeared to implicate keymaster, and it's bad
form in any case. This CL correctly clears the mDevice member during
a move, so the destructor will not attempt to call abort.
Test: Build & boot
Bug:
72953784
Change-Id: Ib0700f829e87f19b089396087085585ddd6b96a5
Paul Crowley [Tue, 30 Jan 2018 17:48:19 +0000 (09:48 -0800)]
Add a mount with metadata encryption service
Don't use the FDE flow to support metadata encryption; just provide a
vold service which directly mounts the volume and use that.
Bug:
63927601
Test: Boot Taimen to SUW with and without metadata encryption.
Change-Id: Ifc6a012c02c0ea66893020ed1d0da4cba6914aed
Paul Crowley [Thu, 1 Feb 2018 17:53:27 +0000 (09:53 -0800)]
Refactor logging in EncryptInplace.cpp
Done as part of work towards metadata encryption.
Bug:
63927601
Test: Boot Taimen to SUW
Change-Id: I0f5fda0e002944ab658756c7cfcb386c3658a446
Shawn Willden [Mon, 22 Jan 2018 16:08:32 +0000 (09:08 -0700)]
Support Keymaster4
This CL changes vold from using a KM3 device directly to using the KM4
support wrapper from the KM4 support library, which supports both KM3
and KM4 devices (KM0, 1 and 2 devices are still supported as well,
because the default KM3 device is a wrapper that uses them).
In addition, I found myself getting confused about which "Keymaster"
types were locally-defined vold keymaster types and which were from
the KM4 HAL and support library, so I changd the approach to
referencing the latter, so all of them are qualified with the "km::"
namespace reference.
Test: Build & boot
Change-Id: I08ed5425641e7496f8597d5716cb3cd0cbd33a7f
Shawn Willden [Sat, 20 Jan 2018 16:37:36 +0000 (09:37 -0700)]
Clang-format Key{cpp|h} and KeyStorage.{cpp|h}
Test: Build & boot
Change-Id: I92bb107409f493770028cf6fd637d34af7644262
Andreas Huber [Mon, 22 Jan 2018 19:25:29 +0000 (11:25 -0800)]
Fingerprint data is now stored in one of two ways depending on the
shipping API version:
For devices shipped before Android P nothing changes, data
is stored under /data/system/users/<user-id>/fpdata/...
Devices shipped from now on will instead store
fingerprint data under /data/vendor_de/<user-id>/fpdata.
Support for /data/vendor_de and /data/vendor_ce has been added to vold.
Bug:
36997597
Change-Id: I615e90d1c9ab08e768a8713968fa043598a0a526
Test: manually
Risan [Mon, 22 Jan 2018 02:04:25 +0000 (11:04 +0900)]
[VOLD] Add ARC++ ObbMount shared lib
Unfortunately, static library dependency is not transitive (even if the
dependency is a shared library). So I am wrapping the libarcobbvolume's
dependency as libarcmounter shared library.
Bug:
64500663
Test: Compile
Change-Id: I12be7a9d885c7c1c043185bd134e0148d420c6fd
Jeff Sharkey [Fri, 19 Jan 2018 01:55:18 +0000 (10:55 +0900)]
Add basic exFAT support.
Several partners have been requesting exFAT support. Android doesn't
natively support exFAT, but we're at least willing to try mounting an
exFAT filesystem if we detect the Linux kernel supports it, and if
helper binaries are present.
This CL is simple scaffolding, and it provides no actual
implementation of exFAT.
Test: builds, boots
Bug:
67822822
Change-Id: Id4f8ec3967b32de6e1c0e3c4b47fe6e43a6291ab
TreeHugger Robot [Thu, 18 Jan 2018 01:39:19 +0000 (01:39 +0000)]
Merge "No double encryption on FDE+FBE SD cards"
Jeff Sharkey [Sat, 13 Jan 2018 02:12:30 +0000 (02:12 +0000)]
Merge "Add "default_normal" support to vold."
Jeff Sharkey [Fri, 12 Jan 2018 20:51:43 +0000 (20:51 +0000)]
Merge "Remove FIDTRIM." am:
35829f3968 am:
c1d81682e1
am:
bf0ab0439c -s ours
Change-Id: I9ad9f730409747a0c8b724bdb81eb93802425309
Jeff Sharkey [Fri, 12 Jan 2018 20:48:45 +0000 (20:48 +0000)]
Merge "Remove FIDTRIM." am:
35829f3968
am:
c1d81682e1
Change-Id: Ic16dc5e6347a5cfbe444401b5374c7682db551e4
Jeff Sharkey [Fri, 12 Jan 2018 20:43:37 +0000 (20:43 +0000)]
Merge "Remove FIDTRIM."
am:
35829f3968
Change-Id: I02bb4438d08a34cf0f8e41a8a7fd2123c492be38
Jeff Sharkey [Fri, 12 Jan 2018 20:20:15 +0000 (20:20 +0000)]
Merge "Remove FIDTRIM."
Jeff Sharkey [Fri, 12 Jan 2018 17:42:13 +0000 (10:42 -0700)]
Remove FIDTRIM.
Remove FIDTRIM support, which isn't meaningful on UFS-based flash
devices. Modern devices require FBE/FDE which gives us better
protection against trimmed data lingering around.
Bug:
67041047
Test: builds, boots
Change-Id: I38d7d6961edf2047592b87c74b2a0f5906fb54e2
Merged-In: I4fb194c5d5ef13f413c02acedfbaaf79c567582b
Jeff Sharkey [Tue, 9 Jan 2018 19:27:40 +0000 (19:27 +0000)]
Merge "Grant "disk_reserved" GID to critical services."
Jeff Sharkey [Tue, 9 Jan 2018 05:40:53 +0000 (05:40 +0000)]
Merge "Wire up reserved blocks presence for tests."
TreeHugger Robot [Mon, 8 Jan 2018 18:59:45 +0000 (18:59 +0000)]
Merge "Remove all references to FDE enable wipe"
Jeff Sharkey [Mon, 8 Jan 2018 18:48:07 +0000 (11:48 -0700)]
Add "default_normal" support to vold.
This new flag isolates each user on a multi-user device for security
reasons.
Test: cts-tradefed run commandAndExit cts-dev -m CtsAppSecurityHostTestCases -t android.appsecurity.cts.ExternalStorageHostTest#testSecondaryUsersInaccessible
Bug:
64672411
Change-Id: I3db8dde597a7715ca680779ac57957fb12a92f8e
Jeff Sharkey [Mon, 8 Jan 2018 17:43:00 +0000 (10:43 -0700)]
Wire up reserved blocks presence for tests.
This is how we tell CTS if the device has reserved blocks set aside
for system critical services.
Test: builds, boots
Bug:
62024591
Change-Id: I7c8ec2294b246eed54668b5717df00e72f13887a
Jeff Sharkey [Fri, 31 Mar 2017 23:19:57 +0000 (17:19 -0600)]
Grant "disk_reserved" GID to critical services.
This GID extends the ability to use reserved disk space, giving the
system a chance to be usable enough for the user to free up disk
space used by apps.
Test: builds, boots
Bug:
62024591
Change-Id: I8bc47911a71e1f399616caae83678e2914781c7e
Jeff Sharkey [Thu, 4 Jan 2018 23:46:34 +0000 (16:46 -0700)]
FBE devices now fully support adoptable storage.
We've finished all the underlying work to support adoptable storage
on FBE devices, so remove the code that was disabling it by default.
To aid debugging, support blocking move commands (so that we log
the stdout) via a system property, so we don't have to recompile
end user devices stuck in funky states.
Test: cts-tradefed run commandAndExit cts-dev -m CtsAppSecurityHostTestCases -t android.appsecurity.cts.AdoptableHostTest
Bug:
29923055,
25861755,
33252673,
37289651
Change-Id: I6b781de7e196a1a50ba543843aca0caf74c3e282
Paul Lawrence [Fri, 22 Dec 2017 18:12:06 +0000 (10:12 -0800)]
Remove all references to FDE enable wipe
Bug:
64766105
Test: FBE boots, forceencrypt boots, set pattern, reboots, encryptable
boots and can be encrypted
Change-Id: I8c6dc0acdc37c3a6f1bea28d5607ed8938a4eb0c
Elliott Hughes [Thu, 21 Dec 2017 15:55:34 +0000 (15:55 +0000)]
Merge "StartsWith now allows std::string prefixes."
TreeHugger Robot [Thu, 21 Dec 2017 00:52:38 +0000 (00:52 +0000)]
Merge "Break vold dependency on keystore utilities."
Elliott Hughes [Wed, 20 Dec 2017 20:38:47 +0000 (12:38 -0800)]
StartsWith now allows std::string prefixes.
Bug: N/A
Test: builds
Change-Id: I2e24632e95f2bf929c2c000152c5c4076d53186e
Jeff Sharkey [Fri, 15 Dec 2017 05:15:20 +0000 (22:15 -0700)]
Delay touching disks when secure keyguard showing.
We've tried our best to protect against malicious storage devices
with limited SELinux domains, but let's be even more paranoid and
refuse to look at disks inserted while a secure keyguard is
showing. We'll gladly scan them right away once the user confirms
their credentials.
Test: builds, boots, manual testing
Bug:
68054513
Change-Id: I37fd6c25bbd6631fa4ba3f84e19384d746a22498
Chih-hung Hsieh [Mon, 11 Dec 2017 23:37:26 +0000 (23:37 +0000)]
Merge "Fix warning in system/vold/tests." am:
b96ed7e6e0 am:
447f1874b4
am:
c025ce8806 -s ours
Change-Id: I64cfa78cb57b5d813c34a0eb725a7dce802c7612
Chih-hung Hsieh [Mon, 11 Dec 2017 23:31:50 +0000 (23:31 +0000)]
Merge "Fix warning in system/vold/tests." am:
b96ed7e6e0
am:
447f1874b4
Change-Id: I9e5db0fe14e7701b20c27e0c2074fb23496f59aa
Chih-hung Hsieh [Mon, 11 Dec 2017 23:28:47 +0000 (23:28 +0000)]
Merge "Fix warning in system/vold/tests."
am:
b96ed7e6e0
Change-Id: I0d8dbf26cd9769307adc0a1ce0d4d02a8bff9382
Chih-hung Hsieh [Mon, 11 Dec 2017 23:22:58 +0000 (23:22 +0000)]
Merge "Fix warning in system/vold/tests."