Commit graph

19 commits

Author SHA1 Message Date
Jeff Sharkey
f7e86ead9f Some CLOEXEC love.
Bug: 19993667
Change-Id: If8c0b346820f30c6a7dac495f935be17d677ffcc
2015-04-01 23:07:19 -07:00
Jeff Sharkey
95c87cce35 Different blkid and fsck execution domains.
vold works with two broad classes of block devices: untrusted devices
that come in from the wild, and trusted devices like PrivateVolume
which are encrypted.

When running blkid and fsck, we pick which SELinux execution domain
to use based on which class the device belongs to.

Bug: 19993667
Change-Id: I2695f028710a4863f0c3b2ed6da437f466401272
2015-04-01 14:08:40 -07:00
Jeff Sharkey
36801cccf2 Progress towards dynamic storage support.
Wire up new Disk and VolumeBase objects and events to start replacing
older DirectVolume code.  Use filesystem UUID as visible PublicVolume
name to be more deterministic.

When starting, create DiskSource instances based on fstab, and watch
for kernel devices to appear.  Turn matching devices into Disk
objects, scan for partitions, and create any relevant VolumeBase
objects.  Broadcast all of these events towards userspace so the
framework can decide what to mount.

Keep track of the primary VolumeBase, and update the new per-user
/storage/self/primary symlink for all started users.

Provide a reset command that framework uses to start from a known
state when runtime is restarted.  When vold is unexpectedly killed,
try recovering by unmounting everything under /mnt and /storage
before moving forward.

Remove UMS sharing support for now, since no current devices support
it; MTP is the recommended solution going forward because it offers
better multi-user support.

Switch killProcessesWithOpenFiles() to directly take signal.  Fix
one SOCK_CLOEXEC bug, but SELinux says there are more lurking.

Bug: 19993667
Change-Id: I2dad1303aa4667ec14c52f774e2a28b3c1c1ff6d
2015-03-30 19:46:31 -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
Jeff Sharkey
ba6ae8db13 Add support for more expressive SD card permissions
We now run an sdcard fuse daemon on top of a physical SD card.
Add support for that.

Bug: 10330128

Change-Id: I6a291f861ccb0f2911c07cc8f659e2cec4e6d76c
2013-10-08 10:13:04 -07:00
Ken Sumrall
b9738ea969 vold: set klog level so e2fsck output is logged
When mounting an encrypted filesystem vold calls fs_mgr, which
will call e2fsck on the fielsystem if it's configured to, and
fs_mgr will attempt to log the output the kernel log. However,
if won't log anything unless the klog level is set to 6, aka INFO.

Change-Id: I8ac34941330262ea3414681b872fbbeb75391461
2013-04-10 02:28:55 -07:00
Ken Sumrall
56ad03cae1 vold: use unified fstab format
Change vold to use the unified fstab.  This includes both
support for sdcards, and changes to the crypto code to work
with some changes to the fs_mgr library api.

Change-Id: Id5a8aa5b699afe151db6e31aa0d76105f9c95a80
2013-02-15 18:21:56 -08:00
Ken Sumrall
29d8da8cef vold: allow to store key in a file on another partition
Add support for keeping the keys in a separate file on another partition,
for devices with no space reserved for a footer after the userdata filesystem.

Add support for encrypting the volumes managed by vold, if they meet certain
criteria, namely being marked as nonremovable and encryptable in vold.fstab.
A bit of trickiness is required to keep vold happy.

Change-Id: Idf0611f74b56c1026c45742ca82e0c26e58828fe
2011-06-02 16:30:14 -07:00
Jean-Baptiste Queru
c1d80272b1 am 08da5c1f: Merge "vold: replace strsep by strtok_r"
* commit '08da5c1f17afefe3c9f4f4d4456c5757dede62e1':
  vold: replace strsep by strtok_r
2010-11-19 17:24:49 -08:00
Jinho You
74ca25a716 vold: replace strsep by strtok_r
It permits more white spaces between words in vold.fstab.

Change-Id: I38250c3dcc860643e4f102e980fe844693a1451a
2010-11-19 17:01:48 -08:00
Mike Lockwood
99635f6c28 Use new kernel notifications to determine if USB mass storage is available.
The usb_mass_storage switch no longer exists in our 2.6.35 kernel.
Instead we will consider mass storage to be available if both USB is connected
and the USB mass storage function is enable.

Change-Id: I730d1b3cb3cac664fc2abcdc36cd39856a08404a
Signed-off-by: Mike Lockwood <lockwood@android.com>
2010-06-28 08:57:00 -04:00
San Mehat
97ac40e4e6 vold: Switch from LOG -> SLOG
Change-Id: I48ee8bd90b47f5845f069cdf4d1b8ba6ecdb1b39
Signed-off-by: San Mehat <san@google.com>
2010-03-25 08:02:28 -07:00
San Mehat
f1b07fb5e3 vold: Don't bail out on init failure & bump version number
Signed-off-by: San Mehat <san@google.com>
2010-03-02 13:16:33 -08:00
San Mehat
79e31bedca vold2: Don't bail out if the UMS switch isn't there
Signed-off-by: San Mehat <san@google.com>
2010-01-04 08:30:00 -08:00
San Mehat
0cde53ce7b vold2: Manually bootstrap the ums switch since switch kernel uevents are broken
Signed-off-by: San Mehat <san@google.com>
2010-01-01 10:57:33 -08:00
San Mehat
a2677e4ad0 vold2: Get mounting/unmounting/formatting/sharing working
Signed-off-by: San Mehat <san@google.com>
2009-12-19 09:54:42 -08:00
San Mehat
ae10b91044 vold2: Rename DeviceVolume -> DirectVolume
Signed-off-by: San Mehat <san@android.com>
2009-10-12 15:03:15 -07:00
San Mehat
3578c41ef1 vold2: Add block device udev bootstrapping
Signed-off-by: San Mehat <san@android.com>
2009-10-12 15:03:14 -07:00
San Mehat
f1b736bc56 system: vold2: Initial skeleton for vold2.
Let there be light.

Signed-off-by: San Mehat <san@android.com>
2009-10-10 17:57:51 -07:00