Commit graph

23 commits

Author SHA1 Message Date
Geremy Condra
3ad3d1c4b5 Add basic verity support to fs_mgr.
This change adds a "verify" fs_mgr flag specifying that
the device in question should be verified.

Devices marked with this flag are expected to have a
footer immediately after their data containing all
the information needed to set up a verity instance.

Change-Id: I10101f2c3240228ee0932e3767fe35e673d2e720
2013-08-06 22:15:58 -07:00
Elliott Hughes
81274e9e6c am 6b78fad1: am a9396549: Fix my incorrect merge resolution for 132b7d750e harder.
* commit '6b78fad147c772075eae5cfc25f5a50748bc4015':
  Fix my incorrect merge resolution for 132b7d750e harder.
2013-07-11 19:12:18 -07:00
Elliott Hughes
a9396549b3 Fix my incorrect merge resolution for 132b7d750e harder.
Change-Id: I3f8bc955f035b49407540053462e53b3f262d381
2013-07-11 19:07:06 -07:00
Elliott Hughes
ae118966da am 43564031: am 7b9c33b1: Fix my incorrect merge resolution for 132b7d750e.
* commit '435640312ce48dab201d6f26a6258143a82f551e':
  Fix my incorrect merge resolution for 132b7d750e.
2013-07-11 19:05:32 -07:00
Elliott Hughes
7b9c33b1e0 Fix my incorrect merge resolution for 132b7d750e.
The conflict was the actual intended change.

Change-Id: Icc9493e4b24b7b53a18e2c7406ef24a81e4d4a7b
2013-07-11 18:58:07 -07:00
Elliott Hughes
ad989d038e am dccd7773: am 786b1232: resolved conflicts for merge of 42031e0e to stage-aosp-master
* commit 'dccd77730754b681f3517308359a34f86aecd99f':
  fs_mgr_priv: Extend fs wait timeout to 20 seconds
2013-07-11 18:52:12 -07:00
Elliott Hughes
786b1232d2 resolved conflicts for merge of 42031e0e to stage-aosp-master
Change-Id: I3e6337c258b3e7fb6eee4ed8e3664a69ae219fd6
2013-07-11 18:48:30 -07:00
Ken Sumrall
42031e0ed7 Merge "fs_mgr_priv: Extend fs wait timeout to 20 seconds" 2013-07-10 22:42:37 +00:00
Ken Sumrall
5bc31a2632 Add support for swap entries in fstab
Swap entries can optionally specify a swapprio= or zramsize= flag
in the fs_mgr flags field.

Change-Id: I30530501efd4112af4e158898a9f65f6443c4fdb
2013-07-09 15:04:56 -07:00
Nick Kralevich
e18c0d508a fs_mgr: make block devices read-only
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
2013-04-24 08:53:26 -07:00
Ken Sumrall
ebbe980790 Include liblog in fs_mgr to fix the build.
A recent change to how libcutils is built requires liblog
to be explicitly included in the link list if it's needed.

Change-Id: I8547f5e65c488c8f6e314ccd4eb96606742272be
2013-04-15 12:33:17 -07:00
Ken Sumrall
bf021b4cd7 fs_mgr: Capture the output of e2fsck and add to the kernel log
Currently, the output of e2fsck is not saved, and we have no insight
into how many errors e2fsck is finding and fixing.  Using the new
abbreviated logging feature in liblogwrap, up to the first 100 lines,
and last 4K bytes of the output of e2fsck is captured by fs_mgr, and
added to the kernel log.

Usually, the filesystem will be clean, and this will only add a few
lines to the kernel log on boot, but when things go wrong, it should
save enough to indicate what the problem is, without potentially
filling the kernel log with only e2fsck output if the filesystem is
really corrupted.

Change-Id: I9c264798e6fe721c8f818b5ce15d0975027ddbdd
2013-04-14 17:11:00 -07:00
Ken Sumrall
6c2c121386 fs_mgr: add support for new recoveryonly flag
If a device has an ext4 partition that contains the radio
firmware, and that filesystem is not mounted in normal
operation, we need a flag to prevent mount_all from
mounting it, so the new flag recoveryonly was added.

Change-Id: I361800c494e751b04c4faf956870f15fd0d8fe20
2013-02-22 17:40:58 -08:00
Ken Sumrall
ab6b852235 fs_mgr: support a unified fstab format.
Update fs_mgr to support more flags needed to unify the 3
fstabs currently in android into one.

Change-Id: Ie46cea61a5b19882c55098bdd70f39e78fb603be
2013-02-19 10:18:42 -08:00
Andrew Boie
132b7d750e fs_mgr_priv: Extend fs wait timeout to 20 seconds
In practice 5 seconds is too short to wait for a disk device node to
show up if the disk is USB; 20 seconds is a much more comfortable
window.

Change-Id: Iaf2c1f46b41a44fc1240d52d8498ca9cb639ea80
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2013-01-04 12:20:16 -08:00
Ken Sumrall
1626b98c5b am 7fd51b36: am b20fa762: Merge "Fix fs_mgr to properly invoke e2fsck on encrypted devices" into jb-mr1.1-dev
* commit '7fd51b36dabedee4de159213237e71ba20865812':
  Fix fs_mgr to properly invoke e2fsck on encrypted devices
2012-11-12 11:50:22 -08:00
Ken Sumrall
d42d327c17 Fix fs_mgr to properly invoke e2fsck on encrypted devices
Change-Id: Ie220f5cb7b614a48ec8afe66f4721ede3a368166
2012-11-06 17:55:37 -08:00
Elliott Hughes
0726652874 am cfd7c2a0: am 1c0c5250: Merge "Rename getline to fs_getline for fs_mgr"
* commit 'cfd7c2a05166a3ff27b2145b007834408d95a2e0':
  Rename getline to fs_getline for fs_mgr
2012-09-26 15:03:19 -07:00
Elliott Hughes
cfd7c2a051 am 1c0c5250: Merge "Rename getline to fs_getline for fs_mgr"
* commit '1c0c52503dcedff1a75775bf8bfffe7ec77b722b':
  Rename getline to fs_getline for fs_mgr
2012-09-26 15:01:25 -07:00
Irina Tirdea
295b82bd69 Rename getline to fs_getline for fs_mgr
fs_mgr defines its own version of getline and uses it
internally. This leads to a build error if getline is
also defined in bionic, since fs_mgr will see readline
as defined internally.

Rename getline in fs_mgr to a local name (fs_getline)
so that there will no longer be any conflicts.

This is needed it we want to add getline in bionic.

Change-Id: I3a32be71a645e122629802d98ff8f9ab9c419e86
Signed-off-by: Irina Tirdea <irina.tirdea@intel.com>
2012-09-12 19:48:51 +03:00
Jeff Sharkey
e50ac5f777 Support shared-subtree and bind mount flags.
Bug: 6925012
Change-Id: Id8d887d17c6b1b2f90cfd1a1de991ccaba730b7d
2012-08-14 12:38:14 -07:00
Ken Sumrall
5dc5bfefa0 Mount/unmount filesystems before running e2fsck
This works around a performance problem in the firmware of
some emmc chips.

Change-Id: Ia414b4604d11e47ce9cb3f86ac82602e081bb09e
2012-07-24 17:24:04 -07:00
Ken Sumrall
c1bf89663c A filesystem manager library to mount filesystems for init.
Instead of specifying in init what to mount, and having various hacks in init
itself to deal with encryption, use a filesystem manager library to do the
work, that can also be invoked by vold when mounting an encrypted volume.
Keep all the magic filesystem info an a device specific fstab file.

Change-Id: Ib988f1e4fb0638ba1d5fd98407fa6d8cf862aaca
2012-05-01 13:14:14 -07:00