Commit graph

2977 commits

Author SHA1 Message Date
Woody Lin
dbac71e050 [automerger skipped] Fsync directories before delete key am: a598e04a91 -s ours
am: 3654986ae5 -s ours
am skip reason: change_id Ib8c349d6d033f86b247f4b35b8354d97cf249d26 with SHA1 37c82f5c0f is in history

Change-Id: I3f8153ebd963a10b1633103ccc941389be0164ee
2019-04-10 07:16:45 -07:00
Paul Crowley
7886e9359e [automerger skipped] Fsync directories after creating files am: 2e58acb412 -s ours
am: c6f4d9d5ae -s ours
am skip reason: change_id I53d252942c21365983b4f8b6e0948b1864f195c1 with SHA1 621d9b9732 is in history

Change-Id: I920346bf310aab6a16cea70d6e213fcff325134c
2019-04-10 07:16:34 -07:00
Woody Lin
3654986ae5 [automerger skipped] Fsync directories before delete key
am: a598e04a91 -s ours
am skip reason: change_id Ib8c349d6d033f86b247f4b35b8354d97cf249d26 with SHA1 37c82f5c0f is in history

Change-Id: Ifec2d700dbe6bbe55e65e6e07003d1e77fb3dbc2
2019-04-10 07:06:41 -07:00
Paul Crowley
c6f4d9d5ae [automerger skipped] Fsync directories after creating files
am: 2e58acb412 -s ours
am skip reason: change_id I53d252942c21365983b4f8b6e0948b1864f195c1 with SHA1 621d9b9732 is in history

Change-Id: Icdb62b1d4e6e7ca7d18df1083020d61d9b215165
2019-04-10 07:06:31 -07:00
Narayan Kamath
b553c62bf1 AppFuseUtil: Call ForceUnmount before PrepareDir.
am: 15ad33a8b1

Change-Id: I39e24afab685cfbdcc492d135937bb2e34110818
2019-04-10 01:29:07 -07:00
Narayan Kamath
15ad33a8b1 AppFuseUtil: Call ForceUnmount before PrepareDir.
We'd previously call ForceUnmount after the call to PrepareDir,
which would sometimes fail because the userspace counterpart of a
FUSE FS that was previously mounted at that mountpoint has gone
away. This is usually reproducible after a runtime restart.

Bug: 128459728
Test: Loop (adb shell start; atest MediaStore_Images_MediaTest; adb shell stop;)
Change-Id: I38d3908487123614c338266f983afb04e3ed78d4
2019-04-09 18:45:32 +01:00
Eric Biggers
d019a2950a Merge "Don't drop as many caches when evicting CE key" am: a057b27f2a
am: a30a907c65

Change-Id: Idaab2ccd2e6ad8afd8f45c20a27d1f34333970c1
2019-04-09 04:11:42 -07:00
Paul Crowley
dba96e85f8 Merge changes I40575081,I1ca8f8cf,I38bfd273 am: 1c6a56b27f
am: e6c7dffaa8

Change-Id: I2de88cca316040df8dcdcfbce237a9e4350f26bc
2019-04-09 03:57:24 -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
Sandeep Patil
faad076163 Merge "vdc: print the failed command with failure status." am: b8d17384c5
am: 880deb6add

Change-Id: Ib680ab944a6e197e4afd3f4e2d36dcd345cbf9c8
2019-04-05 10:08:53 -07: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
2fba74c1e1 Merge "Add missing null terminator for getopt_long()" am: 4d05e017f9
am: 4e3300374b

Change-Id: Ic91066f2abfdc191fe4d0b517fd65d9744387e7b
2019-04-04 09:55:49 -07: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
Eric Biggers
143498f797 Merge "vold: downgrade lookup_key_ref() failure message to DEBUG level" 2019-04-03 21:38:28 +00:00
Daniel Rosenberg
c7da9acdce Merge "Retry opening loop device" am: c8f5cbb5b1 am: de841f6d89
am: dde25e9167

Change-Id: I14fc99509f8b5f83cc2dd0a035d1b127c581b027
2019-04-02 15:52:12 -07:00
Daniel Rosenberg
dde25e9167 Merge "Retry opening loop device" am: c8f5cbb5b1
am: de841f6d89

Change-Id: Ia0765900543f1778fbbe5d26dcadaff8364a89b5
2019-04-02 15:08:19 -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
Eric Biggers
d103404985 vold: downgrade lookup_key_ref() failure message to DEBUG level
Now that lockUserKey() will be called for every user each time the
framework is started, it's a normal case that the key being removed
doesn't exist.  So downgrade the log message about being unable to find
a key from ERROR to DEBUG.

Test: build and boot, message is now debug level.
Change-Id: I2d1dce8dd8825b02982eab1c902aa10fe5b54b84
2019-04-02 11:13:57 -07: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
cd1f06f6ec Merge "idle-maint: don't need to change discard_granularity" am: 444a24558d am: a970ff8448
am: 240ca70d8d

Change-Id: I249d4dd70c4f13d46d539a769e918613eea539b4
2019-04-01 07:22:06 -07:00
Jaegeuk Kim
240ca70d8d Merge "idle-maint: don't need to change discard_granularity" am: 444a24558d
am: a970ff8448

Change-Id: I2be93b1bf2e1cd81b54ec9f197043ae8156003df
2019-04-01 07:17:59 -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
58e1a816ba VolumeManager: more O_CLOEXEC changes
Test: compiles and boots
Bug: 129350825
Change-Id: Ie6a0e05f1814d744eb16863f749c939ab1e097e0
2019-03-29 19:23:40 -07:00
Nick Kralevich
87fcd8b36a Merge "vold: add android-* to tidy_checks" am: 1820b9b3b9 am: 874b841223
am: 2215bd7a75

Change-Id: I4d1be96b9e7285aada712482c366a22451b6dacc
2019-03-29 18:46:25 -07:00
Nick Kralevich
9bda3fe810 Merge "vold: cleanups for O_CLOEXEC tidy checks." am: a59868d6de am: 5af0c75525
am: 4197c098df

Change-Id: Ibe3636abcfafab7854c7b0434095b6e91fadcacf
2019-03-29 18:46:07 -07:00
Nick Kralevich
2215bd7a75 Merge "vold: add android-* to tidy_checks" am: 1820b9b3b9
am: 874b841223

Change-Id: Ica87cf75eadfff9a12c08204240e2d31b10f51a1
2019-03-29 18:42:20 -07:00
Nick Kralevich
4197c098df Merge "vold: cleanups for O_CLOEXEC tidy checks." am: a59868d6de
am: 5af0c75525

Change-Id: I19cae40b342d339bf5752dfba304c37a0abecea8
2019-03-29 18:42:05 -07: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
25fe272764 Merge "Fix checkpoint on Taimen" am: 3889f17ad1 am: e2d9258979
am: 471325ad5a

Change-Id: I96523c193353d8d0f3cf775447b07c018ff810a8
2019-03-29 17:58:01 -07:00
Paul Lawrence
471325ad5a Merge "Fix checkpoint on Taimen" am: 3889f17ad1
am: e2d9258979

Change-Id: Id0768b2cb6aa645d528d21738456a72308936ace
2019-03-29 17:38:20 -07: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
Nick Kralevich
d78fb53378 vold: add android-* to tidy_checks
Bug: 129350825
Test: compiles and boots
Change-Id: If5a6267cc56bfc0ba73602bfa520035197b4fb90
2019-03-29 16:07:58 -07:00
Nick Kralevich
e7e89acbc8 vold: cleanups for O_CLOEXEC tidy checks.
Bug: 129350825
Test: compiles and boots
Change-Id: I83a484ca15df1b757b670008f15af5504bc94df1
2019-03-29 16:04:47 -07:00