Commit graph

2269 commits

Author SHA1 Message Date
Greg Kaiser
1452b27d4e 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
2018-02-09 16:11:38 -08:00
Greg Kaiser
f45a70c416 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
2018-02-09 15:01:13 -08:00
Greg Kaiser
b610e77fd2 cryptfs: Fix format string
Test: None
Change-Id: Id16acb4ed5e89e759b69ec2d2f2db54cc54f1959
2018-02-09 14:02:28 -08:00
Greg Kaiser
026072f81b 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
2018-02-09 14:02:28 -08:00
Shawn Willden
3e02df8d3c 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
2018-02-07 15:07:04 -07:00
Paul Crowley
0fd2626fc3 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
2018-02-01 10:08:17 -08:00
Paul Crowley
772cc85d71 Refactor logging in EncryptInplace.cpp
Done as part of work towards metadata encryption.

Bug: 63927601
Test: Boot Taimen to SUW

Change-Id: I0f5fda0e002944ab658756c7cfcb386c3658a446
2018-02-01 09:53:27 -08:00
Shawn Willden
353518194e 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
2018-01-25 20:14:42 -07:00
Shawn Willden
785365b2f7 Clang-format Keymaster.{cpp|h} and KeyStorage.{cpp|h}
Test: Build & boot
Change-Id: I92bb107409f493770028cf6fd637d34af7644262
2018-01-25 20:09:46 -07:00
Andreas Huber
71cd43f434 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
2018-01-23 14:34:55 -08:00
Risan
9929e7db32 [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
2018-01-22 11:04:25 +09:00
Jeff Sharkey
37ba125205 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
2018-01-19 11:58:43 +09:00
TreeHugger Robot
a8b6225578 Merge "No double encryption on FDE+FBE SD cards" 2018-01-18 01:39:19 +00:00
Jeff Sharkey
856f7cf20e Merge "Add "default_normal" support to vold." 2018-01-13 02:12:30 +00:00
Jeff Sharkey
a9b0e2af22 Merge "Remove FIDTRIM." am: 35829f3968 am: c1d81682e1
am: bf0ab0439c  -s ours

Change-Id: I9ad9f730409747a0c8b724bdb81eb93802425309
2018-01-12 20:51:43 +00:00
Jeff Sharkey
bf0ab0439c Merge "Remove FIDTRIM." am: 35829f3968
am: c1d81682e1

Change-Id: Ic16dc5e6347a5cfbe444401b5374c7682db551e4
2018-01-12 20:48:45 +00:00
Jeff Sharkey
c1d81682e1 Merge "Remove FIDTRIM."
am: 35829f3968

Change-Id: I02bb4438d08a34cf0f8e41a8a7fd2123c492be38
2018-01-12 20:43:37 +00:00
Jeff Sharkey
35829f3968 Merge "Remove FIDTRIM." 2018-01-12 20:20:15 +00:00
Jeff Sharkey
9b73845fe8 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
2018-01-12 10:43:23 -07:00
Jeff Sharkey
f70cc79eb1 Merge "Grant "disk_reserved" GID to critical services." 2018-01-09 19:27:40 +00:00
Jeff Sharkey
36dd229675 Merge "Wire up reserved blocks presence for tests." 2018-01-09 05:40:53 +00:00
TreeHugger Robot
3b85797000 Merge "Remove all references to FDE enable wipe" 2018-01-08 18:59:45 +00:00
Jeff Sharkey
d7e5176043 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
2018-01-08 11:48:13 -07:00
Jeff Sharkey
53d5d7ca8a 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
2018-01-08 10:43:16 -07:00
Jeff Sharkey
570b2864ee 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
2018-01-07 19:30:19 -07:00
Jeff Sharkey
8c24ae7c47 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
2018-01-04 18:52:07 -07:00
Paul Lawrence
7ee87cfcbe 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
2017-12-22 11:17:15 -08:00
Elliott Hughes
91f1886e14 Merge "StartsWith now allows std::string prefixes." 2017-12-21 15:55:34 +00:00
TreeHugger Robot
24224d10d0 Merge "Break vold dependency on keystore utilities." 2017-12-21 00:52:38 +00:00
Elliott Hughes
32a5b9aed3 StartsWith now allows std::string prefixes.
Bug: N/A
Test: builds
Change-Id: I2e24632e95f2bf929c2c000152c5c4076d53186e
2017-12-20 12:38:47 -08:00
Jeff Sharkey
401b260351 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
2017-12-15 13:44:55 -07:00
Chih-hung Hsieh
0667b7e7dd Merge "Fix warning in system/vold/tests." am: b96ed7e6e0 am: 447f1874b4
am: c025ce8806  -s ours

Change-Id: I64cfa78cb57b5d813c34a0eb725a7dce802c7612
2017-12-11 23:37:26 +00:00
Chih-hung Hsieh
c025ce8806 Merge "Fix warning in system/vold/tests." am: b96ed7e6e0
am: 447f1874b4

Change-Id: I9e5db0fe14e7701b20c27e0c2074fb23496f59aa
2017-12-11 23:31:50 +00:00
Chih-hung Hsieh
447f1874b4 Merge "Fix warning in system/vold/tests."
am: b96ed7e6e0

Change-Id: I0d8dbf26cd9769307adc0a1ce0d4d02a8bff9382
2017-12-11 23:28:47 +00:00
Chih-hung Hsieh
b96ed7e6e0 Merge "Fix warning in system/vold/tests." 2017-12-11 23:22:58 +00:00
Xin Li
e3e2c74604 Merge "DO NOT MERGE: Merge Oreo MR1 into master" am: 56b0e8c1df -s ours am: d0271a642a
am: 54018cc991  -s ours

Change-Id: Ic4cf2efd7603cb01d9bf11be0b0245a8b46a2ac3
2017-12-08 04:27:44 +00:00
Chih-Hung Hsieh
a827f55629 Fix warning in system/vold/tests.
* Comment out unused function.

Bug: 66996870
Test: build with WITH_TIDY=1
Change-Id: I18db09be2ff8ef27f822876a6832ca5f08ce939f
Merged-In: I7a23573af0d664a5f39f1cde3a22ac0001dac1ac
2017-12-07 14:18:34 -08:00
Xin Li
43dd997761 DO NOT MERGE: Merge Oreo MR1 into master am: 1843c887d4 -s ours am: 00a2c10b44
am: 81daada217  -s ours

Change-Id: I157feb353c48566849a001630ed505dc5911addd
2017-12-07 22:05:05 +00:00
Xin Li
54018cc991 Merge "DO NOT MERGE: Merge Oreo MR1 into master" am: 56b0e8c1df -s ours
am: d0271a642a

Change-Id: Ie7f861c8ba9eca256bfdd1546a3a67ae943cea4d
2017-12-07 19:40:44 +00:00
Xin Li
d0271a642a Merge "DO NOT MERGE: Merge Oreo MR1 into master"
am: 56b0e8c1df  -s ours

Change-Id: I632ac4d7b22928b78579ccd6e99a17c516f18809
2017-12-07 19:37:04 +00:00
Xin Li
81daada217 DO NOT MERGE: Merge Oreo MR1 into master am: 1843c887d4 -s ours
am: 00a2c10b44

Change-Id: I5d524667113fd31b78c2932d919d1c23b62caa5b
2017-12-07 07:26:09 +00:00
Xin Li
00a2c10b44 DO NOT MERGE: Merge Oreo MR1 into master
am: 1843c887d4  -s ours

Change-Id: Ie3ef381ae67fa4e1761ff96e91fef55a959215d4
2017-12-07 04:53:08 +00:00
Gao Xiang
9aec7a2fb6 mFusePid should be cleared after waitpid successfully
When waitpid is successful, we need to reset mFusePid
since mFusePid will be killed again unnecessarily
in doUnmount() if we don't reset mFusePid.

As a result, it will kill another unrelated process
in the case of pids wrap around.

Test: reboot
Fixes: 1d79d10 ("Check if sdcard daemon exited.")

Change-Id: Icb422d5c81621f9f6b9f4b1218e94b1d89172763
Signed-off-by: Gao Xiang <gaoxiang25@huawei.com>
2017-12-07 11:37:19 +08:00
Xin Li
56b0e8c1df Merge "DO NOT MERGE: Merge Oreo MR1 into master" 2017-12-06 23:18:28 +00:00
Xin Li
1843c887d4 DO NOT MERGE: Merge Oreo MR1 into master
Exempt-From-Owner-Approval: Changes already landed internally
Change-Id: Ic7e2e2d1ef7bf17a9c81ea30d759fd9fe0a218c7
2017-12-06 14:24:58 -08:00
Paul Crowley
5afbc6276d No double encryption on FDE+FBE SD cards
On FBE systems, adoptable storage uses both file-based encryption (for
per-user protection) and full disk encryption (for metadata
protection). For performance/battery reasons, we don't want to encrypt
the same data twice; to that end, ensure that the
allow_encrypt_override flag is sent to dm_crypt.

Bug: 25861755
Test: see ag/3247969
Change-Id: Ib0c5891ab2d2ee9007e27a50254d29fc867d7bc5
2017-12-04 14:42:10 -08:00
Colin Cross
b8efb47a7c Merge "Export AIDL files as a filegroup for framework.jar" 2017-12-02 23:20:42 +00:00
Risan
aedae617fe [Vold] Conditional dependency to ARC++ ObbVolume
Test: Compile

Change-Id: Ic6348f7816b28302d45c05a359548a5d034fde24
Bug: 64500663
2017-11-30 04:24:41 +00:00
Colin Cross
a838863d77 Export AIDL files as a filegroup for framework.jar
Put AIDL files into a filegroup so they can be imported as sources
for framework.jar.

Bug: 69917341
Test: m checkbuild
Change-Id: I22e765ccf88832b1b192b42b2161898d9a6e5b2c
2017-11-29 19:07:22 +00:00
Pierre-Hugues Husson
130a994f4f Merge "Workaround perdev_minors path change in Linux" am: d3870c5167 am: 5687befd86
am: 77e194d0b9

Change-Id: If0c043e387629312121dc7d4556c112dc5800201
2017-11-28 19:19:36 +00:00