Commit graph

241 commits

Author SHA1 Message Date
Brad Fitzpatrick
08cd8f76bf am 1b15d463: Add some missing closes on error conditions.
Merge commit '1b15d463d4816fc084767cbeda3ee69ff5527545' into gingerbread-plus-aosp

* commit '1b15d463d4816fc084767cbeda3ee69ff5527545':
  Add some missing closes on error conditions.
2010-09-20 11:45:40 -07:00
Brad Fitzpatrick
1b15d463d4 Add some missing closes on error conditions.
Also, some formatting fixes to get back into line with netd's copy of
logwrapper.c.

Change-Id: Id471b99e9c3c8c9bb0890ca0d5e1567125e35bd7
2010-09-20 11:11:46 -07:00
Mike Lockwood
3374b41f1f am 2dfe297e: Fixes for devices with internal FAT file system:
Merge commit '2dfe297ec47559dbe2297a72bea71cf515c03797' into gingerbread-plus-aosp

* commit '2dfe297ec47559dbe2297a72bea71cf515c03797':
  Fixes for devices with internal FAT file system:
2010-09-17 15:58:04 -07:00
Mike Lockwood
2dfe297ec4 Fixes for devices with internal FAT file system:
Only share a single partition via UMS if a specific partition
is specified in vold.fstab (rather than "auto")

Do not fail to reformat if MBR cannot be found.

Change-Id: I544ca2ee325c308af656ab9f4732c788a964c156
Signed-off-by: Mike Lockwood <lockwood@android.com>
2010-09-17 18:50:51 -04:00
Kenny Root
90d92f11ab am a3e06084: Allow execute on mounted ASEC and OBB containers
Merge commit 'a3e06084564c86ff618c40f185f3676b8b629b94' into gingerbread-plus-aosp

* commit 'a3e06084564c86ff618c40f185f3676b8b629b94':
  Allow execute on mounted ASEC and OBB containers
2010-09-02 13:25:27 -07:00
Kenny Root
a3e0608456 Allow execute on mounted ASEC and OBB containers
This allows us to place shared libraries in these containers which may
only be loaded if they are executable.

Change-Id: I78fa9ab6d5c58ec8b98c40004da72aebc0aade2a
2010-09-02 13:16:53 -07:00
Ethan
2c7d5761d2 am 75a3e1a9: VOLD - make volume daemon to handle state change from shared to no_media
Merge commit '75a3e1a95af0a2790de1b12aeca0008bfdc61649' into gingerbread-plus-aosp

* commit '75a3e1a95af0a2790de1b12aeca0008bfdc61649':
  VOLD - make volume daemon to handle state change from shared to no_media
2010-08-30 13:20:44 -07:00
Ethan
75a3e1a95a VOLD - make volume daemon to handle state change from shared to no_media
When volume state changed from shared to no_media,
    volume is not properly unshared.

Change-Id: I0117d67da95440d982275746a166ef6f4ac1c0e2
Signed-off-by: Ethan <ethan.too@gmail.com>
2010-08-30 09:07:59 -07:00
Jean-Baptiste Queru
582677b50c am 826bec79: Merge "vold: remove unnecessary code from VolumeManager::unshareVolume()"
Merge commit '826bec79ea253505813d125700a12816e2c3bc0f' into gingerbread-plus-aosp

* commit '826bec79ea253505813d125700a12816e2c3bc0f':
  vold: remove unnecessary code from VolumeManager::unshareVolume()
2010-07-29 11:31:13 -07:00
Jean-Baptiste Queru
826bec79ea Merge "vold: remove unnecessary code from VolumeManager::unshareVolume()" 2010-07-29 11:21:44 -07:00
Bruce Beare
8f295e9dee am d766090b: Avoid array overrun. We can now mount the /sdcard partition on our boot sdcards
Merge commit 'd766090b7a72562be9e64700e13882663004650e' into gingerbread-plus-aosp

* commit 'd766090b7a72562be9e64700e13882663004650e':
  Avoid array overrun. We can now mount the /sdcard partition on our boot sdcards
2010-07-29 11:19:15 -07:00
Seth Forshee
b2b3d2cd34 vold: remove unnecessary code from VolumeManager::unshareVolume()
Signed-off-by: Seth Forshee <seth.forshee@garmin.com>
2010-07-23 03:31:57 -05:00
Bruce Beare
d766090b7a Avoid array overrun. We can now mount the /sdcard partition on our boot sdcards
Change-Id: I6e9db8c55db49b4aa61dd40cd59495f55e5b3368
Signed-off-by: Bruce Beare <brucex.j.beare@intel.com>
2010-07-22 13:30:11 -07:00
Kenny Root
e17e91f63b Fix loop_info/loop_info64 impedance mismatch
LOOP_GET_STATUS64 isn't useful here since the data contained within
isn't actually checked, so stick with the regular LOOP_GET_STATUS here
to match the struct loop_info we're using.

Change-Id: I4f9ff06fa44d4ae3aed046d423054554f9cf450b
2010-07-16 16:28:49 -07:00
Kenny Root
508c0e1605 Additional Obb functionality
* Rename all functions dealing with OBB files to mention Obb

* Add 'path' and 'list' functionality to OBB commands

* Store hashed filename in loop's lo_crypt_name and keep lo_file_name
  for the real source filename. That way we can recover it later with an
  ioctl call.

Change-Id: I29e468265988bfb931d981532d86d7be7b3adfc8
2010-07-15 12:41:01 -07:00
Kenny Root
fb7c4d5a8a Add image mounting commands for OBB files
Allow the mounting of OBB filesystem images if they're encrypted with
twofish and in FAT filesystem format.

Change-Id: I54804e598f46b1f3a784ffe517ebd9d7626de7aa
2010-07-07 08:14:32 -07: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
Kenny Root
acc9e7dcca Change ASCII conversion for hash and add tests
Hash was printed using snprintf(), but we can just write yet another hex
conversion utility!

Change-Id: I04f1992deaf5bf1b3e2751c8f07072f8ed6660e9
2010-06-20 22:03:10 -07:00
Nick Kralevich
f69b3b9af7 Get rid of warnings when compiled with -Wformat-security
Change-Id: I27e0819aba347e26051ad771c594b69700da1721
2010-05-14 10:37:37 -07:00
San Mehat
1a06edaf4d vold: Ensure we cleanup secure containers on card removal.
Fixes bug: http://b/issue?id=2567572

Note: The framework will still likely restart since the system_server
is holding references to assets on the card which are mmaped, but
at least now storage will be available when a new card is re-inserted.

Change-Id: I4e195c0c666426b93da47198fa826a6f58d855a9
Signed-off-by: San Mehat <san@google.com>
2010-04-15 12:59:15 -07: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
Kenny Root
da62e7c002 Revert "Prevent null pointer deref in DirectVolume"
This reverts commit a9f423dd7e.
2010-03-24 20:18:00 -07:00
Kenny Root
a9f423dd7e Prevent null pointer deref in DirectVolume
There's a possibility that if something were messed up a call to
NetlinkEvent::findParam could return a NULL. Passing NULL as the
argument into atoi() would cause a null pointer dereference.

Change-Id: Ib071afbbe2adc341108c245ffa596cc8730bd8fd
2010-03-24 15:39:08 -07:00
San Mehat
88ac2c0653 vold: asec path cmd now returns OpFailedStorageNotFound if id doesn't exist
Change-Id: Icbe3de7c28505f7496c8f8edea126c7b616de475
Signed-off-by: San Mehat <san@google.com>
2010-03-23 11:15:58 -07:00
San Mehat
96597e8b84 vold: Add mounted filesystems to dump cmd
Change-Id: If025e7ee10a79ff089920a6d0c1a52358b2d2c22
Signed-off-by: San Mehat <san@google.com>
2010-03-17 09:50:54 -07:00
Kenny Root
7b18a7b36f vold: Convert to use OpenSSL MD5 API
Change-Id: I9b84370fa9a98464c211ebe8983be8dbe9dd7ccd
2010-03-15 14:39:40 -07:00
San Mehat
befd59c152 vold: remove some dead code
Change-Id: Iaeb5d3334ec22ed31da9734bb8d7cd17e6a40eaf
Signed-off-by: San Mehat <san@google.com>
2010-03-15 10:28:21 -07:00
San Mehat
cb4dac8a52 vold: Remove autorun.inf at mount/unmount time if it exists
Change-Id: Ia57da8ee177453a601a23d965c2b4f16b6de46e5
Signed-off-by: San Mehat <san@google.com>
2010-03-14 13:41:54 -07:00
San Mehat
57df7bf339 vold: Fix argument validation for volume commands
Change-Id: I74aa63ff9f9bc32bd871e6c53ab50b6baf79e650
Signed-off-by: San Mehat <san@google.com>
2010-03-14 13:41:27 -07:00
San Mehat
d9a4e35861 vold: Bugfixes & cleanups
- Fix issue where container-names > 64 bytes were getting truncated in the
    kernel. lo_name is only 64 bytes in length, so we now hash the container
    id via md5
  - Add 'dump' command to dump loop and devicemapper status
  - Add 'debug' command to enable more detailed logging at runtime
  - Log vold IPC arguments (minus encryption keys)
  - Fix premature return from Loop::lookupActive() and friends

Change-Id: I0e833261a445ce9dc1a8187e5501d27daba1ca76
Signed-off-by: San Mehat <san@google.com>
2010-03-13 16:42:19 -08:00
San Mehat
2a5b8ce09b vold: Switch to using libdiskconfig for partition setup.
Also handles an issue where NPARTS=0 on a disk change uevent

Change-Id: I77c56f177dc65df91468bbd7d5fe1889db414d7a
Signed-off-by: San Mehat <san@google.com>
2010-03-10 15:18:41 -08:00
Jean-Baptiste Queru
d071596fd9 Add an empty CleanSpec.mk
Change-Id: Ied5f7eddd18adb38699c8a034a78ff9de4aab8de
2010-03-08 18:05:25 -08:00
San Mehat
fcf24fe62f vold: Add a versioned superblock to secure containers.
Add an un-encrypted superblock to the end of a secure container to
help identify the crypto cipher used. This is required in order to
provide some semblence of versioning, in case we have cause to
change the crypto type on an update - say for example switching
from software to hardware encryption, or from 128 -> a zillion
bit keys.

NOTE: This format is incompatible with previous secure containers.
After this change they will no longer be mountable.

Signed-off-by: San Mehat <san@google.com>
2010-03-03 12:40:34 -08:00
San Mehat
2350c44ff3 vold: Add support for xwarp
Signed-off-by: San Mehat <san@google.com>
2010-03-02 13:17:02 -08: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
a1091cb0c4 vold: Allow creation of a container with no filesystem
Signed-off-by: San Mehat <san@google.com>
2010-02-28 20:17:20 -08:00
San Mehat
55013f7131 vold: Fix uninitialized mountpoint bug
Signed-off-by: San Mehat <san@google.com>
2010-02-24 12:12:34 -08:00
San Mehat
12f4b89046 vold: Retry rmdir of asec mount point
Signed-off-by: San Mehat <san@google.com>
2010-02-24 11:43:22 -08:00
San Mehat
96956ed0e2 vold: Prohibit container rename when dst container is mounted
Signed-off-by: San Mehat <san@google.com>
2010-02-24 08:42:51 -08:00
San Mehat
0e382532f3 vold: fix infinite loop when failing to unmount a busy container in unmountVolume()
Signed-off-by: San Mehat <san@google.com>
2010-02-24 08:25:55 -08:00
San Mehat
52c2ccb6d2 vold: Make asec sdcard dir a hidden dir
Signed-off-by: San Mehat <san@google.com>
2010-02-23 18:26:13 -08:00
San Mehat
3bb6020e46 vold: Stage the mounting of media to hide the ASEC imagefile directory
In order to protect the '/android_secure' directory on VFAT removable media
from being mucked with by 3rd party applications on the device, we hide the
directory with a read-only, zero-sized tmpfs mounted on-top. A reference to the
hidden directory is kept by a bind-mount which is mounted at a location which
only root can access.

Staging consists of:
  1. Mount checked media at a secure location (/mnt/secure/staging)
  2. Ensure /android_secure exists on the media, (creating if it doesnt)
  3. Bind-mount /mnt/secure/staging/android_secure -> /mnt/secure/asec
     (where only root can access it)
  4. Mount an RDONLY zero-sized tmpfs over /mnt/secure/staging/android_secure
  5. Atomically move /mnt/secure/staging to the publicly accessable storage
     directory (/mnt/sdcard)

Signed-off-by: San Mehat <san@google.com>
2010-02-19 18:14:36 -08:00
San Mehat
8f2875b297 vold: Clean up asec command response and add support for 'StorageBusy'
Signed-off-by: San Mehat <san@google.com>
2010-02-18 11:48:50 -08:00
San Mehat
4ba8948dc1 vold: Add 'force' option to anything that can cause an unmount
Signed-off-by: San Mehat <san@google.com>
2010-02-18 11:48:49 -08:00
San Mehat
d31e380bd9 vold2: Don't allow containers < 1mb, and clean up some logging
Signed-off-by: San Mehat <san@google.com>
2010-02-18 11:48:49 -08:00
Kenny Root
b3b4318ab8 Check length of filenames before strcat
Just in case someone tries to set up a series of links to trick us, do a
quick sanity check on the total length of the strings we're about to
concatenate.

Change-Id: Iba9617008dbc1e93e1907393052caf1e52fbe312
2010-02-18 09:35:35 -08:00
San Mehat
586536c60b vold: Refactor Processkiller and add command to return users of a mount point
Signed-off-by: San Mehat <san@google.com>
2010-02-16 17:12:00 -08:00
San Mehat
8c940ef7db vold: Fix devmapper/ptmx fd leak, and give asec unmount more time
Signed-off-by: San Mehat <san@google.com>
2010-02-13 18:59:48 -08:00
Jean-Baptiste Queru
c6fc646af4 am 4468682c: Merge from open-source master
Merge commit '4468682c7035d431c6154ab298c5ce0f9e2350f8'

* commit '4468682c7035d431c6154ab298c5ce0f9e2350f8':
  new project, first commit
2010-02-11 12:20:09 -08:00
Jean-Baptiste Queru
4468682c70 Merge from open-source master 2010-02-11 11:03:05 -08:00