Commit graph

166 commits

Author SHA1 Message Date
The Android Automerger
9496945d0d am 4e00f1fa: Merge remote branch \'goog/honeycomb-mr2\' into honeycomb-LTE
* commit '4e00f1fa4d4e82bba4afe1c2a21bf0a56b3a4c8f':
  DO NOT MERGE Only create android_secure mountpoint on the primary external storage volume.
  DO NOT MERGE Mount secondary external storage writable by AID_MEDIA_RW rather than AID_SDCARD_RW
2011-05-09 10:40:33 -07:00
The Android Automerger
4e00f1fa4d Merge remote branch 'goog/honeycomb-mr2' into honeycomb-LTE 2011-05-08 22:45:47 -07:00
Mike Lockwood
c13e0967de am 745ddcb2: DO NOT MERGE Only create android_secure mountpoint on the primary external storage volume.
* commit '745ddcb2a6247817dde0790be4c74a81e7b324d4':
  DO NOT MERGE Only create android_secure mountpoint on the primary external storage volume.
2011-05-04 08:53:26 -07:00
Mike Lockwood
7877388b6c am f4cd1c6b: DO NOT MERGE Mount secondary external storage writable by AID_MEDIA_RW rather than AID_SDCARD_RW
* commit 'f4cd1c6b1912d2481334152f7dec50067960a90c':
  DO NOT MERGE Mount secondary external storage writable by AID_MEDIA_RW rather than AID_SDCARD_RW
2011-05-04 08:53:25 -07:00
Mike Lockwood
745ddcb2a6 DO NOT MERGE Only create android_secure mountpoint on the primary external storage volume.
Change-Id: If2532ce8ca7d584f2442d830450313198234bd23
Signed-off-by: Mike Lockwood <lockwood@android.com>
2011-05-04 09:42:26 -04:00
Mike Lockwood
f4cd1c6b19 DO NOT MERGE Mount secondary external storage writable by AID_MEDIA_RW rather than AID_SDCARD_RW
Change-Id: Id9a6fa6705cf97b94d419e85b5d74413e79fc748
Signed-off-by: Mike Lockwood <lockwood@android.com>
2011-05-04 09:42:23 -04:00
Mike Lockwood
3bcc2410f5 DO NOT MERGE Only create android_secure mountpoint on the primary external storage volume.
Change-Id: If21d134e7d8333b8214603a2d43a3153ab8760cc
Signed-off-by: Mike Lockwood <lockwood@android.com>
2011-05-03 20:49:16 -04:00
Mike Lockwood
11a3922ec6 DO NOT MERGE Mount secondary external storage writable by AID_MEDIA_RW rather than AID_SDCARD_RW
Change-Id: Id65f76eacaec1787aa557f96447c5bc19b7b127f
Signed-off-by: Mike Lockwood <lockwood@android.com>
2011-05-03 20:49:13 -04:00
Conley Owens
3368f16757 am 9cb6e501: Ignore change "Set SO_PASSCRED on the uevent socket." in favor of change in internal tree.
* commit '9cb6e501f17ec2a511d942c833ea51a53bcd7249':
  Set SO_PASSCRED on the uevent socket. (needed for change I393c21da)
2011-04-26 16:05:29 -07:00
Conley Owens
9cb6e501f1 Ignore change "Set SO_PASSCRED on the uevent socket." in favor of change
in internal tree.

Change-Id: Ibdf7cf1e1d0ba177d9de813baa6481ddd31d5d9c
2011-04-26 15:59:01 -07:00
Conley Owens
c840b382c5 Merge "Set SO_PASSCRED on the uevent socket. (needed for change I393c21da)" 2011-04-26 15:36:04 -07:00
Vernon Tang
5f6ae96bab Set SO_PASSCRED on the uevent socket. (needed for change I393c21da)
Change-Id: I09a8a6d7c654869a40339adce181e6b981f10369
2011-04-25 13:41:20 +10:00
Nick Kralevich
b510cd4e8a am 77992e71: vold: Enable the SO_PASSCRED socket option
* commit '77992e713ceac377ed226b555685f99fcfeb2c14':
  vold: Enable the SO_PASSCRED socket option
2011-04-19 15:36:16 -07:00
Nick Kralevich
77992e713c vold: Enable the SO_PASSCRED socket option
Ensure that sender credentials are available when we
receive a netlink message.

This is a manual cherry-pick of
c51920c824

Change-Id: I98aff8733449617d35d20bff2fe77e9d3f22f57e
2011-04-19 12:20:00 -07:00
Nick Kralevich
46770e6ea0 am b9aa1459: am c51920c8: vold: Enable the SO_PASSCRED socket option
* commit 'b9aa145910e22ed97cb51545bf399e6289bca643':
  vold: Enable the SO_PASSCRED socket option
2011-04-19 10:26:07 -07:00
Nick Kralevich
b9aa145910 am c51920c8: vold: Enable the SO_PASSCRED socket option
* commit 'c51920c82463b240e2be0430849837d6fdc5352e':
  vold: Enable the SO_PASSCRED socket option
2011-04-18 16:31:25 -07:00
Nick Kralevich
c51920c824 vold: Enable the SO_PASSCRED socket option
Ensure that sender credentials are available when we
receive a netlink message.

Change-Id: I48411205a8fbc1ebd29834f64028662d80f15995
2011-04-18 15:51:19 -07:00
Nick Kralevich
19df18af24 am aecf0e2a: am f3d3ce5e: add bounds checking for mPartMinors[]
* commit 'aecf0e2a3dd1a72e448d9df7ed69533578dda12c':
  add bounds checking for mPartMinors[]
2011-04-18 11:59:07 -07:00
Nick Kralevich
aecf0e2a3d am f3d3ce5e: add bounds checking for mPartMinors[]
* commit 'f3d3ce5e53ab7928f4c292c183c417a1bd051151':
  add bounds checking for mPartMinors[]
2011-04-18 11:44:57 -07:00
Nick Kralevich
f3d3ce5e53 add bounds checking for mPartMinors[]
Change-Id: I6d5b26756c8434d6396f3535252608ce61eabfd8
2011-04-18 11:16:13 -07:00
Ken Sumrall
ad2ac33460 Load persistent properties after mounting an encrypted /data partition.
Fix for bug 3415286.  Trigger an action in init.rc to load the persistent
properties after /data has been decrypted and mounted.

Change-Id: I5fe3b481bcc6963113e830728c204b22ffc3b722
2011-03-09 17:34:55 -08:00
Ken Sumrall
c290eaf685 Teach vold to use the new android_reboot() function.
The new android_reboot() function is a nicer way to reboot.
It can optionally sync(2) and remount as read-only writable
filesystems.  This fixes bug 3350709.

Change-Id: I4618bd5e8cccdce08494a7ca3f40ef72b2875e68
2011-03-09 17:34:44 -08:00
Ken Sumrall
cd235da6fb Enable detection of failed encryption process, for bug 3384231.
Need to detect if the encryption process didn't finish successfully, and if
so, provide a way for the UI to detect that and give the user an option to
wipe the system clean.  Otherwise, the user is stuck in a reboot loop, and
they will need to do magic button presses to enter recovery and wipe the
device to get out of it.

Change-Id: I58253e1e523ee42bdd1a59aa7d8a9d20071bd18b
2011-02-15 14:53:36 -08:00
Kenny Root
352d3f9a09 am 18ed5640: Merge "Use LOOP_GET_STATUS64 for checking loop devices" into honeycomb
* commit '18ed56400bb6ae999712ba70af385100d0cd6e55':
  Use LOOP_GET_STATUS64 for checking loop devices
2011-02-01 23:38:11 -08:00
Kenny Root
18ed56400b Merge "Use LOOP_GET_STATUS64 for checking loop devices" into honeycomb 2011-02-01 23:33:44 -08:00
Ken Sumrall
06c6baf3af am 7f7dbaa2: Improve detection of incomplete encryption
* commit '7f7dbaa2784c10fd2989fb303e5edfb8136d53dc':
  Improve detection of incomplete encryption
2011-02-01 16:32:45 -08:00
Kenny Root
7c16502dbc Use LOOP_GET_STATUS64 for checking loop devices
To determine whether a loop device was available, we use an ioctl call
to LOOP_GET_STATUS, but this fails on devices with large storage
partitions with errno = EOVERFLOW. Instead use LOOP_GET_STATUS64 which
succeeds.

Bug: 3412121
Change-Id: Ica3cb48885d3555f2d27073c00e31fc51a08c730
2011-02-01 16:01:05 -08:00
Ken Sumrall
7f7dbaa278 Improve detection of incomplete encryption
Bug 3384231 is punted to MR1, but the code to set the flag is already
in the tree, so this CL does 3 things:

1.  Comments out the lines that set the flag
2.  Removes the change to the checkpw that was added in the last change.
3.  Implements a new command to check the flag (which no one is calling
    yet and the flag won't be set anyhow).

When MR1 comes, it will be a simple matter to enable the flag setting
code and start testing it.

The fear is a false positive detection of incomplete encryption could
cause people to be prompted to wipe their data when MR1 comes out and
the flag is checked.  Not setting this for first release, and testing
this more before MR1, will give us confidence that the code will not
detect false positives of encryption failure.

Change-Id: I6dfba11646e291fe5867e8375b71a53c815f3968
2011-02-01 15:46:41 -08:00
Ken Sumrall
71fac1e011 am d33d417e: Detect when encryption failed to complete
* commit 'd33d417e3a057fffad22c23f5f002177531db2a5':
  Detect when encryption failed to complete
2011-02-01 13:27:36 -08:00
Ken Sumrall
d33d417e3a Detect when encryption failed to complete
For the case there encryption failes to complete because of a kernel
crash or the user power cycling the device, define a flag in the
crypto footer that says encryption is in progress.  Set it when starting
the actual encryption, and clear it when it successfully completes.

When the user is asked for the disk password, if the flag is set,
return a special error to the caller so the UI can know to tell the
user there is no valid data on the disk, and present a button to
wipe and reset the device.

Change-Id: I3723ec77f33437d94b3ac9ad5db0a5c950d11648
2011-02-01 00:49:13 -08:00
Ken Sumrall
3f0c0a28f3 am 5d4c68e4: Have vold grab a partial wakelock when encrypting
* commit '5d4c68e40700424b65a4331be75620706a0dd49c':
  Have vold grab a partial wakelock when encrypting
2011-01-30 19:44:27 -08:00
Ken Sumrall
5d4c68e407 Have vold grab a partial wakelock when encrypting
The Progress bar UI grabs a full wakelock when encrypting, but we've seen
a case where it looks like the progress bar UI crashes, and the wakelock is
lost, and then all hell breaks loose.  The enablecrypto command has a lot of
work to do, and it will take some time, so it should grab a wakelock to
ensure it can finish without being interrupted and put to sleep.

It grabs a partial wake lock, as it doesn't need the screen to be on to do
its work.  If the UI wants to keep it on, it should also grab a full wakelock,
which it does.  If the UI crashes, the screen may turn off, but the encryption
will keep going, and vold will reboot the device when it's done.

Change-Id: I51d3a72b8c77383044a3facb1604c1ee510733ae
2011-01-30 19:10:07 -08:00
Ken Sumrall
7cb0f59b20 am 3f476690: Merge "Don\'t try to encrypt in place a filesystem that is too large and return proper errors" into honeycomb
* commit '3f476690eaef3b824255813ed335284ef9a90e91':
  Don't try to encrypt in place a filesystem that is too large and return proper errors
2011-01-29 20:50:03 -08:00
Ken Sumrall
3f476690ea Merge "Don't try to encrypt in place a filesystem that is too large and return proper errors" into honeycomb 2011-01-29 20:45:31 -08:00
Jason parks
939ec42d3c am 70a4b3fd: Change cryptfs changepw to only require a new password.
* commit '70a4b3fd7a84a84bbe6e9d6d4ca3ee2098259fd9':
  Change cryptfs changepw to only require a new password.
2011-01-29 12:06:28 -08:00
Ken Sumrall
3ed8236de1 Don't try to encrypt in place a filesystem that is too large and return proper errors
If the already existing filesystem encompasses the entire /data partition
and does not leave the last 16 Kbytes for the crypto footer, refuse to
do encrypt in place and return an error.  This is only an issue for folks
with early development systems trying to encrypt an old /data.  This should
not be seen in released devices.

Also, if there is an error, try to report back to the UI what the error was
so it can deal with it.

Change-Id: If66781a4fe03034c96c3dd12075240deb8663db0
2011-01-29 00:48:30 -08:00
Jason parks
70a4b3fd7a Change cryptfs changepw to only require a new password.
The master key is now stored unhashed in memory. This
is needed because certain operation like remote reseting
of passwords the old password is not avaliable.
The changepw interface has been changed to only take
the new password as the only argument. When this is
called we reencrypt the master key with the new password
and old salt.

Bug: 3382129
Change-Id: I9a596b89013194605d6d7790067691aa0dc75e72
2011-01-28 10:17:44 -06:00
Jason parks
bc281ee931 am 0167cb15: Always return success if the command was run.
* commit '0167cb15935592deea9abbd6a8bbe904e27bd101':
  Always return success if the command was run.
2011-01-21 12:39:35 -08:00
Jason parks
0167cb1593 Always return success if the command was run.
The caller will check the result code for success. This prevents a exception from being thrown when the result code needs to be propagated to the caller.

Change-Id: I471e8d6eb6f339c6f4e40f47adf60d20f6a70974
2011-01-21 14:00:43 -06:00
Ken Sumrall
2137c849a0 am e8744070: Create and use a salt when calling pbkdf2 to encrypt/decrypt the master key.
* commit 'e87440703663f5ee326326f6438f3b00ea315623':
  Create and use a salt when calling pbkdf2 to encrypt/decrypt the master key.
2011-01-19 03:48:12 -08:00
Ken Sumrall
e113373708 am 0cc16638: Verify that it\'s OK to run the various cryptfs commands
* commit '0cc166385a7e1d3026bbcb62f094e419f779e872':
  Verify that it's OK to run the various cryptfs commands
2011-01-18 22:03:31 -08:00
Ken Sumrall
e874407036 Create and use a salt when calling pbkdf2 to encrypt/decrypt the master key.
In order to prevent rainbow table attacks on decrypting the master key,
create a 16 byte "salt" by reading /dev/urandom.  This is done right after
reading urandom to get the master key for the filesystem.  The salt is
stored 32 bytes after the end of the key (a padding added to help prevent
accidental overwriting of the salt) and the salt is fixed at 16 bytes long.

This change will make existing encrypted filesystems unusable.

Change-Id: I420549d064c61d38aea78eef4d86c88acb265ca3
2011-01-18 22:01:55 -08:00
Ken Sumrall
694bc70d42 am 7df84120: Don\'t wait for the framework to come up before starting to encrypt in place.
* commit '7df84120b25dca713f623528801385b00208c2aa':
  Don't wait for the framework to come up before starting to encrypt in place.
2011-01-18 21:53:23 -08:00
Ken Sumrall
0cc166385a Verify that it's OK to run the various cryptfs commands
Maintain and query some internal state to know if it's OK to run
the various cryptfs commands.  Do not allow enablecrypto to run if
the device is already encrypted.  Do no allow restart to run if
we have already run it before or if the password has not been
validated.  Do not allow checkpw to run if not encrypted, or it
has already validated the password.

This is an extra layer of safety on top of the checks up in the
UI code agains possible DoS attacks on the device.

Change-Id: I9afc8d42773020e82a512e6b637feede101d1362
2011-01-18 20:32:26 -08:00
Ken Sumrall
7df84120b2 Don't wait for the framework to come up before starting to encrypt in place.
Also, change the value that triggers the progress bar framework from
"startup" to "0" in the property vold.encrypt_progress.

Change-Id: I3890e66a95283ce2ceeca82f516859b083919b9e
2011-01-18 14:04:08 -08:00
Ken Sumrall
e23667fa00 am 57b63e61: Minor tweaks to logging for the cryptfs changepw command.
* commit '57b63e61cb41e377708a4fdf18ecc80eb1b2b521':
  Minor tweaks to logging for the cryptfs changepw command.
2011-01-18 08:47:29 -08:00
Ken Sumrall
57b63e61cb Minor tweaks to logging for the cryptfs changepw command.
Change-Id: I87ff9788a56de6d461002407bf6c3cd4c6f900ee
2011-01-17 18:29:19 -08:00
Ken Sumrall
934dfed05d am 8ddbe40a: Updates to cryptfs framework.
* commit '8ddbe40a8a8708dac7c472fa8c098c8f7b24534c':
  Updates to cryptfs framework.
2011-01-17 15:32:50 -08:00
Ken Sumrall
8ddbe40a8a Updates to cryptfs framework.
Update the enable inplace API to allow the UI to show a progress bar.
Add new command changepw (whichis currently not working)
Internal restructuring of code to support these two features.
Some minor cleanup of the code as well.

Change-Id: I11461fc9ce66965bea6cd0b6bb2ff48bcf607b97
2011-01-17 15:26:29 -08:00
Ken Sumrall
3b3b89e07c am 6864b7ec: Change the cryptfs command to separate out checking the password and restarting
* commit '6864b7ec94a57b73c300457955d86dc604aeddf5':
  Change the cryptfs command to separate out checking the password and restarting
2011-01-17 14:45:11 -08:00