Commit graph

788 commits

Author SHA1 Message Date
Paul Lawrence
29b54aab8e Retry unmounts in ext4 encryption
Bug: 18151196
Change-Id: I52ca23b2ce3adcff44bd003d4a12243a0bd6ac34
2015-05-05 14:28:25 -07:00
Paul Lawrence
4571383cbf Merge "Use default key permissions for ext4enc" 2015-05-05 20:18:36 +00:00
Paul Lawrence
1190a26f6d Use default key permissions for ext4enc
As per discussion default permissions are the correct ones.
Note that since we use logon keys, they cannot be read outside
the kernel.

Note also that we limit who can read/write keys in selinux policy.

Bug: 18151196
Change-Id: Icc916f430a70eff22e6b74c20ec361c8f3789c1c
2015-05-05 11:12:37 -07:00
Paul Lawrence
0f29aec5af Merge "Simplify password checking logic" 2015-05-05 14:13:05 +00:00
Paul Lawrence
aaccfac344 Simplify password checking logic
Bug: 18151196
Change-Id: I07ffde534dee7d1032149cfcbaa1a61c5246d759
2015-05-04 15:53:51 -07:00
Paul Lawrence
babba576ba Merge "Enable properties in ext4enc" 2015-05-01 15:13:41 +00:00
Paul Lawrence
4e7274551c Enable properties in ext4enc
Enables OwnerInfo and pattern suppression

Bug: 18151196

Change-Id: I46144e16cb00319deeb5492ab82c67f5dd43d6d3
2015-05-01 08:03:39 -07:00
Paul Lawrence
744a7aa54b Merge "Check password is correct by checking hash" 2015-04-30 17:20:09 +00:00
Paul Lawrence
3ca21e227a Check password is correct by checking hash
Handle failures gracefully

Change-Id: Ifb6da8c11a86c50fb11964c18cc1be1326461f78
2015-04-30 09:38:43 -07:00
Paul Lawrence
d739914768 Merge "New ext4enc kernel switching from xattrs to ioctl" 2015-04-30 16:28:52 +00:00
Paul Lawrence
5e7f004231 New ext4enc kernel switching from xattrs to ioctl
This is one of three changes to enable this functionality:
  https://android-review.googlesource.com/#/c/146259/
  https://android-review.googlesource.com/#/c/146264/
  https://android-review.googlesource.com/#/c/146265/

Bug: 18151196

Change-Id: Iba5146b8be1e15050ae901e08b3aaa26d96dcf7e
2015-04-30 09:19:55 -07:00
Paul Lawrence
c3e4cc29f8 Merge "Securely encrypt the master key" 2015-04-29 16:24:38 +00:00
Paul Lawrence
707fd6c7cc Securely encrypt the master key
Move all key management into vold
Reuse vold's existing key management through the crypto footer
to manage the device wide keys.

Use ro.crypto.type flag to determine crypto type, which prevents
any issues when running in block encrypted mode, as well as speeding
up boot in block or no encryption.

This is one of four changes to enable this functionality:
  https://android-review.googlesource.com/#/c/148586/
  https://android-review.googlesource.com/#/c/148604/
  https://android-review.googlesource.com/#/c/148606/
  https://android-review.googlesource.com/#/c/148607/

Bug: 18151196

Change-Id: I3c68691717a61b5e1df76423ca0c02baff0dab98
2015-04-28 22:41:58 +00:00
Paul Lawrence
bf9dcad78e Merge "Revert "Securely encrypt the master key"" 2015-04-28 19:16:57 +00:00
Paul Lawrence
beadcb6ec0 Revert "Securely encrypt the master key"
This reverts commit 7053e9cd5e.

Change-Id: I77ed4dbdff8643c80629d2126cb29f85c24c7b43
2015-04-28 19:16:46 +00:00
Paul Lawrence
86138731da Merge "Securely encrypt the master key" 2015-04-27 20:09:13 +00:00
Paul Lawrence
7053e9cd5e Securely encrypt the master key
Move all key management into vold
Reuse vold's existing key management through the crypto footer
to manage the device wide keys

This is one of four changes to enable this functionality:
  https://android-review.googlesource.com/#/c/144586/
  https://android-review.googlesource.com/#/c/144663/
  https://android-review.googlesource.com/#/c/144672/
  https://android-review.googlesource.com/#/c/144673/

Bug: 18151196
Change-Id: I9a162b90afe5f46a4ff15b3878e2ab503795425e
2015-04-27 20:08:38 +00:00
Elliott Hughes
d5aa67cc53 Merge "Wait for completion of device mapping in mountObb" 2015-04-25 16:42:38 +00:00
yoshiyuki hama
476a627e55 Wait for completion of device mapping in mountObb
The VolumeManager::mountObb() creates a mapping between
a loopback device and a dm device. However the device-mapper
carries it out asynchronously, so there is a possibility that
Vold accesses to the dm device which is being built. Added
waiting for completion of the mapping in that function, like
mountAsec().

To verify install FrameworksCoreTests.apk and do:

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

Change-Id: If42f4b7494bb2f8a8b72d106ad84b3e3bf91fd9b
2015-04-25 12:13:17 +02:00
Mohamad Ayyash
f8c905e043 Merge "Add dependency on libsquashfs_utils due to fs_mgr dependency" 2015-04-07 18:00:53 +00:00
Mohamad Ayyash
c489d7f4e7 Add dependency on libsquashfs_utils due to fs_mgr dependency
Change-Id: I894d18c2086a6532194f478853a9837eb4b6fc09
Signed-off-by: Mohamad Ayyash <mkayyash@google.com>
2015-04-06 18:22:35 -07:00
Elliott Hughes
e9623fede7 Merge "Fixed type mismatch for ioctl(BLKGETSIZE)" 2015-03-30 21:03:04 +00:00
Hiroaki Miyazawa
14eab550e8 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
2015-03-30 11:28:11 -07:00
Paul Lawrence
8120c3d1b2 Merge "Adding e4crypt support" 2015-03-27 20:46:05 +00:00
Paul Lawrence
8175a0b65d 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
2015-03-27 13:38:41 -07:00
Nick Kralevich
cdcffc0d29 am 3393bb65: Merge "fstrim.c: use open(O_DIRECTORY) instead of stat"
* commit '3393bb650fd931e494a0280fc13717f36aea22fc':
  fstrim.c: use open(O_DIRECTORY) instead of stat
2015-03-05 21:03:15 +00:00
Nick Kralevich
3393bb650f Merge "fstrim.c: use open(O_DIRECTORY) instead of stat" 2015-03-05 20:57:54 +00:00
Nick Kralevich
24751743d7 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
2015-03-05 12:50:23 -08:00
Shawn Willden
47bc0ffadd am 5054f7ee: Merge "Rename keymaster_device_t to keymaster0_device_t."
* commit '5054f7ee4fa6e747eb8d08f60ec91ba6a9363878':
  Rename keymaster_device_t to keymaster0_device_t.
2015-02-26 23:31:10 +00:00
Shawn Willden
5054f7ee4f Merge "Rename keymaster_device_t to keymaster0_device_t." 2015-02-26 23:24:54 +00:00
JP Abgrall
aac44855ca am c19c6738: Merge "vold: acquire wakelock on fstrim thread"
* commit 'c19c67388cca4bda7b2042f065a7dc596f72fee8':
  vold: acquire wakelock on fstrim thread
2015-02-26 19:03:35 +00:00
JP Abgrall
c19c67388c Merge "vold: acquire wakelock on fstrim thread" 2015-02-26 18:56:16 +00:00
Young-ho Cha
e72cd592b3 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>
2015-02-26 18:45:52 +00:00
Shawn Willden
d1fd8468d0 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
2015-02-24 09:55:04 -07:00
Elliott Hughes
33b6de4b94 am d55d8dac: Merge "prevent ioctl_init() to write outside buffer"
* commit 'd55d8dac45dc60cb2cc9e599d3e89532db0cfc39':
  prevent ioctl_init() to write outside buffer
2015-02-07 07:38:37 +00:00
Elliott Hughes
d773fc118a am 8c0a0db1: Merge "Change strncpy to strlcpy"
* commit '8c0a0db1ad217f3238e31c291afa6b5e6a6fc98d':
  Change strncpy to strlcpy
2015-02-07 07:38:37 +00:00
Elliott Hughes
d55d8dac45 Merge "prevent ioctl_init() to write outside buffer" 2015-02-07 07:29:43 +00:00
Elliott Hughes
8c0a0db1ad Merge "Change strncpy to strlcpy" 2015-02-07 07:28:06 +00:00
Paul Lawrence
38394c7d2d am 223fd1ca: Revert "Make encryption configurable"
* commit '223fd1cad8d627dc36e11da8cdd342c1a810d226':
  Revert "Make encryption configurable"
2015-02-07 00:11:29 +00:00
Paul Lawrence
223fd1cad8 Revert "Make encryption configurable"
This reverts commit 6a69cfc411.

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
2015-02-06 17:32:56 +00:00
Nick Kralevich
cf694550b2 am d9f2082f: Merge "VolumeManager: don\'t use faccessat(AT_SYMLINK_NOFOLLOW)"
* commit 'd9f2082fd798e77cc15735bc582507abb64c8ed4':
  VolumeManager: don't use faccessat(AT_SYMLINK_NOFOLLOW)
2015-02-06 17:20:23 +00:00
Nick Kralevich
d9f2082fd7 Merge "VolumeManager: don't use faccessat(AT_SYMLINK_NOFOLLOW)" 2015-02-06 17:11:00 +00:00
Nick Kralevich
25e581a11c 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
2015-02-06 08:55:08 -08:00
Henrik Baard
2152266deb Change strncpy to strlcpy
Change all function calls to strncpy to strlcpy.

Change-Id: I2bbefb7829d715847c5b26f4b9f0faddbd4c89d0
2015-02-06 09:24:14 +01:00
Marek Pola
5e6b9141c1 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
2015-02-06 08:01:43 +01:00
Elliott Hughes
71f8d86fdf am f805a8b3: Merge "Change lseek to lseek64"
* commit 'f805a8b3a917b163c789f1ad4b272560f98eb6f1':
  Change lseek to lseek64
2015-02-05 20:26:52 +00:00
Elliott Hughes
e22b21af3a am ebc83b3e: Merge "Fix memory leak in upgrade_crypt_ftr"
* commit 'ebc83b3e8ef6d0dbab84bec88e0231c7911e5378':
  Fix memory leak in upgrade_crypt_ftr
2015-02-05 18:51:07 +00:00
Elliott Hughes
f805a8b3a9 Merge "Change lseek to lseek64" 2015-02-05 17:36:02 +00:00
Elliott Hughes
ebc83b3e8e Merge "Fix memory leak in upgrade_crypt_ftr" 2015-02-05 17:08:59 +00:00
Björn Landström
96dbee7bd6 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
2015-02-05 15:18:44 +01:00