OSDN Git Service

android-x86/system-vold.git
7 years agovold3: check supported filesystem modules marshmallow-x86 android-x86-6.0-r3
Chih-Wei Huang [Sat, 25 Mar 2017 16:47:42 +0000 (00:47 +0800)]
vold3: check supported filesystem modules

If there is a filesystem module of the requested type,
it should be considered supported.

Note the kernel will auto load the filesystem module
on mounting by modprobe.

7 years agovold3: support UDF (Universal Disk Format)
Chih-Wei Huang [Sat, 25 Mar 2017 16:46:42 +0000 (00:46 +0800)]
vold3: support UDF (Universal Disk Format)

Refer to https://en.wikipedia.org/wiki/Universal_Disk_Format.

7 years agovold3: auto mount CDROM
Chih-Wei Huang [Sat, 25 Mar 2017 16:45:41 +0000 (00:45 +0800)]
vold3: auto mount CDROM

Jide's ISO9660 support (commit 3da6ea1) is not complete. Still
need to handle block devices with major number of CDROM.

7 years agoMove kMajor* constants to a header file
Chih-Wei Huang [Fri, 24 Mar 2017 16:13:45 +0000 (00:13 +0800)]
Move kMajor* constants to a header file

Currently each cpp defines its own kMajor* that can't be shared.
Move the kMajor* to a header to avoid duplicate definitions.

7 years agovold: ISO9660 support
Luo Chunbo [Wed, 25 May 2016 08:16:48 +0000 (16:16 +0800)]
vold: ISO9660 support

Ref: T7691

Change-Id: Ifc602781e7d87aea9f3181263e09ffe143e9a231
Signed-off-by: Luo Chunbo <luochunbo@jidemail.com>
7 years agoEnable f2fs support android-x86-6.0-r1 android-x86-6.0-r2
Chih-Wei Huang [Sun, 11 Sep 2016 15:15:17 +0000 (23:15 +0800)]
Enable f2fs support

7 years agoMerge remote-tracking branch 'x86/marshmallow-x86' into cm-13.0-x86 cm-13.0-x86
Jaap Jan Meijer [Fri, 2 Sep 2016 13:21:17 +0000 (15:21 +0200)]
Merge remote-tracking branch 'x86/marshmallow-x86' into cm-13.0-x86

7 years agovold3: support the old SDCARD=xxx function
Chih-Wei Huang [Fri, 12 Aug 2016 17:58:29 +0000 (01:58 +0800)]
vold3: support the old SDCARD=xxx function

By specifying SDCARD=xxx in kernel cmdline, vold will try to mount
that disk or partition as a sdcard. This is an old function we've
added to vold 2.0. Now re-implement it in vold 3.0. Some people
still like and use it.

7 years agoMerge remote-tracking branch 'x86/marshmallow-x86' into cm-13.0-x86
Jaap Jan Meijer [Mon, 8 Aug 2016 14:53:20 +0000 (16:53 +0200)]
Merge remote-tracking branch 'x86/marshmallow-x86' into cm-13.0-x86

7 years agoMerge remote-tracking branch 'cm/cm-13.0' into cm-13.0-x86
Jaap Jan Meijer [Mon, 8 Aug 2016 14:52:55 +0000 (16:52 +0200)]
Merge remote-tracking branch 'cm/cm-13.0' into cm-13.0-x86

7 years agovold: Allow reset after shutdown
Steve Kondik [Thu, 28 Jul 2016 01:12:04 +0000 (18:12 -0700)]
vold: Allow reset after shutdown

 * If we shutdown all volumes (during crypto), vold throws up an
   assert at us when reset() is called due to destroying an
   already destroyed volume. This is actually fine, just return
   an error instead of crashing.

Change-Id: I51f8561da83e27de8e80d74f3a600fb0139d3035

7 years agoDon't abort even if setexeccon failed
Chih-Wei Huang [Wed, 2 Dec 2015 16:23:44 +0000 (00:23 +0800)]
Don't abort even if setexeccon failed

7 years agoFix Ext4 can't be mounted issue
Chih-Wei Huang [Fri, 8 Jul 2016 14:48:40 +0000 (22:48 +0800)]
Fix Ext4 can't be mounted issue

Only set context if selinux is enabled.

7 years agoRevert "Added cypto_complete states to reflect MDTP state."
Chih-Wei Huang [Wed, 6 Jul 2016 12:26:41 +0000 (20:26 +0800)]
Revert "Added cypto_complete states to reflect MDTP state."

This reverts commit 3a71320c098d413007fbf3df5cf5b1dd066db35f.

7 years agoMerge remote-tracking branch 'cm/cm-13.0' into marshmallow-x86
Chih-Wei Huang [Wed, 6 Jul 2016 12:26:00 +0000 (20:26 +0800)]
Merge remote-tracking branch 'cm/cm-13.0' into marshmallow-x86

7 years agovold: Fix tool paths for minivold
Michael Bestas [Sun, 29 Nov 2015 21:30:56 +0000 (23:30 +0200)]
vold: Fix tool paths for minivold

Change-Id: I4c90f0054f8cc83b5384bc2a9550ab172b202f01

7 years agocryptfs: Only consider patterns for upgrade conversion
Tom Marshall [Fri, 6 May 2016 16:03:09 +0000 (09:03 -0700)]
cryptfs: Only consider patterns for upgrade conversion

This avoids trying to fix certain PINs and passwords that would be
detected as broken by fix_broken_cm12_pattern().

Jira: OPO-677
Jira: BACON-4671

Change-Id: I057b0c4231f1fb19b992f379fdbe7e9aa934eafd

8 years agoDon't abort even if setexeccon failed
Chih-Wei Huang [Wed, 2 Dec 2015 16:23:44 +0000 (00:23 +0800)]
Don't abort even if setexeccon failed

8 years agovold: Fix cryptfs changepw parsing
Tom Marshall [Wed, 20 Jan 2016 21:07:25 +0000 (13:07 -0800)]
vold: Fix cryptfs changepw parsing

External tools may expect original AOSP usage.  Restore that behavior
for 3 and 4 argument invocations.  HW FDE extensions are indicated by
passing 5 arguments.

Change-Id: I1719f05c57e0e293720b5c1383c9b21b5f958aec

8 years agocryptfs: Fix OTA from cm<=12 for encrypted patterns > 9
Ricardo Cerqueira [Thu, 14 Apr 2016 14:16:26 +0000 (15:16 +0100)]
cryptfs: Fix OTA from cm<=12 for encrypted patterns > 9

L had a conversion between hex formats to avoid using 0-indexed values.
But the format conversion from pattern-to-hex in older versions was
broken and skipped out if the input had anything that wasn't a digit,
which means we were doing no conversion at all if the pattern included
dots with an index higher than 9, and stored the 0-indexed hex value
directly.

13+ doesn't do conversion at all anymore: the pattern is now stored
in raw ascii. Change Ib9953658c597515a624de106b8e0dc35b3dd0531 fixes
the migration scenario, but assumes that if the ASCII password doesn't
match, the old hex-conversion routine has to be applied. And since we
were storing the wrong hex, it doesn't match either.

So... if key matching fails, now try to identify the input as one of
those broken patterns (it has a non-digit). Convert it to the _broken_
format, and try that. And then piggypack on the aforementioned change
to complete the format migration.

Ref CYNGNOS-2461
Change-Id: I0f965e813ce34d57c6bc21b3b885946c0a21e4ee

8 years agovold: skip first disk change when converting MBR to GPT
Scott Mertz [Thu, 31 Mar 2016 20:09:56 +0000 (13:09 -0700)]
vold: skip first disk change when converting MBR to GPT

When converting a public (MBR) partition to private (GPT) partition,
'sgdisk --zap-all <path>' triggers a disk change netlink event
when converting from MBR to GPT.  Then, 'sgdisk --new=....' triggers
another disk change netlink event.

vold informs clients a new volume is created after the first disk
change event occurs.  system server reacts by requesting to mount
the volume.  If this request is honored before the second disk change
event, the volume will be unmounted immediately after system server's
request to mount is honored.  The next time system server performs
an operation (createnewuser) on this volume, it will fail due to
the volume being unmounted.

This is reproduced by running the following commands in a loop:

adb shell sm partition <disk> private
adb shell sm partition <disk> public
adb shell sm forget all

OR

run cts -c com.android.cts.appsecurity.AdoptableHostTest -m testPackageInstaller

This change causes vold to delay notifying clients that the volume is
ready until after it's actually partitioned.

CYNGNOS-2283
Change-Id: I457cc1508573d73ef2be2f0cfdc5c2237bfabad7

8 years agoFix the group permissions of the sdcard root.
Jani Lusikka [Fri, 25 Mar 2016 18:12:15 +0000 (20:12 +0200)]
Fix the group permissions of the sdcard root.

If the root is not writable, we cannot create new files or folders there.

Change-Id: I3edad81f105bbeabc9dcd1f5322acea6fbfc63bb

8 years agominivold: Use libblkid for readMetadata
Tom Marshall [Thu, 10 Mar 2016 23:55:01 +0000 (15:55 -0800)]
minivold: Use libblkid for readMetadata

We cannot popen() /sbin/blkid because selinux.

Change-Id: I0ba032c362dcfaa72443860071e5bd4d4d3b8270

8 years agoFix ioctl parameter
caozhiyuan [Thu, 29 Oct 2015 08:39:00 +0000 (16:39 +0800)]
Fix ioctl parameter

Change-Id: I922c8ae77056db81bc5152346299a07a34c527d2

8 years agocryptfs: Fix returning to default password
Ricardo Cerqueira [Tue, 16 Feb 2016 16:28:18 +0000 (16:28 +0000)]
cryptfs: Fix returning to default password

Get the current ("previous" in changes) encryption mechanism from
the crypto footer.

In devices that don't support the get_keymaster_hw_fde_passwd() call
(all "old" keymaster devices?), cryptfs was falling back to figuring
out current and previous encryption methods, and assuming the default
password accordingly. Except it was _always_ making them the same:

previous_type = crypt_type;

What is this, I don't even...

Addresses CYNGNOS-1534

Change-Id: I4aebc12c8ff76ca27ba535beff7d9fe18e9b4531

8 years agovold: Mount ext4/f2fs portable storage with sdcard_posix context
Jani Lusikka [Fri, 15 Jan 2016 20:25:47 +0000 (22:25 +0200)]
vold: Mount ext4/f2fs portable storage with sdcard_posix context

This commit is a forward port of following commits:

Author: Michael Stucki <mundaun@gmx.ch>
Change-Id: Ia34ad91444951e62f6d17374f480dcbdfa34cca3

Author: Tom Marshall <tdm@cyngn.com>
Change-Id: I05d9b57cc28ffd1f8deb8148d81c7f6fad0aa8db

Author: Pawit Pornkitprasan <p.pawit@gmail.com>
Change-Id: I1364f37018b25d79b1826c85849def64e868d72f

Author: Pawit Pornkitprasan <p.pawit@gmail.com>
Change-Id: I873af4dc2309d3d0942ce466b8acf8158abb85ae

Author: Jorge Ruesga <jorge@ruesga.com>
Change-Id: Ic0bb314b30e42489c45caec29d35d6896c9849eb

Signed-off-by: Michael Bestas <mikeioannina@cyanogenmod.org>
Change-Id: I9699643987c53d8e2538720f33da28de35230dfe

8 years agovold: Honor mount options for f2fs partitions
Michael Bestas [Wed, 20 Jan 2016 20:06:11 +0000 (22:06 +0200)]
vold: Honor mount options for f2fs partitions

* Based on 1436fc7ea3b349283a021e75fdd4f3478a2ca2e8

Change-Id: Id9491ada3bd34275a95ef9855167db6ae7a9b30f

8 years agoFix mounting ext4 adopted storage
Sam Mortimer [Mon, 18 Jan 2016 17:58:58 +0000 (09:58 -0800)]
Fix mounting ext4 adopted storage

Change-Id: I36cb858b96968a949632017874addb278679b3a4

8 years agovold ext4/f2fs: do not use dirsync if we're mounting adopted storage
Sam Mortimer [Fri, 27 Nov 2015 23:27:03 +0000 (15:27 -0800)]
vold ext4/f2fs: do not use dirsync if we're mounting adopted storage

Change-Id: I6f8ca75385c2d4080b1430c0b6545b61e6632e2c

8 years agovold: hw_fde: Fix merge damage
Ethan Chen [Thu, 14 Jan 2016 22:53:59 +0000 (14:53 -0800)]
vold: hw_fde: Fix merge damage

* framework must be told that inplace encryption has begun, otherwise
  cryptfs control flow will never be instructed to pass fde_enabled to
  dm-req-crypt.

Change-Id: I457d453a06667b652d58d9e8634f455891c8d47b

8 years agocryptfs: Set HW FDE flags when building libvold
myfluxi [Wed, 13 Jan 2016 21:36:18 +0000 (22:36 +0100)]
cryptfs: Set HW FDE flags when building libvold

Change-Id: I62e8fb77e60944edfb2a626c99df516cf959c4cc

8 years agoAlso change emulated device id separator from comma to underscore
Sam Mortimer [Fri, 18 Dec 2015 13:17:13 +0000 (05:17 -0800)]
Also change emulated device id separator from comma to underscore

Needed to fix emulated primary storage on adopted storage.

Change-Id: I22114698e480fc829090261b79824c8b65b009c3

8 years agovold: dont't use commas in device names
morckx [Tue, 24 Nov 2015 21:45:01 +0000 (22:45 +0100)]
vold: dont't use commas in device names

Fuse supports commas escaped by '\' in fs names, but exfat and ntfs-3g
currently don't support the escaping.

This fixes mounting of exFAT and NTFS public volumes.

Change-Id: I72005489956e59e7f889267114fee3921d289984

8 years agovold: hw_fde: fix OTA issues from L to M
Dinesh K Garg [Sat, 17 Oct 2015 02:27:15 +0000 (19:27 -0700)]
vold: hw_fde: fix OTA issues from L to M

L release passes user password from java layers to vold in hex encoding.
This has been changed in M release where password is coming in ascii
encoding. HW FDE used password which came from java layers directly.
This is causing OTA to fail on encrypted devices. Introduced a new flag
in M which would keep track whether password used for HW FDE is ascii
or not. All M based targets would have this flag set by default. On
OTA targets, first ascii based password would be tried but if that fails,
it would converted to hex based password and verified. If verification
fails, it would return error otherwise password would be updated with
ascii password and flag in crypto footer would be updated.

Change-Id: Ib9953658c597515a624de106b8e0dc35b3dd0531

8 years agovold: Native NTFS kernel driver support
dhacker29 [Sun, 6 Dec 2015 10:32:30 +0000 (05:32 -0500)]
vold: Native NTFS kernel driver support

Change-Id: I825b2840a03e5cdab9b68f13fd5170acbbcec2e5

8 years agoMerge tag 'android-6.0.1_r3' of https://android.googlesource.com/platform/system...
Steve Kondik [Tue, 8 Dec 2015 11:39:29 +0000 (03:39 -0800)]
Merge tag 'android-6.0.1_r3' of https://android.googlesource.com/platform/system/vold into HEAD

Android 6.0.1 release 3

Change-Id: Ia51c71dd51214c49ce434262821a4ca696ff26cc

8 years agovold: Fix fsck on public volumes
Michael Bestas [Sun, 6 Dec 2015 21:53:55 +0000 (23:53 +0200)]
vold: Fix fsck on public volumes

* Fsck was hitting a neverallow on public volumes not formatted in vfat
  because it was always using the trusted context
* Always run trusted fsck for private volumes and untrusted for public
* Exfat/ntfs are always untrusted, because they are not supported for
  private volumes, like vfat

Change-Id: I0a6ee9aea907bae9ed097b920df0559df7b45d7d

8 years agovold: Fix native exfat driver support
Ketut Putu Kumajaya [Sat, 5 Dec 2015 12:04:21 +0000 (19:04 +0700)]
vold: Fix native exfat driver support

Change-Id: I772368c0ec054a2ba86cf0ba0e37f07ba2b82fd2

8 years agovold: Native exfat driver support
Ketut Putu Kumajaya [Wed, 2 Dec 2015 09:17:23 +0000 (16:17 +0700)]
vold: Native exfat driver support

* exfat-nofuse https://github.com/dorimanx/exfat-nofuse

Change-Id: I0b7d7b3f3e21defa83e08564b3fdb67a9957edc0

8 years agof2fs: Fix kMkfsPath to match location of CM binary
dhacker29 [Sun, 29 Nov 2015 09:08:11 +0000 (04:08 -0500)]
f2fs: Fix kMkfsPath to match location of CM binary

In https://github.com/CyanogenMod/android_external_f2fs-tools/commit/c227ae2f76318cabb81d11293c01cd48e883a3c1
the location of the binary was changed to /system/bin/mkfs.f2fs

Change-Id: Ic097cd378a608fcce09c9ce819e61df215995ee3

8 years agominivold: Build as static library for linkage into recovery
Tom Marshall [Wed, 2 Dec 2015 23:25:27 +0000 (15:25 -0800)]
minivold: Build as static library for linkage into recovery

Change-Id: I76045b8e95534e32e1304d535cd0b7d09eeebffc

8 years agovold: Fix crash on startup
Christopher R. Palmer [Thu, 26 Nov 2015 01:53:45 +0000 (20:53 -0500)]
vold: Fix crash on startup

Change-Id: Ib4d1be706b8d9bddc46aa71140fdb89d4ac2e0d1

8 years agoDon't try to unmount ASEC and FUSE paths in recovery
Tom Marshall [Wed, 25 Nov 2015 21:49:40 +0000 (13:49 -0800)]
Don't try to unmount ASEC and FUSE paths in recovery

Change-Id: Ia693dffeb2865e9849b1c237b619777f61beca2f

8 years agoDo not overwrite existing metadata with empty values
Tom Marshall [Wed, 25 Nov 2015 21:46:25 +0000 (13:46 -0800)]
Do not overwrite existing metadata with empty values

This fixes an issue in recovery where storage descriptions go blank.

Change-Id: I8b324c49dbd1aef9a8831496b313ae8c2153bba8

8 years agovold: Honor mount options for ext4 partitions
Tom Marshall [Thu, 5 Nov 2015 19:20:54 +0000 (11:20 -0800)]
vold: Honor mount options for ext4 partitions

 * Save mount options and fstype for DiskPartition objects
 * Pass mount options and fstype to PublicVolume ctor
 * Pass mount options to Ext4::Mount
 * Use specified/default fstype if blkid fails

This is trivially extensible for other fs types.

Change-Id: Ie5dd27f26a4a7129dd9efe6a7ad0a589928282a0

8 years agovold: Support internal storage partitions
Tom Marshall [Wed, 4 Nov 2015 23:44:44 +0000 (15:44 -0800)]
vold: Support internal storage partitions

 * Support nonremovable disks and expose a nonremovable flag in the
   DiskCreated message.
 * New DiskPartition class to hold single partitions.  DiskPartition is
   used when the fs_mgr entry has a partnum (eg. when fs_mgr_flags
   contains voldmanaged=label:#).  Override disk partitioning methods
   to prevent destroying the emmc.

Change-Id: Id7ec3ea409b5c96e691730604e4b1e9cc3aa9d33

8 years agovold: add support for more filesystems for public storage
Dan Pasanen [Wed, 28 Oct 2015 03:52:37 +0000 (22:52 -0500)]
vold: add support for more filesystems for public storage

* Add exfat and ntfs support based off f2fs and ported to use
  fuse
* Add support for both along with f2fs and ext4 to PublicVolume
* Also attempt to mount any volume if it's been determined that
  the kernel supports it

Change-Id: I0a83761cefd97791e3ec84a18e199dfd27a5ed0b

8 years agovold: minivold for recovery
Tom Marshall [Wed, 4 Nov 2015 23:35:09 +0000 (15:35 -0800)]
vold: minivold for recovery

 * Build static linked minivold
 * Adjust tool paths for recovery
 * Skip ASEC and FUSE in recovery
 * Default volume label to fstab label
 * Add label "emulated" to emulated volume
 * Always send VolumeFsLabelChanged on volume creation
 * Add detach option to volume unmount

Change-Id: I1a943dd3e606caa6bee6a0ec1df54fed365f769a

8 years agofs: f2fs: only check for corruption and not entire partition
Alexander Martinz [Tue, 10 Nov 2015 16:03:58 +0000 (17:03 +0100)]
fs: f2fs: only check for corruption and not entire partition

  * checking the entire partition is unneccessary and causes boot delays
    as well as system lockups if using a F2FS partitioned sdcard

Change-Id: I735637308059877a24d7d8b3b9bf79fc2a51e39b
Signed-off-by: Alexander Martinz <eviscerationls@gmail.com>
8 years agoMerge branch 'LA.BF64.1.2.2_rb4.7' of git://codeaurora.org/platform/system/vold into...
Steve Kondik [Mon, 16 Nov 2015 22:45:24 +0000 (14:45 -0800)]
Merge branch 'LA.BF64.1.2.2_rb4.7' of git://codeaurora.org/platform/system/vold into cm-13.0

8 years agoMerge tag 'android-6.0.0_r26' into cm-13.0
Ricardo Cerqueira [Thu, 5 Nov 2015 00:50:49 +0000 (00:50 +0000)]
Merge tag 'android-6.0.0_r26' into cm-13.0

Android 6.0.0 release 26

8 years agovold: Fix password update bug with HW FDE
Dinesh K Garg [Fri, 23 Oct 2015 20:06:23 +0000 (13:06 -0700)]
vold: Fix password update bug with HW FDE

HW FDE has an issue where changing password does not work. Following
is the sequence that is broken:
1. Change the password to PIN/Password/Pattern
2. Change password to None/Swipe
3. Reboot the device
4. Change password to PIN and select "not required to boot device"
5. Reboot the device
6. Change password to None
7. Change password to PIN and select "Required to boot device"
8. Reboot the device.
9. None of password would work because previous password was not updated
   for HW FDE

Change-Id: Ibdfc2b7217abcff3eabff9ae11aa5198ee00181e

8 years agoMerge branch 'm' of git://codeaurora.org/platform/system/vold into cm-13.0
Steve Kondik [Thu, 22 Oct 2015 00:00:09 +0000 (17:00 -0700)]
Merge branch 'm' of git://codeaurora.org/platform/system/vold into cm-13.0

8 years agoPromote free bytes calculation to 64 bits
Oleksiy Avramchenko [Thu, 1 Oct 2015 10:44:46 +0000 (12:44 +0200)]
Promote free bytes calculation to 64 bits

The expression otherwise overflows for large devices.
It's fsblkcnt_t -> unsigned long, which is 32 bit on ARMv7.

Bug: 25162062
Change-Id: I46c5e00558b7dbd6abd50fae4727396079044df2

8 years agoKill apps using storage through bind mounts.
Jeff Sharkey [Wed, 21 Oct 2015 19:16:12 +0000 (12:16 -0700)]
Kill apps using storage through bind mounts.

When unmounting an emulated volume, look for apps with open files
using the final published volume path.

Without this change, we were only looking at the internal paths
used for runtime permissions, which apps never use directly.  This
meant we'd always fail to unmount the volume if apps didn't respect
the EJECTING broadcast, and volume migration would end up wedged
until the device rebooted.

Bug: 24863778
Change-Id: Ibda484e66ab95744c304c344b226caa5b10b7e2e

8 years agoMerge "Don't show UI on default encryption" into mnc-dr-dev
Paul Lawrence [Wed, 21 Oct 2015 14:27:30 +0000 (14:27 +0000)]
Merge "Don't show UI on default encryption" into mnc-dr-dev

8 years agovold: Add linkage for fs_mgr changes
Steve Kondik [Fri, 16 Oct 2015 13:52:14 +0000 (06:52 -0700)]
vold: Add linkage for fs_mgr changes

Change-Id: Id6623ee558a43600e474ef89f318574bdc6ba25f

8 years agoMerge "Clean up any/all stale partition tables." into mnc-dr-dev
Jeff Sharkey [Mon, 12 Oct 2015 16:34:09 +0000 (16:34 +0000)]
Merge "Clean up any/all stale partition tables." into mnc-dr-dev

8 years agovold: Remove creation of new keymaster key for password update
Dinesh K Garg [Fri, 2 Oct 2015 20:38:18 +0000 (13:38 -0700)]
vold: Remove creation of new keymaster key for password update

To update user password, VOLD creates a new keymaster key which
would be used in the process to rewrap the FDE key. These already
exists a keymaster blob which contains keymaster key created for
old password. This old keymaster blob is secure and there is no
need to create new keymaster key which can take sometime long time
as well. Hence, removing the need to create a new keymaster key which
does not enhance security but sometimes take longer time to update
user password.

Change-Id: I6ce0f71353d54cb32a11d44731b30fa41df235c8

8 years agovold: Fix return value from get_keymaster_hw_fde_passwd()
Dinesh K Garg [Mon, 28 Sep 2015 17:56:00 +0000 (10:56 -0700)]
vold: Fix return value from get_keymaster_hw_fde_passwd()

get_keymaster_hw_fde_passwd() is returing wrong value when HW FDE keys
are not tied to keymaster. Fixed the return values.

Change-Id: Icc5850b0f3154ab8e685f69f02d2a9ae17048528

8 years agoAdded cypto_complete states to reflect MDTP state.
Amit Blay [Mon, 31 Aug 2015 07:16:04 +0000 (10:16 +0300)]
Added cypto_complete states to reflect MDTP state.

Also, fixed bug in the wipe option in cryptfs_enable_internal.

Change-Id: I5b441df6fd55b9c1d40797b25c4a5d6b3bfddcc8

8 years agovold: Fix HW FDE OTA support on SW FDE encrypted device
Dinesh K Garg [Fri, 18 Sep 2015 16:55:53 +0000 (09:55 -0700)]
vold: Fix HW FDE OTA support on SW FDE encrypted device

If an OTA is delivered to a device encrypted with SW FDE, an OTA
of HW FDE should not force user to switch to HW FDE and hence wipe
of all userdata. Instead, it should continue using SW FDE until user
itself perform factory reset. After factory reset, HW FDE would be
used to encrypt the data. This support somehow was broken. This
change fixes the support.

Change-Id: If31ccbd377e5a161a90b2e4a2c53dcc52712b49c

8 years agovold: Tie HW FDE keys with Root of Trust(ROT)
Dinesh K Garg [Thu, 13 Aug 2015 18:38:16 +0000 (11:38 -0700)]
vold: Tie HW FDE keys with Root of Trust(ROT)

HW FDE keys should be tied with device's ROT. Adding required changes
to address the new requirement.

Change-Id: Id2718b48140b97868bcaef90ab9357e4e0327da6

8 years agovold: Port HW FDE features
Dinesh K Garg [Thu, 6 Aug 2015 23:31:16 +0000 (16:31 -0700)]
vold: Port HW FDE features

Following changes for HW FDE are missing which needs to be ported:
- Restart Android framework after HW FDE key has been created
- Add support of Inline Cryto Engine
- Use new HW FDE apis to update password

Change-Id: I49f16867d45a8c10fe7239f600170fd636ac3eda

8 years agomerge in mnc-dr-release history after reset to mnc-dr-dev
The Android Automerger [Fri, 2 Oct 2015 12:53:16 +0000 (05:53 -0700)]
merge in mnc-dr-release history after reset to mnc-dr-dev

8 years agovold: Retry opening block device on failure when starting encryption
David Ng [Wed, 21 Jan 2015 21:55:21 +0000 (13:55 -0800)]
vold: Retry opening block device on failure when starting encryption

The device mapper storage device node can take some time to be
created; so retry.

Bug: 23024596
Change-Id: Ieeb3b697f9cef72d4ea9d106750696901f0a224d

8 years agoClean up any/all stale partition tables.
Jeff Sharkey [Wed, 23 Sep 2015 21:13:45 +0000 (14:13 -0700)]
Clean up any/all stale partition tables.

When formatting media as a public volume, we write an MBR, but we
might leave a stale GPT floating around.  Some devices are configured
to aggressively prefer GPT when detected, even if the checksums
between primary/secondary don't match.

To work around this, nuke both MBR and GPT tables from the media
before we lay down our new MBR.

Bug: 24112219
Change-Id: Ibf1be466a6877cbab925a24db5e5dbab0613bea7

8 years agomerge in mnc-dr-release history after reset to mnc-dr-dev
The Android Automerger [Thu, 10 Sep 2015 08:04:49 +0000 (01:04 -0700)]
merge in mnc-dr-release history after reset to mnc-dr-dev

8 years agoEnable benchmark after trim, when requested.
Jeff Sharkey [Wed, 9 Sep 2015 21:55:45 +0000 (14:55 -0700)]
Enable benchmark after trim, when requested.

The framework can request that a benchmark be run after an fstrim,
but it was disabled due to a kernel bug on certain devices.  That bug
has long been fixed, so it should be safe to enable this again.

Bug: 23942769
Change-Id: Ibe967a75856d0cbad45e2f8f3120f1970caf36d0

8 years agoDon't show UI on default encryption
Paul Lawrence [Wed, 9 Sep 2015 19:13:00 +0000 (12:13 -0700)]
Don't show UI on default encryption

Bug: 22989588
Change-Id: I21403233d84031869d929c46c3c7b2ebefb3caff

8 years agomerge in mnc-dr-release history after reset to mnc-dr-dev
The Android Automerger [Thu, 3 Sep 2015 08:05:33 +0000 (01:05 -0700)]
merge in mnc-dr-release history after reset to mnc-dr-dev

8 years agoSet uid/gid of newly created user dirs to system/system.
Paul Crowley [Mon, 24 Aug 2015 13:53:28 +0000 (14:53 +0100)]
Set uid/gid of newly created user dirs to system/system.

Bug: 23395513
Change-Id: I3d76b77339f995103c0aec09c6de77b3c8cdc0dd

8 years agomerge in mnc-release history after reset to mnc-dev
The Android Automerger [Thu, 13 Aug 2015 08:08:30 +0000 (01:08 -0700)]
merge in mnc-release history after reset to mnc-dev

8 years agomerge in mnc-dr-release history after reset to mnc-dr-dev
The Android Automerger [Thu, 13 Aug 2015 08:07:34 +0000 (01:07 -0700)]
merge in mnc-dr-release history after reset to mnc-dr-dev

8 years agoam eddf9bd6: Request specific tags from blkid.
Jeff Sharkey [Wed, 12 Aug 2015 23:55:26 +0000 (23:55 +0000)]
am eddf9bd6: Request specific tags from blkid.

* commit 'eddf9bd63c1f7e0f9709f7c58a1035fa43338325':
  Request specific tags from blkid.

8 years agoRequest specific tags from blkid.
Jeff Sharkey [Wed, 12 Aug 2015 23:04:35 +0000 (16:04 -0700)]
Request specific tags from blkid.

Otherwise blkid can emit tags like SEC_TYPE which mess with the value
extraction code.

Bug: 23069906
Change-Id: Id2a588ff43a538747d1e44cd8218c96ebd0192c2

8 years agomerge in mnc-release history after reset to mnc-dev
The Android Automerger [Sat, 8 Aug 2015 08:09:57 +0000 (01:09 -0700)]
merge in mnc-release history after reset to mnc-dev

8 years agomerge in mnc-dr-release history after reset to mnc-dr-dev
The Android Automerger [Sat, 8 Aug 2015 08:07:45 +0000 (01:07 -0700)]
merge in mnc-dr-release history after reset to mnc-dr-dev

8 years agoam 1bd078fa: Protect runtime storage mount points.
Jeff Sharkey [Thu, 6 Aug 2015 19:41:34 +0000 (19:41 +0000)]
am 1bd078fa: Protect runtime storage mount points.

* commit '1bd078fa7b5ca613cb3e793d67ccd86d2602787d':
  Protect runtime storage mount points.

8 years agoProtect runtime storage mount points.
Jeff Sharkey [Thu, 6 Aug 2015 18:40:00 +0000 (11:40 -0700)]
Protect runtime storage mount points.

We have a bunch of magic that mounts the correct view of storage
access based on the runtime permissions of an app, but we forgot to
protect the real underlying data sources; oops.

This series of changes just bumps the directory heirarchy one level
to give us /mnt/runtime which we can mask off as 0700 to prevent
people from jumping to the exposed internals.

Also add CTS tests to verify that we're protecting access to
internal mount points like this.

Bug: 22964288
Change-Id: I83f09f0423f4993e766273c50389dd29b1c50589

8 years agomerge in mnc-release history after reset to mnc-dev
The Android Automerger [Sat, 1 Aug 2015 08:11:11 +0000 (01:11 -0700)]
merge in mnc-release history after reset to mnc-dev

8 years agomerge in mnc-dr-release history after reset to mnc-dr-dev
The Android Automerger [Sat, 1 Aug 2015 08:08:20 +0000 (01:08 -0700)]
merge in mnc-dr-release history after reset to mnc-dr-dev

8 years agoam 8474ee32: Return useful path when not visible.
Jeff Sharkey [Fri, 31 Jul 2015 01:51:32 +0000 (01:51 +0000)]
am 8474ee32: Return useful path when not visible.

* commit '8474ee323131fdadcc17f09eab25003a7ae934e0':
  Return useful path when not visible.

8 years agoReturn useful path when not visible.
Jeff Sharkey [Thu, 30 Jul 2015 23:54:23 +0000 (16:54 -0700)]
Return useful path when not visible.

This allows apps like ExternalStorageProvider to still read/write
files on transient storage devices which aren't mounted as visible.

Bug: 22545248
Change-Id: Idacb15f2233245a8e1861d9be977535a82b218ec

8 years agomerge in mnc-release history after reset to mnc-dev
The Android Automerger [Thu, 30 Jul 2015 08:06:06 +0000 (01:06 -0700)]
merge in mnc-release history after reset to mnc-dev

8 years agomerge in mnc-dr-release history after reset to mnc-dr-dev
The Android Automerger [Thu, 30 Jul 2015 08:05:06 +0000 (01:05 -0700)]
merge in mnc-dr-release history after reset to mnc-dr-dev

8 years agoam d46687ee: Use random data for benchmark instead of zeros.
Jeff Sharkey [Wed, 29 Jul 2015 20:10:22 +0000 (20:10 +0000)]
am d46687ee: Use random data for benchmark instead of zeros.

* commit 'd46687ee5da7c9847c6188241ccc699d3a0826c2':
  Use random data for benchmark instead of zeros.

8 years agoUse random data for benchmark instead of zeros.
Jeff Sharkey [Wed, 29 Jul 2015 16:14:21 +0000 (09:14 -0700)]
Use random data for benchmark instead of zeros.

If we always write zeros, we're leaving a giant pile of known
plaintext at an almost deterministic location on newly formatted
volumes.  To avoid this, repeat a 64K chunk of random data.

Bug: 22816936
Change-Id: Iedc067a519bd676a93b9d74ea4f9f77c84c8461c

8 years agomerge in mnc-release history after reset to mnc-dev
The Android Automerger [Wed, 29 Jul 2015 08:10:14 +0000 (01:10 -0700)]
merge in mnc-release history after reset to mnc-dev

8 years agomerge in mnc-dr-release history after reset to mnc-dr-dev
The Android Automerger [Wed, 29 Jul 2015 08:07:16 +0000 (01:07 -0700)]
merge in mnc-dr-release history after reset to mnc-dr-dev

8 years agoam 20642ae7: Give secondary users read-only physical cards.
Jeff Sharkey [Wed, 29 Jul 2015 01:34:47 +0000 (01:34 +0000)]
am 20642ae7: Give secondary users read-only physical cards.

* commit '20642ae71aa93ec2658d09c92a1ffc3844f5a555':
  Give secondary users read-only physical cards.

8 years agoGive secondary users read-only physical cards.
Jeff Sharkey [Tue, 28 Jul 2015 17:57:29 +0000 (10:57 -0700)]
Give secondary users read-only physical cards.

Long ago, we mounted secondary physical cards as readable by all
users on the device, which enabled the use-case of loading media on
a card and viewing it from all users.

More recently, we started giving write access to these secondary
physical cards, but this created a one-directional channel for
communication across user boundaries; something that CDD disallows.

This change is designed to give us the best of both worlds: the
package-specific directories are writable for the user that mounted
the card, but access to those "Android" directories are blocked for
all other users.  Other users remain able to read content elsewhere
on the card.

Bug: 22787184
Change-Id: I75dbd339f11402ae774c7e4b8f2b15ee216270e8

8 years agomerge in mnc-dr-release history after reset to mnc-dr-dev
The Android Automerger [Sat, 25 Jul 2015 08:08:34 +0000 (01:08 -0700)]
merge in mnc-dr-release history after reset to mnc-dr-dev

8 years agoam 32679a82: Create user directory on emulated storage.
Jeff Sharkey [Thu, 23 Jul 2015 19:12:57 +0000 (19:12 +0000)]
am 32679a82: Create user directory on emulated storage.

* commit '32679a82d9542ec26ea8b4e32d29dd7b02202611':
  Create user directory on emulated storage.

8 years agomerge in mnc-release history after reset to mnc-dev
The Android Automerger [Thu, 23 Jul 2015 08:07:03 +0000 (01:07 -0700)]
merge in mnc-release history after reset to mnc-dev

8 years agoCreate user directory on emulated storage.
Jeff Sharkey [Tue, 21 Jul 2015 21:22:01 +0000 (14:22 -0700)]
Create user directory on emulated storage.

When mounting a primary external storage device that is multi-user
aware, ensure that the user-specific directory actually exists before
moving forward.

Bug: 22472026
Change-Id: I33c8eed261a9c0d5acedd5be6133ed9990679d08

8 years agomerge in mnc-dr-release history after reset to mnc-dr-dev
The Android Automerger [Tue, 14 Jul 2015 08:06:47 +0000 (01:06 -0700)]
merge in mnc-dr-release history after reset to mnc-dr-dev

8 years agoEvict the key before we delete it.
Paul Crowley [Tue, 7 Jul 2015 14:17:22 +0000 (15:17 +0100)]
Evict the key before we delete it.

Change-Id: I9eef440a1f406c2c73c859f5ae7cee35f6a36ca4

8 years agoFix erroneous comment in secdiscard.cpp, plus style fixes.
Paul Crowley [Mon, 22 Jun 2015 11:32:26 +0000 (12:32 +0100)]
Fix erroneous comment in secdiscard.cpp, plus style fixes.

Bug: 19706593

(cherry picked from commit 747e1f7a6d0ae43fce33217e6f0215ceeaf44617)

Change-Id: I9a605c736a2fa909cd4999e1e8d022d49a562767

8 years agoScrub the key from the disk with BLKSECDISCARD.
Paul Crowley [Tue, 19 May 2015 16:31:39 +0000 (17:31 +0100)]
Scrub the key from the disk with BLKSECDISCARD.

Bug: 19706593

(cherry-picked from commit 8d0cd7ffd903a753c6bb5c6f33987a7a66621cef)

Change-Id: Ieea73da233fe53767b5adcdb4d49f9bb00fedac1