Commit graph

864 commits

Author SHA1 Message Date
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
Greg Hackmann
fd8d08c22a am 3574b085: Merge "cryptfs: log umount() failure reason" into lmp-dev
* commit '3574b085f46a5b22ee660a9fd3ef727a20c106ee':
  cryptfs: log umount() failure reason
2014-09-26 00:21:50 +00:00
Greg Hackmann
7103f41a17 am 46a3a79a: Merge "print information about opened files when failed unmount" into lmp-dev
* commit '46a3a79a8f6b8b8eb66b1194a1a56b0ddcd4943b':
  print information about opened files when failed unmount
2014-09-26 00:21:49 +00:00
Jeff Sharkey
714526434c am dd1a8040: Include reason when wiping data.
* commit 'dd1a8040e8449cc0e8b861a23e0339a43d80593c':
  Include reason when wiping data.
2014-09-26 00:21:49 +00:00
Greg Hackmann
e46f7122e0 am 3574b085: Merge "cryptfs: log umount() failure reason" into lmp-dev
* commit '3574b085f46a5b22ee660a9fd3ef727a20c106ee':
  cryptfs: log umount() failure reason
2014-09-24 23:35:42 +00:00
Greg Hackmann
e2a470f398 am 46a3a79a: Merge "print information about opened files when failed unmount" into lmp-dev
* commit '46a3a79a8f6b8b8eb66b1194a1a56b0ddcd4943b':
  print information about opened files when failed unmount
2014-09-24 23:35:42 +00:00
Jeff Sharkey
640aa86222 am dd1a8040: Include reason when wiping data.
* commit 'dd1a8040e8449cc0e8b861a23e0339a43d80593c':
  Include reason when wiping data.
2014-09-24 23:35:41 +00:00
Greg Hackmann
3574b085f4 Merge "cryptfs: log umount() failure reason" into lmp-dev 2014-09-24 23:32:00 +00:00
Greg Hackmann
46a3a79a8f Merge "print information about opened files when failed unmount" into lmp-dev 2014-09-24 23:31:51 +00:00
Greg Hackmann
955653ebff cryptfs: log umount() failure reason
Bug: 17576594

Change-Id: I7320aa597210896b4db6e663e1b2cb0c24d96557
Signed-off-by: Greg Hackmann <ghackmann@google.com>
2014-09-24 15:47:25 -07:00
jessica_yu
3f14fe45a3 print information about opened files when failed unmount
Change-Id: I88ae719cdae490433390d624f75612a9f4f96677

Cryptfs : Enabling support for allow_discards in dmcrypt.
Cryptfs : Password matches
Cryptfs : test_mount_encrypted_fs(): Master key saved
TrustyKeymaster: Creating device
TrustyKeymaster: Device address: 0x7f8f416100
Cryptfs : keymaster version is 3
Cryptfs : Just asked init to shut down class main
ServiceManager: service 'drm.drmManager' died
ServiceManager: service 'media.audio_flinger' died
ServiceManager: service 'media.player' died
ServiceManager: service 'media.camera' died
ServiceManager: service 'android.security.keystore' died
Cryptfs : unmounting /data failed

Bug: 17576594
2014-09-24 15:46:45 -07:00
Jeff Sharkey
dd1a8040e8 Include reason when wiping data.
This will help us track down who requested a data wipe.

Bug: 17412160
Change-Id: I5ab39a4de03c973ed151d703d6462a172ee043fd
2014-09-24 11:46:51 -07:00
Paul Lawrence
c48387ca4c am 3846be17: Reduce cryptfs logspam
* commit '3846be17feba13150a5db22204622db6a762a0d8':
  Reduce cryptfs logspam
2014-09-23 17:05:56 +00:00
Paul Lawrence
7df812dfaa am 3846be17: Reduce cryptfs logspam
* commit '3846be17feba13150a5db22204622db6a762a0d8':
  Reduce cryptfs logspam
2014-09-23 16:23:06 +00:00
Paul Lawrence
3846be17fe Reduce cryptfs logspam
Bug: 17572886
Change-Id: I91302ccc284e0f908299852650db5bf645f2ff71
2014-09-22 14:13:24 -07:00
Alex Klyubin
2f61b41e5d am 6efa9351: Merge "Don\'t use deprecated OpenSSL functions."
* commit '6efa9351a257edc53ce07eb8c544ccf08efb64ae':
  Don't use deprecated OpenSSL functions.
2014-09-19 23:17:02 +00:00
Alex Klyubin
b707d72a33 am 6efa9351: Merge "Don\'t use deprecated OpenSSL functions."
* commit '6efa9351a257edc53ce07eb8c544ccf08efb64ae':
  Don't use deprecated OpenSSL functions.
2014-09-19 23:02:26 +00:00
Alex Klyubin
6efa9351a2 Merge "Don't use deprecated OpenSSL functions." 2014-09-19 22:41:09 +00:00
Paul Lawrence
0b4b864e41 am 8e3f4510: HACK: Retry/reboot when mount reports busy.
* commit '8e3f4510a88871a2d489ca4cdf7b738d4229053d':
  HACK: Retry/reboot when mount reports busy.
2014-09-12 23:21:11 +00:00
Dan Albert
b4ef84d704 resolved conflicts for merge of 2b2a0bec to lmp-dev-plus-aosp
Change-Id: I224499833777ef80d85c1199f475f5ed1568d053
2014-09-12 13:06:50 -07:00
Dan Albert
2b2a0bec0c Merge "Remove makefile cruft." 2014-09-12 18:07:50 +00:00
Paul Lawrence
8e3f4510a8 HACK: Retry/reboot when mount reports busy.
This is a hack because we don't know why mount() reports busy.

Requires dependent change in syste/core:
  https://googleplex-android-review.git.corp.google.com/#/c/543125/

Bug: 17358530

Change-Id: I8d3078bc68f8c450adce2c3a4101b6a958f1c4a0
2014-09-12 11:06:03 -07:00
Dan Albert
b2aaf3afa1 Remove makefile cruft.
Don't manually include stlport, and don't use private bionic headers.

Change-Id: I44dd212fdd5874e625890c548e9d7bf3a9c27912
2014-09-12 10:48:12 -07:00
Paul Lawrence
9b6db0abe4 am 7e17e2d2: Don\'t worry about battery levels when encrypting
* commit '7e17e2d226783a2e065a194e60c061c255cebaae':
  Don't worry about battery levels when encrypting
2014-09-10 22:58:38 +00:00
Paul Lawrence
7e17e2d226 Don't worry about battery levels when encrypting
This is a deliberately minimalistic change. There is another
defect to remove all this code - removing some of it will (IMO)
simply confuse the issue.

Bug: 16868177
Bug: 17180951
Change-Id: I57d7a4fb3a881d62eb73419cd639a6e3ca567f91
2014-09-10 22:38:38 +00:00
Shawn Willden
1162281515 am e17a9c4a: Change cryptfs keymaster padding to ensure the high bit is never 1, to ensure the padded message is never larger than the RSA public modulus.
* commit 'e17a9c4ad3ebb4051853a4860b18973e1a01ce11':
  Change cryptfs keymaster padding to ensure the high bit is never 1, to ensure the padded message is never larger than the RSA public modulus.
2014-09-09 16:34:09 +00:00
Shawn Willden
e17a9c4ad3 Change cryptfs keymaster padding to ensure the high bit is never 1,
to ensure the padded message is never larger than the RSA public
modulus.

Bug: 17358530

Change-Id: I4dc488399c4ecfa2d24cacb839a9087e65475947
2014-09-09 16:11:35 +00:00
Paul Lawrence
455a04f76c am b2f682bd: Fix Shamus bricked by encryption upgrade
* commit 'b2f682bda8443fb93ab67f19be84fd80d5ed2838':
  Fix Shamus bricked by encryption upgrade
2014-09-08 20:21:04 +00:00
Paul Lawrence
b2f682bda8 Fix Shamus bricked by encryption upgrade
Bug: 17358530
Change-Id: I95207b62131224a2ed7ae3b75621a09acd69ea79
2014-09-08 12:52:26 -07:00
Shawn Willden
6e164ea4a1 am 47ba10d6: Pad object to proper size before signing.
* commit '47ba10d6d53e0d2e54453fe62324afdfa8d6c78a':
  Pad object to proper size before signing.
2014-09-05 23:44:02 +00:00
Adam Langley
889c4f1e36 Don't use deprecated OpenSSL functions.
This change simply switches from the deprecated
EVP_{En|De}crypt{Init|Final} to the newer, _ex versions of the same.

There is no difference in behaviour, save for calling
EVP_CIPHER_CTX_init, as the deprecated versions are just wrappers around
the _ex functions. See
https://git.openssl.org/gitweb/?p=openssl.git;a=blob;f=crypto/evp/evp_enc.c;h=f705967a40ab92cdf3c2ba8dd6bc19680d6157d6;hb=HEAD#l274

This change is required for the transition to BoringSSL, which removes
the deprecated functions.

Bug: 17409664
Change-Id: I35c6cc2d86d0c876a9edaff1e5571170fe393d87
Signed-off-by: Adam Langley <agl@google.com>
2014-09-05 15:54:51 -07:00