Commit graph

2574 commits

Author SHA1 Message Date
Treehugger Robot
0a0b5b5f02 Merge "Fix include order" 2019-06-08 01:30:38 +00:00
Treehugger Robot
fc4ad04ffe Merge "Defer deleteKey in KeyStorage in Checkpointing mode" 2019-06-07 22:48:00 +00:00
Treehugger Robot
a2518c7fe7 Merge "Restore historical behavior with fsck_msdos (always accept fixes)." 2019-06-07 22:05:20 +00:00
Daniel Rosenberg
d2906b8b5f Fix include order
Change-Id: Id839cc52801f3d0fce2d46faecf813812613e431
Test: None
2019-06-07 14:18:40 -07:00
Daniel Rosenberg
a48730a0fd Defer deleteKey in KeyStorage in Checkpointing mode
Don't delete keys in checkpointing mode. Instead wait until the
checkpoint has been committed.

Bug: 134631661
Test: Flash A with a working build. Flash B with a broken build. Test
      that the device rolls back to A without getting sent to recovery.
Merged-In: Ie5fc2d098355e2d095c53e9a95a6a8c7ab7ed051
Change-Id: Ie5fc2d098355e2d095c53e9a95a6a8c7ab7ed051
2019-06-07 14:11:01 -07:00
Xin Li
3d3a9a7f1c Restore historical behavior with fsck_msdos (always accept fixes).
Bug: 133725065
Change-Id: I1d50a7e52fda34e59eb6f051c7fde115a6cd5255
2019-06-06 11:33:51 -07:00
Treehugger Robot
94f300295d Merge "Match src paths with aidl package name" 2019-06-06 02:19:19 +00:00
Dan Willemsen
87c7f882dd Match src paths with aidl package name
In order for the build system to track updates to the header files
during incremental builds, always specify the src files using the same
path as the package for C++ compilations.

Bug: 112114177
Test: treehugger
Change-Id: I9a2d638cbde46f67e2d5761f5b5113cc7e068ec5
2019-06-05 17:03:31 +00:00
David Anderson
bc5818774c Merge "Replace manual dm ioctls with libdm." 2019-05-21 21:46:38 +00:00
Nick Kralevich
07d6eff5d5 Merge "FsCrypt.cpp: Do delayed restorecon on /data/vendor_ce"
am: 3b290ece1a

Change-Id: I7d25b2611fb9c8e84139e3a00ccd88a1cc145f3b
2019-05-15 12:25:11 -07:00
Treehugger Robot
3b290ece1a Merge "FsCrypt.cpp: Do delayed restorecon on /data/vendor_ce" 2019-05-15 19:06:04 +00:00
Nick Kralevich
1bfc01e663 FsCrypt.cpp: Do delayed restorecon on /data/vendor_ce
When Android boots after file_contexts has changed, the boot process
walks the entire /data partition, updating any changed SELinux labels as
appropriate. However, credential encrypted ("ce") directories are
deliberately excluded from this early boot directory walk. Files within
ce directories have their filenames encrypted, and as a result, cannot
match the file_contexts entries. Only after the user has unlocked their
device are the unencrypted filenames available and a restorecon
appropriate.

Ensure that we do a post-unlock restorecon on /data/vendor_ce, like we
do for /data/system_ce and /data/misc_ce. This ensures the labels on
files within these directories are correct after the device has been
unlocked.

(cherrypicked from commit 6a3ef488e5)

Bug: 132349934
Test: See bug 132349934 comment #12 for test procedure
Change-Id: Ifcbef5fdfb236ec6dea418efa9d965db3a3b782f
2019-05-15 09:33:13 -07:00
David Anderson
b92247368a Replace manual dm ioctls with libdm.
This mostly 1:1 replaces manual ioctls to device-mapper with calls to
libdm. There were two exceptions:

(1) There is a very old table-load-retry loop to workaround issues with
    umount (b/7220345). This loop has been preserved, however, it now
    includes DM_DEV_CREATE as well as DM_TABLE_LOAD.
(2) There was some ancient code to set DM_DEV_GEOMETRY for obb
    dm-devices. This never did anything since geometry must be set after
    loading a table. When setting it before (as vold was doing), the
    subsequent DM_TABLE_LOAD will clear it.

Bug: 132206403
Test: FBE device boots
      FBE device w/ metadata encryption boots
      FDE device boots
      atest StorageManagerIntegrationTest
Change-Id: Ib6db6b47329f093ac7084edaf604eddace8b9ac6
2019-05-13 13:07:12 -07:00
Martijn Coenen
19e74b3d1f Merge "Stop using trigger_reset_main."
am: 91a6c016ec

Change-Id: Id4baa15b619a941c7059d19c59645a45b9060433
2019-05-06 23:57:12 -07:00
Martijn Coenen
91a6c016ec Merge "Stop using trigger_reset_main." 2019-05-07 06:41:01 +00:00
Martijn Coenen
aec7a0a165 Stop using trigger_reset_main.
This trigger was used on FDE devices to bring down the minimal
framework, and worked by shutting down the 'main' service class.

With APEX being introduced, we want to restart all services that were
started after the tmpfs /data was mounted, as those are the services
that haven't been able to use updated APEXes in the (real) /data.

In order to do this, we need to reset more classes; that in turn
made the 'shutdown_main' trigger pretty much similar to the
previously existing 'trigger_shutdown_framework' trigger; so instead
of keeping two duplicate triggers, use only the
'trigger_shutdown_framework' one.

Bug: 118485723
Test: Taimen configured as FDE boots, Taimen configured as FBE boots
Change-Id: I0d80ef2528bd70870b063a2c580cd00a03de9961
2019-04-26 14:05:28 +02:00
Paul Lawrence
7d9a965419 Merge "Use correct Statuses from Checkpoint code"
am: 8d4164f92f

Change-Id: I35ffbb3bc89eb695aa86c45f4aa0a8633cfd11b9
2019-04-23 16:25:53 -07:00
Treehugger Robot
8d4164f92f Merge "Use correct Statuses from Checkpoint code" 2019-04-23 23:07:27 +00:00
Paul Lawrence
82b3505e2e Use correct Statuses from Checkpoint code
Bug: 130190815
Test: Added fake error to code and checked correct error was caught
Change-Id: If9ab9357f0f961607e15a4ba18d9d85bc9923019
2019-04-19 14:50:59 -07:00
xzj
a921b6795e Merge "fix data encryption fail when ENCRYPTION_FLAG_NO_UI is set"
am: c222ad20ee

Change-Id: I5ebb8825b40c3ce088607f8a4aa6d4fb506f6bd5
2019-04-19 14:15:15 -07:00
Treehugger Robot
c222ad20ee Merge "fix data encryption fail when ENCRYPTION_FLAG_NO_UI is set" 2019-04-19 20:27:44 +00:00
xzj
7e38a3a3c8 fix data encryption fail when ENCRYPTION_FLAG_NO_UI is set
cause: data partition not being umount before real encryption
Change-Id: If5cc084c182d96c6205359b76ee0c474f6a77a2e
2019-04-19 18:07:13 +00:00
Sandeep Patil
9389f389f5 Merge "Add visible logs about fstrim run for block based checkpoints"
am: 419528be57

Change-Id: I546d5cb3807cd217e9ab992ee517d4a3164566e5
2019-04-17 15:10:43 -07:00
Treehugger Robot
419528be57 Merge "Add visible logs about fstrim run for block based checkpoints" 2019-04-17 21:11:04 +00:00
Sandeep Patil
f8da61f26a Add visible logs about fstrim run for block based checkpoints
Bug: 120095226
Test: Tested by forcing /data/system/last-fstrim last modified time back
      2 years & manually trigger checkpoint using 'vdc checkpoint startCheckpoint 1'

Change-Id: I0cb8b6a85ae787e1ba2cdd7998a46942ca69760f
Merged-In: I0cb8b6a85ae787e1ba2cdd7998a46942ca69760f
Signed-off-by: Sandeep Patil <sspatil@google.com>
2019-04-17 12:55:58 -07:00
Eric Biggers
a30a907c65 Merge "Don't drop as many caches when evicting CE key"
am: a057b27f2a

Change-Id: Ic98dbb34e6696de5ddcaeccb4ae0108cbe0a1921
2019-04-05 16:00:39 -07:00
Eric Biggers
a057b27f2a Merge "Don't drop as many caches when evicting CE key" 2019-04-05 21:04:22 +00:00
Eric Biggers
ce36868316 Don't drop as many caches when evicting CE key
When a user's CE key is removed, write "2" to /proc/sys/vm/drop_caches
rather than "3".  This avoids unnecessarily evicting the pagecache of
in-use inodes.  It's only necessary to evict the inodes of the relevant
encrypted files, and these are already sync'ed and no longer in-use.
For this mode "2" suffices, as this evicts "reclaimable slab objects",
including inodes; and evicting an inode implies evicting its pagecache.

This matches the recommendation I've made in the documentation for the
fscrypt kernel feature at
https://www.kernel.org/doc/html/latest/filesystems/fscrypt.html#online-attacks

Test: Sanity check that directories are still "locked" properly:
      Unlock device with PIN.  Then in adb shell: 'stop; start;
      sleep 10; ls /data/data/' still shows filenames in ciphertext form.
Change-Id: I1bdf3c420ebf63e98cc314498211061ea36f2942
2019-04-05 12:19:46 -07:00
Paul Crowley
e6c7dffaa8 Merge changes I40575081,I1ca8f8cf,I38bfd273
am: 1c6a56b27f

Change-Id: I8410e8cb691eb0b5e3e721b6b715eb30f28eef51
2019-04-05 12:15:24 -07:00
Paul Crowley
1c6a56b27f Merge changes I40575081,I1ca8f8cf,I38bfd273
* changes:
  clang-format Utils.cpp
  vold: fsync both file and directory after write keys
  vold: Introduce android::vold::writeStringToFile
2019-04-05 18:26:39 +00:00
Paul Crowley
747b421a22 clang-format Utils.cpp
Test: treehugger
Change-Id: I405750812ae037088492bfa7d8db6a8a56cb3425
2019-04-05 04:09:57 -07:00
Tommy Chiu
11621353f2 vold: fsync both file and directory after write keys
Use vold version of writeStringToFile which fsync files, and
manually fsync directories after initialize global DE

(cherry picked from commit a98464f688)

Bug: 71810347
Test: Build pass and reboot stress test.
      Original boot failure symptom is NOT reproducible.
Change-Id: I1ca8f8cf0ccfd01075a9c33f79042e58d99aea26
Merged-In: I1ca8f8cf0ccfd01075a9c33f79042e58d99aea26
2019-04-05 04:06:38 -07:00
Tommy Chiu
97466cb145 vold: Introduce android::vold::writeStringToFile
Remove static definition of writeStringToFile, and
move it from KeyStorage to Utils

(cherry picked from commit 0bd2d11692)

Bug: 71810347
Test: Build pass and reboot stress test.
Change-Id: I38bfd27370ac2372e446dc699f518122e73c6877
Merged-In: I38bfd27370ac2372e446dc699f518122e73c6877
2019-04-05 04:06:18 -07:00
Sandeep Patil
880deb6add Merge "vdc: print the failed command with failure status."
am: b8d17384c5

Change-Id: I6d778f903948cfcee5e377ab22502ed4e1b52ba7
2019-04-04 11:39:35 -07:00
Treehugger Robot
b8d17384c5 Merge "vdc: print the failed command with failure status." 2019-04-04 18:16:27 +00:00
Eric Biggers
4e3300374b Merge "Add missing null terminator for getopt_long()"
am: 4d05e017f9

Change-Id: I18d49879af84b0d58254eda501e0ed7ea5a3ca11
2019-04-04 09:37:52 -07:00
Sandeep Patil
4377234daa vdc: print the failed command with failure status.
vdc currently only prints generic binder failure status on failure.
This doesn't help debugging early boot failures at all since we don't
know which exact vdc command failed. Fix that by adding the command as
part of the failure message.

Bug: 129946805
Test: Boot cuttlefish

Change-Id: Ic2367cf592d6b5bf23d6d4b1447baa1baf41afe7
Signed-off-by: Sandeep Patil <sspatil@google.com>
2019-04-04 09:35:51 -07:00
Eric Biggers
4d05e017f9 Merge "Add missing null terminator for getopt_long()" 2019-04-04 16:18:18 +00:00
Eric Biggers
f5ef40de83 Add missing null terminator for getopt_long()
getopt_long() assumes an all-zeroes 'struct option' at the end of the
array.  Add it.

Fortunately this isn't causing problems in practice because vold is
always passed valid command line options...

Test: Running 'vold --foo' no longer segfaults.
Change-Id: I2cd3af501cc1aa11327a8062ec492be1d23defdf
2019-04-03 16:32:24 -07:00
Daniel Rosenberg
de841f6d89 Merge "Retry opening loop device"
am: c8f5cbb5b1

Change-Id: I5657465fe50f61e3c45e7d13eb5953ef7771d5fa
2019-04-02 14:23:59 -07:00
Daniel Rosenberg
c8f5cbb5b1 Merge "Retry opening loop device" 2019-04-02 20:28:44 +00:00
Daniel Rosenberg
4538cb20b9 Retry opening loop device
If more than the default number of loop devices is in use, we may need
to wait for the device path to be available.

Bug: 128873591
Bug: 122059364
Test: Set up adopted virtual disk and check that it loads on boot
Change-Id: I201dcc32043664076f50b0d6f40de6e5e1a65342
2019-04-01 17:37:47 -07:00
Jaegeuk Kim
a970ff8448 Merge "idle-maint: don't need to change discard_granularity"
am: 444a24558d

Change-Id: If0679363fb8563dedb43f8bd6266c74e4869d44f
2019-04-01 07:13:28 -07:00
Jaegeuk Kim
444a24558d Merge "idle-maint: don't need to change discard_granularity" 2019-04-01 14:04:24 +00:00
Nick Kralevich
874b841223 Merge "vold: add android-* to tidy_checks"
am: 1820b9b3b9

Change-Id: I5b1c6926f050df8b24ee3d52b93080dab0745571
2019-03-29 18:38:21 -07:00
Nick Kralevich
5af0c75525 Merge "vold: cleanups for O_CLOEXEC tidy checks."
am: a59868d6de

Change-Id: Ice4a6009beb2d41d381e461b00be93471b100778
2019-03-29 18:38:04 -07:00
Nick Kralevich
1820b9b3b9 Merge "vold: add android-* to tidy_checks" 2019-03-30 01:27:57 +00:00
Nick Kralevich
a59868d6de Merge "vold: cleanups for O_CLOEXEC tidy checks." 2019-03-30 01:27:38 +00:00
Paul Lawrence
e2d9258979 Merge "Fix checkpoint on Taimen"
am: 3889f17ad1

Change-Id: I06af82f6534b26e595be3aa1d39588175920d0db
2019-03-29 17:16:19 -07:00
Treehugger Robot
3889f17ad1 Merge "Fix checkpoint on Taimen" 2019-03-29 23:09:52 +00:00