summaryrefslogtreecommitdiffstats
path: root/toolbox/mount.c
Commit message (Collapse)AuthorAgeFilesLines
* Merge "fs_mgr: make block devices read-only"Nick Kralevich2013-04-251-0/+22
|\
| * fs_mgr: make block devices read-onlyNick Kralevich2013-04-241-0/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When a filesystem is mounted read-only, make the underlying block device read-only too. This helps prevent an attacker who is able to change permissions on the files in /dev (for example, symlink attack) from modifying the block device. In particular, this change would have stopped the LG Thrill / Optimus 3D rooting exploit (http://vulnfactory.org/blog/2012/02/26/rooting-the-lg-thrill-optimus-3d/) as that exploit modified the raw block device corresponding to /system. This change also makes UID=0 less powerful. Block devices cannot be made writable again without CAP_SYS_ADMIN, so an escalation to UID=0 by itself doesn't give full root access. adb/mount: Prior to mounting something read-write, remove the read-only restrictions on the underlying block device. This avoids messing up developer workflows. Change-Id: I135098a8fe06f327336f045aab0d48ed9de33807
* | mount: fix incorrect string length calculationNick Kralevich2013-04-241-3/+4
|/ | | | | | | | | | | | Fix bug https://code.google.com/p/android/issues/detail?id=54192 which incorrectly calculated the length of a string. Fix compiler warning: system/core/toolbox/mount.c:59:2: warning: initializer-string for array of chars is too long [enabled by default] system/core/toolbox/mount.c:59:2: warning: (near initialization for 'options[16].str') [enabled by default] Change-Id: If8663f8311c6348a730fcf731d402b57fee10cb5
* Iteration on multi-user external storage.Jeff Sharkey2012-08-221-0/+5
| | | | | | | | | | Define /storage as top-level concept, so that we enforce permissions uniformly. Moves external storage paths from headers to per-device environment variables. Added missing mount flags, and we no longer have adb-specific external storage. Bug: 6925012 Change-Id: Ic7ca953be2f552d3f0ec9e69f89fef751daa1b29
* Add -o loop= option to mount, and fix error detection in mount and umountKen Sumrall2011-07-131-11/+19
| | | | | | | | | | This fixes bug http://b.android.com/18419, which complains about a bogus error check in the mount command (it also was wrong in the umount command) and also asks for the mount command to support more than one loopback device, as mentioned in the FIXME comments in mount.c. This required some corresponding changes to umount.c Change-Id: Ib796c70926395e61557e487bad64984d3295d5f3
* mount: Add support for remounting without specifying deviceColin Cross2010-05-071-3/+51
| | | | Change-Id: I48c84fab3ab2a9704ec5b7bf7002b8960fa53c27
* am 383688b5: toolbox: Fix uninitalized stack variable in mount.Dima Zavin2009-07-011-1/+1
|\ | | | | | | | | | | | | Merge commit '383688b52fb19b9c4d98bb1a660febc880d0e268' * commit '383688b52fb19b9c4d98bb1a660febc880d0e268': toolbox: Fix uninitalized stack variable in mount.
| * toolbox: Fix uninitalized stack variable in mount.Dima Zavin2009-06-291-1/+1
| | | | | | | | Signed-off-by: Dima Zavin <dima@android.com>
| * auto import from //depot/cupcake/@135843The Android Open Source Project2009-03-031-0/+273
| |
| * auto import from //depot/cupcake/@135843The Android Open Source Project2009-03-031-273/+0
| |
* | Open file and loop device with O_RDONLY when -o loop,ro.Jay Freeman (saurik)2008-11-161-2/+5
|/ | | | Otherwise: ioctl LOOP_SET_FD failed: Bad file number.
* Initial ContributionThe Android Open Source Project2008-10-211-0/+273