Commit graph

894 commits

Author SHA1 Message Date
Dan Albert
3685921261 Merge "Move vold to libc++." 2014-11-06 00:12:48 +00:00
Dan Albert
66d84da214 Move vold to libc++.
Bug: 15193147
Change-Id: Ib868f1ed8145ca5cbfdb4cd60ed0c47a6182ac62
2014-11-05 14:48:45 -08:00
Shawn Willden
b4be7416f8 Modify vold to check for hardware keymaster.
automerge: 7c49ab0

* commit '7c49ab0a0b3c1ee9b24a4b0b1a2c0a8c86acea41':
  Modify vold to check for hardware keymaster.
2014-11-05 18:03:47 +00:00
Shawn Willden
7c49ab0a0b Modify vold to check for hardware keymaster.
vold should only use hardware keymaster implementations to protect the
disk encryption key, because there's little value in using the software
implementation.  More importantly, if we allow vold to use softkeymaster
in the absence of a HW keymaster and (somehow) a HW keymaster is added
to a device, the HW version will be loaded, and will be unable to use
the softkeymaster key found in the crypto footer, forcing a factory
reset.

This CL will not break devices without HW keymaster, because
softkeymaster currently reports its keys as non-standalone (which isn't
correct).  After this CL is in, I will fix softkeymaster.

Bug: 17362157
Change-Id: I98b169e7a59ff7d44b72069b87743463ec823ea2
2014-11-04 17:58:12 +00:00
Rubin Xu
84f2515008 Merge "Make persistent field in cryptofs support longer values." into lmp-mr1-dev
automerge: 13c3a90

* commit '13c3a90b586d272b391bd0e2795717db75a4d853':
  Make persistent field in cryptofs support longer values.
2014-10-30 18:59:11 +00:00
Rubin Xu
13c3a90b58 Merge "Make persistent field in cryptofs support longer values." into lmp-mr1-dev 2014-10-29 15:41:23 +00:00
Nick Kralevich
0f1797bdd2 am 096dd2dd: am ab083da0: Merge "Set SELinux contexts on device nodes created by vold."
* commit '096dd2dd8c0294253c4b88b2c02715bf56e0287c':
2014-10-29 07:00:56 +00:00
JP Abgrall
b0328d0ae9 am 9b5a3812: cryptfs: [HACK] reboot if the crypto block dev failed to open automerge: 512f0d5
* commit '9b5a381241ff503ba05f5622927633b8527dadf5':
2014-10-29 07:00:56 +00:00
JP Abgrall
c0532efa81 am 4c9b4d8c: am 7776871d: cryptfs: extra debugging around crypto blockdev dm-... errors.
* commit '4c9b4d8c978433b4810c0449d4f376dbf7e74ab9':
2014-10-29 07:00:55 +00:00
Paul Lawrence
28d5e7bd24 am fd2180a9: am fc615041: Remove possibility of zero chars from passwords
* commit 'fd2180a97289732520328c69150419763ced48c1':
2014-10-29 07:00:55 +00:00
Paul Lawrence
3cc0f43589 am 6bcac81e: am 7639a6ab: Merge "Reset failed decryption count on successful decryptions" into lmp-dev
* commit '6bcac81e6a8db504dc32d89907f847b5a9118817':
2014-10-29 07:00:55 +00:00
Greg Hackmann
4372bf71c2 am b69a5e44: am 6e8440fd: cryptfs: kill processes with open files on tmpfs /data
* commit 'b69a5e44db9b7ecf39b9441115f3470554062157':
2014-10-29 07:00:54 +00:00
Paul Lawrence
0d638fda88 am f2eabef8: am 9c58a871: Use monotonic clock for cryptfs progress
* commit 'f2eabef83f4a32de1d0670d053a4d6bac787cd4b':
2014-10-29 07:00:54 +00:00
Greg Hackmann
5158d84fb3 am e46f7122: am 3574b085: Merge "cryptfs: log umount() failure reason" into lmp-dev
* commit 'e46f7122e002539cdfb1d83baac3652b88528455':
2014-10-29 07:00:53 +00:00
Greg Hackmann
7c33583b9e am e2a470f3: am 46a3a79a: Merge "print information about opened files when failed unmount" into lmp-dev
* commit 'e2a470f3980a824e8f5ba92fd8356336c7161463':
2014-10-29 07:00:53 +00:00
Jeff Sharkey
c6a0e5fad6 am 640aa862: am dd1a8040: Include reason when wiping data.
* commit '640aa86222c40553a2540c6cf9e840d13e750e30':
2014-10-29 07:00:52 +00:00
Paul Lawrence
f2953f4e4a am 7df812df: am 3846be17: Reduce cryptfs logspam
* commit '7df812dfaa6c82865efb0511f2da1adb601829b2':
2014-10-29 07:00:52 +00:00
Alex Klyubin
4aa1260c8d am b707d72a: am 6efa9351: Merge "Don\'t use deprecated OpenSSL functions."
* commit 'b707d72a33c8e442cafb36f724245f1c9898fb36':
2014-10-29 07:00:52 +00:00
Rubin Xu
85c01f95c7 Make persistent field in cryptofs support longer values.
Store long field values in multiple underlying fixed-length entries
and concatenate them together when reading back.

Bug: 17556485
Change-Id: I2f8033d18c208993fa1b010712be0dad5d8b646b
2014-10-24 10:56:02 +01:00
Dan Albert
460a93a6d4 Merge "Move vold to clang so ASAN_ALL works." 2014-10-21 23:09:07 +00:00
Dan Albert
5325f56921 Move vold to clang so ASAN_ALL works.
ASAN_ALL uses ASAN for anything built with clang. Since some of vold's
dependencies use clang, they will have unresolved ASAN symbols unless
vold is also built with clang. There's no harm in just moving this
project to clang.

Change-Id: Ia6f412beb7bf092121bff2a5a980531636adcdb9
2014-10-21 11:02:33 -07:00
Nick Kralevich
096dd2dd8c am ab083da0: Merge "Set SELinux contexts on device nodes created by vold."
* commit 'ab083da069a73f787a9304e155c0ab847c85377f':
  Set SELinux contexts on device nodes created by vold.
2014-10-18 23:09:09 +00:00
Nick Kralevich
098132992d am ab083da0: Merge "Set SELinux contexts on device nodes created by vold."
* commit 'ab083da069a73f787a9304e155c0ab847c85377f':
  Set SELinux contexts on device nodes created by vold.
2014-10-18 23:08:54 +00:00
Nick Kralevich
ab083da069 Merge "Set SELinux contexts on device nodes created by vold." 2014-10-18 23:02:30 +00:00
JP Abgrall
1bf371545c am ada1f929: am 512f0d52: cryptfs: [HACK] reboot if the crypto block dev failed to open
* commit 'ada1f9290fc266f5277fbed88b02faf2a4f93ff8':
  cryptfs: [HACK] reboot if the crypto block dev failed to open
2014-10-17 19:12:11 +00:00
JP Abgrall
875b5c20a9 am 0f3e09cb: resolved conflicts for merge of 7776871d to lmp-mr1-dev
* commit '0f3e09cb9c5adbdae140694e519cf9a8b241f1ba':
  cryptfs: extra debugging around crypto blockdev dm-... errors.
2014-10-17 18:59:31 +00:00
JP Abgrall
ada1f9290f am 512f0d52: cryptfs: [HACK] reboot if the crypto block dev failed to open
* commit '512f0d52ac5f85b327872e085d9fe6f02517eadf':
  cryptfs: [HACK] reboot if the crypto block dev failed to open
2014-10-17 18:50:39 +00:00
JP Abgrall
0f3e09cb9c resolved conflicts for merge of 7776871d to lmp-mr1-dev
This change was already in lmp-mr1-dev
2014-10-17 11:41:56 -07:00
JP Abgrall
9b5a381241 cryptfs: [HACK] reboot if the crypto block dev failed to open
automerge: 512f0d5

* commit '512f0d52ac5f85b327872e085d9fe6f02517eadf':
  cryptfs: [HACK] reboot if the crypto block dev failed to open
2014-10-17 00:21:22 +00:00
JP Abgrall
4c9b4d8c97 am 7776871d: cryptfs: extra debugging around crypto blockdev dm-... errors.
* commit '7776871d82050bac3e6bb307a68caef973305516':
  cryptfs: extra debugging around crypto blockdev dm-... errors.
2014-10-16 21:01:28 +00:00
JP Abgrall
512f0d52ac cryptfs: [HACK] reboot if the crypto block dev failed to open
There are cases where the /dev/block/dm-0 fails to open.
This leads to the device not completing the boot up sequence.
Currently, the only way out is to reboot.

Bug: 17898962
Change-Id: If4583ebb1ef1ebdbaf680d69b876459aaec2f4ce
(cherry picked from commit 7fc1de8a44)
2014-10-16 20:55:52 +00:00
JP Abgrall
ca42022cf0 am 7fc1de8a: cryptfs: [HACK] reboot if the crypto block dev failed to open
* commit '7fc1de8a44307d6c51826ab90f804702e08d1e6d':
  cryptfs: [HACK] reboot if the crypto block dev failed to open
2014-10-13 20:36:52 +00:00
JP Abgrall
03279172e9 am 3334c6a1: cryptfs: extra debugging around crypto blockdev dm-... errors.
* commit '3334c6a1ae38b2c7886fc9c0a69467e586af8635':
  cryptfs: extra debugging around crypto blockdev dm-... errors.
2014-10-13 19:07:27 +00:00
JP Abgrall
7fc1de8a44 cryptfs: [HACK] reboot if the crypto block dev failed to open
There are cases where the /dev/block/dm-0 fails to open.
This leads to the device not completing the boot up sequence.
Currently, the only way out is to reboot.

Bug: 17898962
Change-Id: If4583ebb1ef1ebdbaf680d69b876459aaec2f4ce
2014-10-10 18:51:24 -07:00
JP Abgrall
3334c6a1ae cryptfs: extra debugging around crypto blockdev dm-... errors.
Some times the /dev/block/dm-0 fails to open after it has been setup.
Log why.

Bug: 17576594
Bug: 17942270
Change-Id: If0bbfe22d84137f2029bacb10873832038f0d36c
2014-10-10 18:51:06 -07:00
JP Abgrall
7776871d82 cryptfs: extra debugging around crypto blockdev dm-... errors.
Some times the /dev/block/dm-0 fails to open after it has been setup.
Log why.

Bug: 17576594
Bug: 17942270
Change-Id: If0bbfe22d84137f2029bacb10873832038f0d36c
2014-10-10 15:52:11 -07:00
Paul Lawrence
2e83bfa43d am fc615041: Remove possibility of zero chars from passwords
* commit 'fc61504166d4377a1f83211c236ca11260da1261':
  Remove possibility of zero chars from passwords
2014-10-07 00:34:56 +00:00
Paul Lawrence
fd2180a972 am fc615041: Remove possibility of zero chars from passwords
* commit 'fc61504166d4377a1f83211c236ca11260da1261':
  Remove possibility of zero chars from passwords
2014-10-06 22:49:36 +00:00
Paul Lawrence
fc61504166 Remove possibility of zero chars from passwords
scrypt pads the password with zeros. Our patterns use 0 to represent
the top left dot. So patterns that end there are equivalent to ones
that end one short.

After much thought, the best solution is to change the way we
represent patterns in keyguard. This, however, is a big change.

The short term solution is to change the pattern representation in vold
so that we are storing the correct thing. Later we will change keyguard
to handle patterns correctly and remove quite a few hacks from vold
(use of hex, this code). b/17840293 created to track this.

Bug: 17751714
Change-Id: I30cdffb0f0db406d2e2b6c54d4153d120d975318
2014-10-06 14:39:31 -07:00
Paul Lawrence
4465744614 am 7639a6ab: Merge "Reset failed decryption count on successful decryptions" into lmp-dev
* commit '7639a6ab60426bbfa57c750c1ff0b4016cad0294':
  Reset failed decryption count on successful decryptions
2014-10-05 23:38:39 +00:00
Paul Lawrence
6bcac81e6a am 7639a6ab: Merge "Reset failed decryption count on successful decryptions" into lmp-dev
* commit '7639a6ab60426bbfa57c750c1ff0b4016cad0294':
  Reset failed decryption count on successful decryptions
2014-10-05 23:27:41 +00:00
Paul Lawrence
7639a6ab60 Merge "Reset failed decryption count on successful decryptions" into lmp-dev 2014-10-05 23:24:46 +00:00
Paul Lawrence
72b8b82780 Reset failed decryption count on successful decryptions
Bug: 17866359
Change-Id: I1af2ff1ac4f5243afba0cfa2f2d3a1d0b029091b
2014-10-05 22:38:04 +00:00
Greg Hackmann
72498ed5c2 am 6e8440fd: cryptfs: kill processes with open files on tmpfs /data
* commit '6e8440fd5072a673dd861ffb531fc17b4673ad90':
  cryptfs: kill processes with open files on tmpfs /data
2014-10-03 06:16:58 +00:00
Paul Lawrence
17fb62cebb am 9c58a871: Use monotonic clock for cryptfs progress
* commit '9c58a871f9fb356409d3b90734bf706d1463f041':
  Use monotonic clock for cryptfs progress
2014-10-03 06:16:57 +00:00
Greg Hackmann
b69a5e44db am 6e8440fd: cryptfs: kill processes with open files on tmpfs /data
* commit '6e8440fd5072a673dd861ffb531fc17b4673ad90':
  cryptfs: kill processes with open files on tmpfs /data
2014-10-03 03:54:44 +00:00
Greg Hackmann
6e8440fd50 cryptfs: kill processes with open files on tmpfs /data
cryptfs will fail to remount /data at boot if any processes (e.g.
dex2oat) have files open on the tmpfs /data partition.  Since these
files are about to be destroyed anyway, just kill the offending
processes: first with SIGHUP and finally with SIGKILL.

Also remove a stray i++ that effectively cut the number of retries in
half.

Bug: 17576594

Change-Id: I76fb90ce2e52846ffb9de706e52b7bde98b4186a
Signed-off-by: Greg Hackmann <ghackmann@google.com>
2014-10-02 18:05:40 -07:00
Stephen Smalley
684e662502 Set SELinux contexts on device nodes created by vold.
Extend vold to look up and set SELinux contexts on the
device nodes it creates for extra loop devices and for volumes.
Prior to this change, these device nodes simply inherited the type
of their parent directory /dev/block, i.e. block_device, and vold
therefore required create_file perms to block_device:blk_file.
With this change we can scope vold down to accessing specific
block device types.

This depends on change Id3bea28f5958086716cd3db055bea309b3b5fa5a
to allow vold to use setfscreatecon().

Change-Id: Ib9e8294abb1da94d92503947603ec12e802ff08c
Signed-off-by: Stephen Smalley <sds@tycho.nsa.gov>
2014-09-30 15:35:28 -04:00
Paul Lawrence
f2eabef83f am 9c58a871: Use monotonic clock for cryptfs progress
* commit '9c58a871f9fb356409d3b90734bf706d1463f041':
  Use monotonic clock for cryptfs progress
2014-09-30 18:19:43 +00:00
Paul Lawrence
9c58a871f9 Use monotonic clock for cryptfs progress
Otherwise we get strange results when the time changes. Worst
effect is that the encryption takes a lot longer since we are
calling the logging code far more frequently.

Bug: 17625981
Change-Id: Ice29f28b3720e9e4a1ea28e45eeab574d1959ec1
2014-09-30 09:12:51 -07:00