OSDN Git Service

android-x86/system-vold.git
9 years agoMerge "Fixed type mismatch for ioctl(BLKGETSIZE)"
Elliott Hughes [Mon, 30 Mar 2015 21:03:04 +0000 (21:03 +0000)]
Merge "Fixed type mismatch for ioctl(BLKGETSIZE)"

9 years agoFixed type mismatch for ioctl(BLKGETSIZE)
Hiroaki Miyazawa [Wed, 4 Feb 2015 04:29:15 +0000 (13:29 +0900)]
Fixed type mismatch for ioctl(BLKGETSIZE)

ioctl(BLKGETSIZE) expects unsigned long
(8 bytes on 64 bit environment).

This is fixing fails in android.os.storage.StorageManagerIntegrationTest
(in FrameworkCoreTests).

To verify, install FrameworksCoreTests.apk and do:

adb shell am instrument -r -w -e class android.os.storage.\
StorageManagerIntegrationTest#testMountSingleEncryptedObb \
com.android.frameworks.coretests/android.test.InstrumentationTestRunner

Change-Id: Ib6d5c7490c02521c93f107c35ad0aac49f6a3f1a

9 years agoMerge "Adding e4crypt support"
Paul Lawrence [Fri, 27 Mar 2015 20:46:05 +0000 (20:46 +0000)]
Merge "Adding e4crypt support"

9 years agoAdding e4crypt support
Paul Lawrence [Thu, 5 Mar 2015 17:46:23 +0000 (09:46 -0800)]
Adding e4crypt support

Redirect all crypto calls to e4crypt equivalents if file level encryption
detected. Note this change implements only the ones needed for minimal
functionality.

Requires matching change:
  https://googleplex-android-review.git.corp.google.com/#/c/642778/

Change-Id: I622d1a91704de4b3ab655486e6d38cd6718e6016

9 years agoam 3393bb65: Merge "fstrim.c: use open(O_DIRECTORY) instead of stat"
Nick Kralevich [Thu, 5 Mar 2015 21:03:15 +0000 (21:03 +0000)]
am 3393bb65: Merge "fstrim.c: use open(O_DIRECTORY) instead of stat"

* commit '3393bb650fd931e494a0280fc13717f36aea22fc':
  fstrim.c: use open(O_DIRECTORY) instead of stat

9 years agoMerge "fstrim.c: use open(O_DIRECTORY) instead of stat"
Nick Kralevich [Thu, 5 Mar 2015 20:57:54 +0000 (20:57 +0000)]
Merge "fstrim.c: use open(O_DIRECTORY) instead of stat"

9 years agofstrim.c: use open(O_DIRECTORY) instead of stat
Nick Kralevich [Thu, 5 Mar 2015 20:50:23 +0000 (12:50 -0800)]
fstrim.c: use open(O_DIRECTORY) instead of stat

open(O_DIRECTORY) returns an error if the open attempt
is against anything other than a directory. This basically
duplicates the check that the stat() call was trying to do.
Eliminate the unnecessary stat() call and use O_DIRECTORY
instead.

Change-Id: I1821abbed325f29a7214fdc41ed27cd9e26817d0

9 years agoam 5054f7ee: Merge "Rename keymaster_device_t to keymaster0_device_t."
Shawn Willden [Thu, 26 Feb 2015 23:31:10 +0000 (23:31 +0000)]
am 5054f7ee: Merge "Rename keymaster_device_t to keymaster0_device_t."

* commit '5054f7ee4fa6e747eb8d08f60ec91ba6a9363878':
  Rename keymaster_device_t to keymaster0_device_t.

9 years agoMerge "Rename keymaster_device_t to keymaster0_device_t."
Shawn Willden [Thu, 26 Feb 2015 23:24:53 +0000 (23:24 +0000)]
Merge "Rename keymaster_device_t to keymaster0_device_t."

9 years agoam c19c6738: Merge "vold: acquire wakelock on fstrim thread"
JP Abgrall [Thu, 26 Feb 2015 19:03:35 +0000 (19:03 +0000)]
am c19c6738: Merge "vold: acquire wakelock on fstrim thread"

* commit 'c19c67388cca4bda7b2042f065a7dc596f72fee8':
  vold: acquire wakelock on fstrim thread

9 years agoMerge "vold: acquire wakelock on fstrim thread"
JP Abgrall [Thu, 26 Feb 2015 18:56:15 +0000 (18:56 +0000)]
Merge "vold: acquire wakelock on fstrim thread"

9 years agovold: acquire wakelock on fstrim thread
Young-ho Cha [Fri, 20 Jun 2014 10:48:36 +0000 (19:48 +0900)]
vold: acquire wakelock on fstrim thread

If fstrim thread creation or detachment is failed, wakelock can be leaked.
So move wakelock acquire to do_fstrim_filesystems function

Change-Id: I4da3164343af83fae3e5b01700f43d1752661276
Signed-off-by: Young-ho Cha <ganadist@gmail.com>
9 years agoRename keymaster_device_t to keymaster0_device_t.
Shawn Willden [Tue, 24 Feb 2015 16:51:34 +0000 (09:51 -0700)]
Rename keymaster_device_t to keymaster0_device_t.

This is to accomodate the new keymaster1_device_t, which has an entirely
different interface.

Soon I'll provide a libkeymaster which provides a unified (and nicer)
interface for dealing with both v0 and v1 keymaster implementations
using a v1 keymaster API.  For now this change is just so that vold will
build and run.

Change-Id: I5c54282c12d1c4b8b22ed4929b6e6c724a94ede4

9 years agoam d55d8dac: Merge "prevent ioctl_init() to write outside buffer"
Elliott Hughes [Sat, 7 Feb 2015 07:38:37 +0000 (07:38 +0000)]
am d55d8dac: Merge "prevent ioctl_init() to write outside buffer"

* commit 'd55d8dac45dc60cb2cc9e599d3e89532db0cfc39':
  prevent ioctl_init() to write outside buffer

9 years agoam 8c0a0db1: Merge "Change strncpy to strlcpy"
Elliott Hughes [Sat, 7 Feb 2015 07:38:37 +0000 (07:38 +0000)]
am 8c0a0db1: Merge "Change strncpy to strlcpy"

* commit '8c0a0db1ad217f3238e31c291afa6b5e6a6fc98d':
  Change strncpy to strlcpy

9 years agoMerge "prevent ioctl_init() to write outside buffer"
Elliott Hughes [Sat, 7 Feb 2015 07:29:43 +0000 (07:29 +0000)]
Merge "prevent ioctl_init() to write outside buffer"

9 years agoMerge "Change strncpy to strlcpy"
Elliott Hughes [Sat, 7 Feb 2015 07:28:05 +0000 (07:28 +0000)]
Merge "Change strncpy to strlcpy"

9 years agoam 223fd1ca: Revert "Make encryption configurable"
Paul Lawrence [Sat, 7 Feb 2015 00:11:29 +0000 (00:11 +0000)]
am 223fd1ca: Revert "Make encryption configurable"

* commit '223fd1cad8d627dc36e11da8cdd342c1a810d226':
  Revert "Make encryption configurable"

9 years agoRevert "Make encryption configurable"
Paul Lawrence [Fri, 6 Feb 2015 16:56:13 +0000 (16:56 +0000)]
Revert "Make encryption configurable"

This reverts commit 6a69cfc411c086f15d59b7dc105763af16620414.

The original fix seems to have led to boot failures in QA. Rather than
risk shipping, revert the change. Bug 18764230 reopened.

Requires change
    https://googleplex-android-review.git.corp.google.com/#/c/629950/

Bug: 19278390
Bug: 19199624

Change-Id: Ia858c4db0abb917f9364ec8048f59ca4fb48e233

9 years agoam d9f2082f: Merge "VolumeManager: don\'t use faccessat(AT_SYMLINK_NOFOLLOW)"
Nick Kralevich [Fri, 6 Feb 2015 17:20:23 +0000 (17:20 +0000)]
am d9f2082f: Merge "VolumeManager: don\'t use faccessat(AT_SYMLINK_NOFOLLOW)"

* commit 'd9f2082fd798e77cc15735bc582507abb64c8ed4':
  VolumeManager: don't use faccessat(AT_SYMLINK_NOFOLLOW)

9 years agoMerge "VolumeManager: don't use faccessat(AT_SYMLINK_NOFOLLOW)"
Nick Kralevich [Fri, 6 Feb 2015 17:11:00 +0000 (17:11 +0000)]
Merge "VolumeManager: don't use faccessat(AT_SYMLINK_NOFOLLOW)"

9 years agoVolumeManager: don't use faccessat(AT_SYMLINK_NOFOLLOW)
Nick Kralevich [Fri, 6 Feb 2015 16:55:08 +0000 (08:55 -0800)]
VolumeManager: don't use faccessat(AT_SYMLINK_NOFOLLOW)

Don't use faccessat(AT_SYMLINK_NOFOLLOW). In Android, AT_SYMLINK_NOFOLLOW
is ignored. In glibc, it returns counter intuitive results when a
symbolic link is encountered, returning true all the time even though
an open(O_NOFOLLOW) will eventually fail.

Instead, stat the file and check to see if it's a regular file,
not a directory or symlink or some other weirdness.

In addition, fix a bug where isAsecInDirectory would return
true ("-1") if the asec directory didn't exist. It should return
false.

Bug: 18867827
Change-Id: I33d90e9095fad36ce0f83fde105b70f72e4eaef4

9 years agoChange strncpy to strlcpy
Henrik Baard [Fri, 6 Feb 2015 08:24:14 +0000 (09:24 +0100)]
Change strncpy to strlcpy

Change all function calls to strncpy to strlcpy.

Change-Id: I2bbefb7829d715847c5b26f4b9f0faddbd4c89d0

9 years agoprevent ioctl_init() to write outside buffer
Marek Pola [Thu, 5 Feb 2015 13:22:34 +0000 (14:22 +0100)]
prevent ioctl_init() to write outside buffer

The strncpy operation does not write a 0 termination
if the name is larger than the target buffer.

Ensure that zero termination is always written using
safe strlcpy function.

Change-Id: Idb68cdff7cd1a860c1dfac7494fa99f3d382cb91

9 years agoam f805a8b3: Merge "Change lseek to lseek64"
Elliott Hughes [Thu, 5 Feb 2015 20:26:52 +0000 (20:26 +0000)]
am f805a8b3: Merge "Change lseek to lseek64"

* commit 'f805a8b3a917b163c789f1ad4b272560f98eb6f1':
  Change lseek to lseek64

9 years agoam ebc83b3e: Merge "Fix memory leak in upgrade_crypt_ftr"
Elliott Hughes [Thu, 5 Feb 2015 18:51:07 +0000 (18:51 +0000)]
am ebc83b3e: Merge "Fix memory leak in upgrade_crypt_ftr"

* commit 'ebc83b3e8ef6d0dbab84bec88e0231c7911e5378':
  Fix memory leak in upgrade_crypt_ftr

9 years agoMerge "Change lseek to lseek64"
Elliott Hughes [Thu, 5 Feb 2015 17:36:01 +0000 (17:36 +0000)]
Merge "Change lseek to lseek64"

9 years agoMerge "Fix memory leak in upgrade_crypt_ftr"
Elliott Hughes [Thu, 5 Feb 2015 17:08:58 +0000 (17:08 +0000)]
Merge "Fix memory leak in upgrade_crypt_ftr"

9 years agoChange lseek to lseek64
Björn Landström [Tue, 20 Jan 2015 11:43:56 +0000 (12:43 +0100)]
Change lseek to lseek64

Using lseek on 64-bit offset parameter caused failure
to write persistent data in crypto footer.

Changed calls to use lseek64 instead.

Change-Id: I4e4c397a6d36201b8b08be3017e17c9fac3b34e4

9 years agoFix memory leak in upgrade_crypt_ftr
Henrik Baard [Thu, 5 Feb 2015 14:09:17 +0000 (15:09 +0100)]
Fix memory leak in upgrade_crypt_ftr

The structure crypt_persist_data was allocated,
but never freed.

Added free of allocated memory in normal and
error case.

Change-Id: I9aaa067e6f6501e8ce007f8659004b5dbcf2b246

9 years agoam fcca3faa: Merge "Make encryption configurable"
Paul Lawrence [Wed, 28 Jan 2015 21:21:30 +0000 (21:21 +0000)]
am fcca3faa: Merge "Make encryption configurable"

* commit 'fcca3faad48fc37be78a7307ee94b1b55cb89f16':
  Make encryption configurable

9 years agoMerge "Make encryption configurable"
Paul Lawrence [Wed, 28 Jan 2015 21:14:19 +0000 (21:14 +0000)]
Merge "Make encryption configurable"

9 years agoam 61c19efd: Merge "Add missing <string.h> include."
Elliott Hughes [Wed, 28 Jan 2015 20:14:17 +0000 (20:14 +0000)]
am 61c19efd: Merge "Add missing <string.h> include."

* commit '61c19efd0b9015eb0a7350f8ec6b7e61ae5a75ab':
  Add missing <string.h> include.

9 years agoMerge "Add missing <string.h> include."
Elliott Hughes [Wed, 28 Jan 2015 20:04:02 +0000 (20:04 +0000)]
Merge "Add missing <string.h> include."

9 years agoAdd missing <string.h> include.
Elliott Hughes [Wed, 28 Jan 2015 19:47:21 +0000 (11:47 -0800)]
Add missing <string.h> include.

Change-Id: I31f5cd6fb4ff55d7cfe213f66955e3dbcbdff101

9 years agoMake encryption configurable
Paul Lawrence [Wed, 21 Jan 2015 17:58:26 +0000 (09:58 -0800)]
Make encryption configurable

Add maybeenabledefaultencryption function, that encrypts based
on the encryption flag and appropriate environment variable

Bug: 18764230
Change-Id: Id9a1967d09a7ae63a51240c0a5f3c41505af0e9a

9 years agoam 6a69cfc4: Make encryption configurable
Paul Lawrence [Mon, 26 Jan 2015 15:53:01 +0000 (15:53 +0000)]
am 6a69cfc4: Make encryption configurable

* commit '6a69cfc411c086f15d59b7dc105763af16620414':
  Make encryption configurable

9 years agoam 26970299: Merge "Remove superfluous OpenSSL include paths."
Kenny Root [Fri, 23 Jan 2015 01:17:16 +0000 (01:17 +0000)]
am 26970299: Merge "Remove superfluous OpenSSL include paths."

* commit '269702997153cdf92c65cfee277c76afed44e9e5':
  Remove superfluous OpenSSL include paths.

9 years agoMerge "Remove superfluous OpenSSL include paths."
Kenny Root [Fri, 23 Jan 2015 01:05:47 +0000 (01:05 +0000)]
Merge "Remove superfluous OpenSSL include paths."

9 years agoRemove superfluous OpenSSL include paths.
Adam Langley [Fri, 23 Jan 2015 00:45:28 +0000 (16:45 -0800)]
Remove superfluous OpenSSL include paths.

The libcrypto and libssl modules (and their respective static and host
versions) use LOCAL_EXPORT_C_INCLUDE_DIRS thus just including the module
is sufficient.

Additionally, cryptfs.h was including an OpenSSL header just to get the
length of a SHA-256 hash. Rather than force all users of this header to
also depend on libcrypto, it's easier just to define that value in the
header file.

Change-Id: I3e3e0db906a212e1093944b298e4a8ff2e2fb07d

9 years agoMake encryption configurable
Paul Lawrence [Wed, 21 Jan 2015 17:58:26 +0000 (09:58 -0800)]
Make encryption configurable

Add maybeenabledefaultencryption function, that encrypts based
on the encryption flag and appropriate environment variable

Bug: 18764230
Change-Id: Id9a1967d09a7ae63a51240c0a5f3c41505af0e9a

9 years agoam f3b2637e: Merge "Use getmntent when accessing /proc/mounts."
Yabin Cui [Tue, 6 Jan 2015 18:21:52 +0000 (18:21 +0000)]
am f3b2637e: Merge "Use getmntent when accessing /proc/mounts."

* commit 'f3b2637e0611ac7953c18ce39a47b7c408a70160':
  Use getmntent when accessing /proc/mounts.

9 years agoMerge "Use getmntent when accessing /proc/mounts."
Yabin Cui [Tue, 6 Jan 2015 18:06:08 +0000 (18:06 +0000)]
Merge "Use getmntent when accessing /proc/mounts."

9 years agoUse getmntent when accessing /proc/mounts.
Yabin Cui [Fri, 2 Jan 2015 21:28:28 +0000 (13:28 -0800)]
Use getmntent when accessing /proc/mounts.

Bug: 18887435
Change-Id: Ibcb446fac954d9c42ebdfc4b684e6f3503337ab4

9 years agoam ac2bbd08: Merge "Fix missing #includes in system/vold."
Elliott Hughes [Tue, 30 Dec 2014 12:21:15 +0000 (12:21 +0000)]
am ac2bbd08: Merge "Fix missing #includes in system/vold."

* commit 'ac2bbd08c61e7412912613605d3e561eb22c41c1':
  Fix missing #includes in system/vold.

9 years agoMerge "Fix missing #includes in system/vold."
Elliott Hughes [Mon, 29 Dec 2014 22:10:51 +0000 (22:10 +0000)]
Merge "Fix missing #includes in system/vold."

9 years agoFix missing #includes in system/vold.
Elliott Hughes [Mon, 29 Dec 2014 22:09:42 +0000 (14:09 -0800)]
Fix missing #includes in system/vold.

Change-Id: I53611cf8373daf638b0cc45b7b3d17e4d3e7247e

9 years agoRemove unused local variable to fix the build
Brian Carlstrom [Fri, 19 Dec 2014 01:01:40 +0000 (17:01 -0800)]
Remove unused local variable to fix the build

Change-Id: Ic0a77a754b649d360d07eaa9e6a93274e7eaf0a8

9 years agoresolved conflicts for merge of 88aba541 to lmp-mr1-dev-plus-aosp
Dan Albert [Thu, 18 Dec 2014 22:08:43 +0000 (14:08 -0800)]
resolved conflicts for merge of 88aba541 to lmp-mr1-dev-plus-aosp

Change-Id: Ie5ef819dd8168cb6a73f84a881a92c116705fffc

9 years agoMerge "Fix alignment of buffer used for dm_ioctl."
Dan Albert [Thu, 18 Dec 2014 18:42:15 +0000 (18:42 +0000)]
Merge "Fix alignment of buffer used for dm_ioctl."

9 years agoFix alignment of buffer used for dm_ioctl.
Dan Albert [Thu, 18 Dec 2014 18:00:55 +0000 (10:00 -0800)]
Fix alignment of buffer used for dm_ioctl.

Since the dm_ioctl struct was being allocated on the stack as a large
character array, it was getting character alignment rather than the
proper alignment for the struct. GCC had been getting away with this
so far, but it's undefined behavior that clang managed to expose.

Bug: 18736778
Change-Id: Ied275dfad7fcc41d712b2d02c8a185f499221f57

9 years agoresolved conflicts for merge of 4be36106 to lmp-mr1-dev-plus-aosp
Tim Murray [Thu, 18 Dec 2014 00:41:07 +0000 (16:41 -0800)]
resolved conflicts for merge of 4be36106 to lmp-mr1-dev-plus-aosp

Change-Id: If504710a618d8c3adf85297d5fd2909558ed57a3

9 years agoMerge "Make vold compile with -Werror -Wall."
Tim Murray [Thu, 18 Dec 2014 00:23:26 +0000 (00:23 +0000)]
Merge "Make vold compile with -Werror -Wall."

9 years agoMake vold compile with -Werror -Wall.
Tim Murray [Mon, 15 Dec 2014 19:56:11 +0000 (11:56 -0800)]
Make vold compile with -Werror -Wall.

-Wno-missing-field-initializers is used as well, but that is an
overzealous warning from initializing structs with {0} and not a
real warning.

bug 18736778 and 16868177

Change-Id: Iffde89cd7200d9a11193e1614f1819f9fcace30a

9 years agoam a20bb17e: Merge "Move vold to GCC."
Dan Albert [Sat, 13 Dec 2014 02:17:32 +0000 (02:17 +0000)]
am a20bb17e: Merge "Move vold to GCC."

* commit 'a20bb17e4c6095a77425418d7eb0c1ceb50d05f7':
  Move vold to GCC.

9 years agoMerge "Move vold to GCC."
Dan Albert [Sat, 13 Dec 2014 02:03:13 +0000 (02:03 +0000)]
Merge "Move vold to GCC."

9 years agoMove vold to GCC.
Dan Albert [Sat, 13 Dec 2014 01:47:16 +0000 (17:47 -0800)]
Move vold to GCC.

It looks like clang might have a miscompile that is causing SIGBUS in
`ioctl_init` when the device is encrypted. Move back to GCC until we
can sort this out.

Bug: 18736778
Change-Id: I21ae3b9d7d9ebff8679ecc1a828b7c59f27d0903

9 years agoam acfdc30e: Merge "Fix error in clocks leading to devices staying unlocked" into...
Paul Lawrence [Tue, 2 Dec 2014 18:54:41 +0000 (18:54 +0000)]
am acfdc30e: Merge "Fix error in clocks leading to devices staying unlocked" into lmp-mr1-dev

* commit 'acfdc30e3793512de4b9a5e15da69533735dd8be':
  Fix error in clocks leading to devices staying unlocked

9 years agoam d44a8f59: Merge "Fix encrypt-and-wipe" into lmp-mr1-dev
Paul Lawrence [Tue, 2 Dec 2014 18:45:42 +0000 (18:45 +0000)]
am d44a8f59: Merge "Fix encrypt-and-wipe" into lmp-mr1-dev

* commit 'd44a8f59a7518b87a3fe4174c78dfb9727e63f89':
  Fix encrypt-and-wipe

9 years agoam b25302e1: Do not log passwords returned through vdc
Paul Lawrence [Tue, 2 Dec 2014 18:45:42 +0000 (18:45 +0000)]
am b25302e1: Do not log passwords returned through vdc

* commit 'b25302e1b0232ac2f9d6ffa441f2ab1ff23a2de3':
  Do not log passwords returned through vdc

9 years agoMerge "Fix error in clocks leading to devices staying unlocked" into lmp-mr1-dev
Paul Lawrence [Tue, 2 Dec 2014 18:34:14 +0000 (18:34 +0000)]
Merge "Fix error in clocks leading to devices staying unlocked" into lmp-mr1-dev

9 years agoMerge "Fix encrypt-and-wipe" into lmp-mr1-dev
Paul Lawrence [Tue, 2 Dec 2014 18:20:04 +0000 (18:20 +0000)]
Merge "Fix encrypt-and-wipe" into lmp-mr1-dev

9 years agoDo not log passwords returned through vdc
Paul Lawrence [Tue, 11 Nov 2014 20:26:09 +0000 (12:26 -0800)]
Do not log passwords returned through vdc

Requires framework change:
  https://googleplex-android-review.git.corp.google.com/#/c/585511/

Bug: 18260068
Change-Id: I95d3bb39404ede7128b8f5d61ce2423a5f09a9b8

9 years agoFix error in clocks leading to devices staying unlocked
Paul Lawrence [Tue, 11 Nov 2014 20:47:03 +0000 (12:47 -0800)]
Fix error in clocks leading to devices staying unlocked

Use BOOTTIME consistently!

Bug: 18246810
Change-Id: I630bf39f72ab69f971d2f772e8d4545ffe467b82

9 years agoFix encrypt-and-wipe
Paul Lawrence [Tue, 25 Nov 2014 22:57:32 +0000 (14:57 -0800)]
Fix encrypt-and-wipe

encrypt-and-wipe was broken when checks were added that encryption succeeded
which assumed a 'normal' full encrypt traversing the device.

encrypt-and-wipe doesn't traverse, it just lays down a file system over
the encrypted device, so in this mode do not check the amount encrypted -
it will always be 0.

Bug: 18511900
Change-Id: Icb1d7e0cdb67abd2eac0ab3cbfc1a88912768f9d

9 years agoam bb7d9afe: fall back to dm-crypt if device already encrypted
Iliyan Malchev [Fri, 21 Nov 2014 08:56:42 +0000 (08:56 +0000)]
am bb7d9afe: fall back to dm-crypt if device already encrypted

* commit 'bb7d9afea9479eabbc98133d3d968225a1e1019e':
  fall back to dm-crypt if device already encrypted

9 years agoresolved conflicts for merge of 87701e27 to lmp-mr1-dev-plus-aosp
Iliyan Malchev [Fri, 21 Nov 2014 08:52:40 +0000 (00:52 -0800)]
resolved conflicts for merge of 87701e27 to lmp-mr1-dev-plus-aosp

Change-Id: Ie873baff626fe786515497f2e81aa9db2329168d

9 years agofall back to dm-crypt if device already encrypted
Iliyan Malchev [Fri, 21 Nov 2014 02:42:23 +0000 (18:42 -0800)]
fall back to dm-crypt if device already encrypted

Devices already encrypted with aes-cbc-essiv:sha256 will continue to be
decrypted in software, until a factory data reset.  New devices that
implement CONFIG_HW_DISK_ENCRYPTION will switch to aes-xts.

b/17475056 Enable hardware crypto for userdata encryption

Change-Id: I62d1583bdaf7ff06b87e386e758fa3b18c719bca
Signed-off-by: Iliyan Malchev <malchev@google.com>
9 years agoAdding support of dm-req-crypt
Ajay Dudani [Thu, 18 Sep 2014 04:02:52 +0000 (21:02 -0700)]
Adding support of dm-req-crypt

Currently Android provides disk encryption support using dm-crypt
which is based on bios. dm-crypt uses 512 bytes packet size for
crypto operations. While 512 bytes size packet is ok for SW based
disk encryption, it is inefficient for HW based crypto engines.
dm-req-crypt is similar to dm-crypt except it uses block requests
rathe bios for crypto operations. block requests when unpacked
carries data upto 512KB. Hence, HW based crypto engine can be used
more efficiently.

Also move create disk encryption key before framework start as
HW based disk encryption creates key in secure side. Key creation
can take sometime to create the key securely. If framework is
started before creating the key, it is possible that framework
requests service from secure side. Secure side can serve mostly one
request at a time. Secure side may reject framework request if key
creation request is still going on. This may cause problem in the
system

b/17475056 Enable hardware crypto for userdata encryption

Change-Id: I5480ab72a37c02532218a18faaba598a824589fd
Signed-off-by: Iliyan Malchev <malchev@google.com>
9 years agoam 89bcc638: am 36859212: Merge "Move vold to libc++."
Dan Albert [Thu, 6 Nov 2014 00:18:54 +0000 (00:18 +0000)]
am 89bcc638: am 36859212: Merge "Move vold to libc++."

* commit '89bcc638ab24af7bee0ff3ccfa190a08b721f0a4':
  Move vold to libc++.

9 years agoam a05cb413: am 460a93a6: Merge "Move vold to clang so ASAN_ALL works."
Dan Albert [Thu, 6 Nov 2014 00:18:53 +0000 (00:18 +0000)]
am a05cb413: am 460a93a6: Merge "Move vold to clang so ASAN_ALL works."

* commit 'a05cb41300b652e6125c6df42d4aa756101e6e72':
  Move vold to clang so ASAN_ALL works.

9 years agoam 36859212: Merge "Move vold to libc++."
Dan Albert [Thu, 6 Nov 2014 00:15:12 +0000 (00:15 +0000)]
am 36859212: Merge "Move vold to libc++."

* commit '36859212614fd112e08dcf92065ee6db910769bb':
  Move vold to libc++.

9 years agoam 460a93a6: Merge "Move vold to clang so ASAN_ALL works."
Dan Albert [Thu, 6 Nov 2014 00:15:12 +0000 (00:15 +0000)]
am 460a93a6: Merge "Move vold to clang so ASAN_ALL works."

* commit '460a93a6d4d01bf0efa83acea0c84b4d43ab23c9':
  Move vold to clang so ASAN_ALL works.

9 years agoMerge "Move vold to libc++."
Dan Albert [Thu, 6 Nov 2014 00:12:48 +0000 (00:12 +0000)]
Merge "Move vold to libc++."

9 years agoMove vold to libc++.
Dan Albert [Wed, 5 Nov 2014 22:48:45 +0000 (14:48 -0800)]
Move vold to libc++.

Bug: 15193147
Change-Id: Ib868f1ed8145ca5cbfdb4cd60ed0c47a6182ac62

9 years agoModify vold to check for hardware keymaster.
Shawn Willden [Wed, 5 Nov 2014 18:03:47 +0000 (18:03 +0000)]
Modify vold to check for hardware keymaster.
automerge: 7c49ab0

* commit '7c49ab0a0b3c1ee9b24a4b0b1a2c0a8c86acea41':
  Modify vold to check for hardware keymaster.

9 years agoModify vold to check for hardware keymaster.
Shawn Willden [Thu, 30 Oct 2014 14:12:32 +0000 (08:12 -0600)]
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

9 years agoMerge "Make persistent field in cryptofs support longer values." into lmp-mr1-dev
Rubin Xu [Thu, 30 Oct 2014 18:59:11 +0000 (18:59 +0000)]
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.

9 years agoMerge "Make persistent field in cryptofs support longer values." into lmp-mr1-dev
Rubin Xu [Wed, 29 Oct 2014 15:41:23 +0000 (15:41 +0000)]
Merge "Make persistent field in cryptofs support longer values." into lmp-mr1-dev

9 years agoam 096dd2dd: am ab083da0: Merge "Set SELinux contexts on device nodes created by...
Nick Kralevich [Wed, 29 Oct 2014 07:00:56 +0000 (07:00 +0000)]
am 096dd2dd: am ab083da0: Merge "Set SELinux contexts on device nodes created by vold."

* commit '096dd2dd8c0294253c4b88b2c02715bf56e0287c':

9 years agoam 9b5a3812: cryptfs: [HACK] reboot if the crypto block dev failed to open automerge...
JP Abgrall [Wed, 29 Oct 2014 07:00:56 +0000 (07:00 +0000)]
am 9b5a3812: cryptfs: [HACK] reboot if the crypto block dev failed to open automerge: 512f0d5

* commit '9b5a381241ff503ba05f5622927633b8527dadf5':

9 years agoam 4c9b4d8c: am 7776871d: cryptfs: extra debugging around crypto blockdev dm-......
JP Abgrall [Wed, 29 Oct 2014 07:00:55 +0000 (07:00 +0000)]
am 4c9b4d8c: am 7776871d: cryptfs: extra debugging around crypto blockdev dm-... errors.

* commit '4c9b4d8c978433b4810c0449d4f376dbf7e74ab9':

9 years agoam fd2180a9: am fc615041: Remove possibility of zero chars from passwords
Paul Lawrence [Wed, 29 Oct 2014 07:00:55 +0000 (07:00 +0000)]
am fd2180a9: am fc615041: Remove possibility of zero chars from passwords

* commit 'fd2180a97289732520328c69150419763ced48c1':

9 years agoam 6bcac81e: am 7639a6ab: Merge "Reset failed decryption count on successful decrypti...
Paul Lawrence [Wed, 29 Oct 2014 07:00:55 +0000 (07:00 +0000)]
am 6bcac81e: am 7639a6ab: Merge "Reset failed decryption count on successful decryptions" into lmp-dev

* commit '6bcac81e6a8db504dc32d89907f847b5a9118817':

9 years agoam b69a5e44: am 6e8440fd: cryptfs: kill processes with open files on tmpfs /data
Greg Hackmann [Wed, 29 Oct 2014 07:00:54 +0000 (07:00 +0000)]
am b69a5e44: am 6e8440fd: cryptfs: kill processes with open files on tmpfs /data

* commit 'b69a5e44db9b7ecf39b9441115f3470554062157':

9 years agoam f2eabef8: am 9c58a871: Use monotonic clock for cryptfs progress
Paul Lawrence [Wed, 29 Oct 2014 07:00:54 +0000 (07:00 +0000)]
am f2eabef8: am 9c58a871: Use monotonic clock for cryptfs progress

* commit 'f2eabef83f4a32de1d0670d053a4d6bac787cd4b':

9 years agoam e46f7122: am 3574b085: Merge "cryptfs: log umount() failure reason" into lmp-dev
Greg Hackmann [Wed, 29 Oct 2014 07:00:53 +0000 (07:00 +0000)]
am e46f7122: am 3574b085: Merge "cryptfs: log umount() failure reason" into lmp-dev

* commit 'e46f7122e002539cdfb1d83baac3652b88528455':

9 years agoam e2a470f3: am 46a3a79a: Merge "print information about opened files when failed...
Greg Hackmann [Wed, 29 Oct 2014 07:00:53 +0000 (07:00 +0000)]
am e2a470f3: am 46a3a79a: Merge "print information about opened files when failed unmount" into lmp-dev

* commit 'e2a470f3980a824e8f5ba92fd8356336c7161463':

9 years agoam 640aa862: am dd1a8040: Include reason when wiping data.
Jeff Sharkey [Wed, 29 Oct 2014 07:00:52 +0000 (07:00 +0000)]
am 640aa862: am dd1a8040: Include reason when wiping data.

* commit '640aa86222c40553a2540c6cf9e840d13e750e30':

9 years agoam 7df812df: am 3846be17: Reduce cryptfs logspam
Paul Lawrence [Wed, 29 Oct 2014 07:00:52 +0000 (07:00 +0000)]
am 7df812df: am 3846be17: Reduce cryptfs logspam

* commit '7df812dfaa6c82865efb0511f2da1adb601829b2':

9 years agoam b707d72a: am 6efa9351: Merge "Don\'t use deprecated OpenSSL functions."
Alex Klyubin [Wed, 29 Oct 2014 07:00:52 +0000 (07:00 +0000)]
am b707d72a: am 6efa9351: Merge "Don\'t use deprecated OpenSSL functions."

* commit 'b707d72a33c8e442cafb36f724245f1c9898fb36':

9 years agoMake persistent field in cryptofs support longer values.
Rubin Xu [Mon, 13 Oct 2014 11:49:54 +0000 (12:49 +0100)]
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

9 years agoMerge "Move vold to clang so ASAN_ALL works."
Dan Albert [Tue, 21 Oct 2014 23:09:07 +0000 (23:09 +0000)]
Merge "Move vold to clang so ASAN_ALL works."

9 years agoMove vold to clang so ASAN_ALL works.
Dan Albert [Tue, 21 Oct 2014 18:02:33 +0000 (11:02 -0700)]
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

9 years agoam ab083da0: Merge "Set SELinux contexts on device nodes created by vold."
Nick Kralevich [Sat, 18 Oct 2014 23:09:09 +0000 (23:09 +0000)]
am ab083da0: Merge "Set SELinux contexts on device nodes created by vold."

* commit 'ab083da069a73f787a9304e155c0ab847c85377f':
  Set SELinux contexts on device nodes created by vold.

9 years agoam ab083da0: Merge "Set SELinux contexts on device nodes created by vold."
Nick Kralevich [Sat, 18 Oct 2014 23:08:54 +0000 (23:08 +0000)]
am ab083da0: Merge "Set SELinux contexts on device nodes created by vold."

* commit 'ab083da069a73f787a9304e155c0ab847c85377f':
  Set SELinux contexts on device nodes created by vold.

9 years agoMerge "Set SELinux contexts on device nodes created by vold."
Nick Kralevich [Sat, 18 Oct 2014 23:02:30 +0000 (23:02 +0000)]
Merge "Set SELinux contexts on device nodes created by vold."

9 years agoam ada1f929: am 512f0d52: cryptfs: [HACK] reboot if the crypto block dev failed to...
JP Abgrall [Fri, 17 Oct 2014 19:12:11 +0000 (19:12 +0000)]
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

9 years agoam 0f3e09cb: resolved conflicts for merge of 7776871d to lmp-mr1-dev
JP Abgrall [Fri, 17 Oct 2014 18:59:31 +0000 (18:59 +0000)]
am 0f3e09cb: resolved conflicts for merge of 7776871d to lmp-mr1-dev

* commit '0f3e09cb9c5adbdae140694e519cf9a8b241f1ba':
  cryptfs: extra debugging around crypto blockdev dm-... errors.

9 years agoam 512f0d52: cryptfs: [HACK] reboot if the crypto block dev failed to open
JP Abgrall [Fri, 17 Oct 2014 18:50:39 +0000 (18:50 +0000)]
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