Commit graph

1963 commits

Author SHA1 Message Date
Richard Uhler
0a34be8472 Merge "Revert "Add support for gid derivation on private volumes"" am: 9588da7095 am: 6b264e4a4c am: 3ed63e8d21
am: 4a921633fa

Change-Id: I0363e160698cb31e19fab984d5b40561fe480889
2017-09-22 17:34:57 +00:00
Richard Uhler
4a921633fa Merge "Revert "Add support for gid derivation on private volumes"" am: 9588da7095 am: 6b264e4a4c
am: 3ed63e8d21

Change-Id: Ie3abbe2dee226330576e42b44910652ff272eb74
2017-09-22 17:32:02 +00:00
Richard Uhler
3ed63e8d21 Merge "Revert "Add support for gid derivation on private volumes"" am: 9588da7095
am: 6b264e4a4c

Change-Id: Ic617080e8f98079bd3075621dc85f5dfa00ff5ba
2017-09-22 17:30:00 +00:00
Richard Uhler
6b264e4a4c Merge "Revert "Add support for gid derivation on private volumes""
am: 9588da7095

Change-Id: Ie2e32cca7542cdc1aaec5e8481b6a255b3c3b298
2017-09-22 17:24:03 +00:00
Treehugger Robot
9588da7095 Merge "Revert "Add support for gid derivation on private volumes"" 2017-09-22 17:21:55 +00:00
Richard Uhler
32a7b7fe82 Revert "Add support for gid derivation on private volumes"
This reverts commit 1b38e33003.

Causes a boot loop on bullhead.

(cherry picked from commit a3a60b372e)

Bug: 63245673
Bug: 65660058
Test: m
Merged-In: I9c8afd3ba22547aff5aff06b71cb8ff3b8a07350
Change-Id: I9c8afd3ba22547aff5aff06b71cb8ff3b8a07350
2017-09-22 09:04:05 -07:00
Jeff Sharkey
8cb56e249a Merge "Be more aggressive about obtaining vold service." 2017-09-22 03:10:27 +00:00
Jeff Sharkey
b21add1d79 Merge "Make Loop::destroyAll() smarter." 2017-09-22 01:10:49 +00:00
Jeff Sharkey
4a53a9edb3 Be more aggressive about obtaining vold service.
vdc is typically invoked very early during boot, where it races with
vold starting up.  The default getService() implementation waits a
whole second between retrying, so write a local getServiceAggressive()
that only waits 10ms between attempts.

Test: builds, boots
Bug: 65737446
Change-Id: I581db3afcf7f81dd7cd9cc84dc03194759861669
2017-09-21 18:20:59 -06:00
Jeff Sharkey
67b8c49530 Make Loop::destroyAll() smarter.
Instead of blindly looping across 4096 possible devices, use
readdir() to only look at valid devices.  This speeds up destroyAll()
from 40ms to 0.7ms.

Add tracing information in several places.

Test: external/chromium-trace/systrace.py -b 128768 sched freq am pm ss core_services binder_driver -a system_server,installd,vold
Bug: 65634729, 65737446
Change-Id: If581de47fb55850c0fcd6e25bf33ed246e1b079d
2017-09-21 17:11:07 -06:00
Jeff Sharkey
5b644aae30 Merge "Enable "cert-err34-c" tidy checks." 2017-09-21 15:40:02 +00:00
Daniel Rosenberg
6ef76f2966 Merge "Add support for gid derivation on private volumes" am: 0b7dbf0b1c am: c2c183e02c am: 2c629a9d48
am: d9307f8df7

Change-Id: I61b929212d27ff0ce74d53d0576799b0623505d1
2017-09-21 04:14:29 +00:00
Daniel Rosenberg
d9307f8df7 Merge "Add support for gid derivation on private volumes" am: 0b7dbf0b1c am: c2c183e02c
am: 2c629a9d48

Change-Id: I3479e5656327023526ffbf8c9b973362e4df2321
2017-09-21 01:07:43 +00:00
Daniel Rosenberg
2c629a9d48 Merge "Add support for gid derivation on private volumes" am: 0b7dbf0b1c
am: c2c183e02c

Change-Id: I71b1249e1d97bda5dc177881e0d01e3374bcf0a8
2017-09-21 01:05:14 +00:00
Daniel Rosenberg
c2c183e02c Merge "Add support for gid derivation on private volumes"
am: 0b7dbf0b1c

Change-Id: I55313f24f2d932fb76d1b107c9e765b507f0403d
2017-09-21 01:03:16 +00:00
Treehugger Robot
0b7dbf0b1c Merge "Add support for gid derivation on private volumes" 2017-09-21 00:57:48 +00:00
Daniel Rosenberg
4e8cec1fce Add support for gid derivation on private volumes
This sdcardfs feature was moved under a mount option
and is only needed on private volumes

Test: Private emulated volume should attempt to mount with
      derive_gid option.
Bug: 63245673
Change-Id: I40a8b15c298c815a4643007b9eca8269379fd2ac
2017-09-20 15:57:52 -07:00
Jeff Sharkey
95440ebd97 Enable "cert-err34-c" tidy checks.
Now that we've moved to Binder, we only have a few lingering atoi()
usages that are cleaned up in this CL.

Rewrite match_multi_entry() entirely, with tests to verify both old
and new implementations.

Test: adb shell /data/nativetest/vold_tests/vold_tests
Bug: 36655947
Change-Id: Ib79dc1ddc2366db4d5b4e1a1e2ed9456a06a983e
2017-09-20 13:29:48 -06:00
Jeff Sharkey
49672b9351 Merge "Destroy vold socket interface completely." 2017-09-19 05:11:08 +00:00
TreeHugger Robot
815b42a2a5 Merge "Timeout if device isn't mounted." 2017-09-18 22:32:29 +00:00
Jeff Sharkey
cbe69fc060 Destroy vold socket interface completely.
Long live Binder.

Test: yes
Bug: 13758960
Change-Id: If6be379b5a873f1b0c66dd1522b87413ad10fc46
2017-09-18 16:00:14 -06:00
Jeff Sharkey
7bdf4d5a0f Timeout if device isn't mounted.
If the invoked FUSE binary fails to mount the requested filesystem,
the dev_t won't actually change.  To avoid getting waiting forever
and triggering the watchdog, timeout after 5 seconds.

Test: manually hang after fork and verify that we timeout
Bug: 65756209
Change-Id: I6ea5fd08ed14c72c1d7f7064bfd0d9ac81d4897b
2017-09-18 14:47:12 -06:00
Jeff Sharkey
57b1874505 Add "mountdefaultencrypted" command to vdc.
It's being used by the emulator.

Test: vdc --wait cryptfs mountdefaultencrypted
Bug: 65795120
Change-Id: I8a5d622e4fa1ef93bb8e22f2665c882b1a152b3d
2017-09-18 13:49:53 -06:00
Jeff Sharkey
5820b51c22 Merge "Move long-running calls to async with listeners." 2017-09-15 22:45:55 +00:00
Rom Lemarchand
85d5d27bcc Merge "Revert "Revert "Add support for gid derivation on private volumes""" into oc-mr1-dev am: d4af166db8
am: 29e8bb5df1

Change-Id: Ie0fef9462a10165f62c37d80326b0db63439685d
2017-09-15 22:06:02 +00:00
Rom Lemarchand
29e8bb5df1 Merge "Revert "Revert "Add support for gid derivation on private volumes""" into oc-mr1-dev
am: d4af166db8

Change-Id: Iadec8e0e5edec0a61d15d46dd85e0ec7253da62a
2017-09-15 22:02:59 +00:00
TreeHugger Robot
d4af166db8 Merge "Revert "Revert "Add support for gid derivation on private volumes""" into oc-mr1-dev 2017-09-15 21:59:32 +00:00
Rom Lemarchand
75ae529bf8 Revert "Revert "Add support for gid derivation on private volumes""
This reverts commit a3a60b372e.

Reason for revert: All kernel prebuilts merged

Bug: 65600849
Bug: 65573871
Change-Id: I75b0cb1d82213b875cbef8d39f4f1a8fb34b9795
2017-09-15 20:36:11 +00:00
Jeff Sharkey
52f7a91934 Move long-running calls to async with listeners.
Now that we're using Binder, we can have callers provide explicit
listeners for every request instead of trying to squeeze them all
into unsolicited socket events.

Move benchmarking to be async to avoid blocking other commands for
up to several minutes.  Remove post-trim benchmarking flag, since
benchmarking now requires a separate callback.  Will bring back in
a future CL.

Test: cts-tradefed run commandAndExit cts-dev -m CtsAppSecurityHostTestCases -t android.appsecurity.cts.AdoptableHostTest
Test: adb shell sm fstrim
Bug: 62201209, 13758960
Change-Id: I0f2ebf1ac3b4252ecd6b44303f2887adfdb58e86
2017-09-15 14:18:00 -06:00
Richard Uhler
97cb6e597c Merge "Revert "Add support for gid derivation on private volumes"" into oc-mr1-dev am: 3bfa263f53
am: fe64fee09d

Change-Id: I818351970b66d18492c3c181618069602ad3ee26
2017-09-15 10:09:05 +00:00
Daniel Rosenberg
1f1834ee24 Merge "Add support for gid derivation on private volumes" into oc-mr1-dev am: e335ee8f72
am: d3cde53e0e

Change-Id: I89e099d96f3ce6ec26aebe75d3a8ef5e60e0d9c2
2017-09-15 10:07:42 +00:00
Jeff Sharkey
0990b69d6b Fix build breakage.
Change-Id: I4d79762acf81a7402e6579624da32ce8da236611
2017-09-14 17:24:26 -06:00
Jeff Sharkey
90430888a8 Merge "Move vdc commands over to Binder." 2017-09-14 22:19:19 +00:00
Jeff Sharkey
38ecf0529c Merge "Move unsolicited vold events to Binder." 2017-09-14 20:57:30 +00:00
Jeff Sharkey
99f92689de Move vdc commands over to Binder.
Use nice clean AIDL instead of dirty sockets.

Test: vdc cryptfs init_user0
Bug: 13758960
Change-Id: Ia9dc2e8e1d23e694f1c299fa16d346b07b516718
2017-09-14 13:57:24 -06:00
Richard Uhler
fe64fee09d Merge "Revert "Add support for gid derivation on private volumes"" into oc-mr1-dev
am: 3bfa263f53

Change-Id: Ib9b44d214fbe6822da18ed4f4cc850c0314426b5
2017-09-14 15:41:02 +00:00
Daniel Rosenberg
d3cde53e0e Merge "Add support for gid derivation on private volumes" into oc-mr1-dev
am: e335ee8f72

Change-Id: I4546ead188fc1e8fc675153586b1c4b4500f9c72
2017-09-14 15:39:50 +00:00
Richard Uhler
3bfa263f53 Merge "Revert "Add support for gid derivation on private volumes"" into oc-mr1-dev 2017-09-14 14:55:32 +00:00
Richard Uhler
a3a60b372e Revert "Add support for gid derivation on private volumes"
This reverts commit 1b38e33003.

Causes a boot loop on bullhead.

Bug: 63245673
Bug: 65660058
Change-Id: I9c8afd3ba22547aff5aff06b71cb8ff3b8a07350
2017-09-14 14:51:04 +00:00
Chen, Luhai
cb9c5518c9 Fix keyname generation issue am: 5744dfe3cc
am: be03a5aad0

Change-Id: I790abd1988f266cf9a7df6be6f8d294a941d78e0
2017-09-14 03:42:48 +00:00
Chen, Luhai
be03a5aad0 Fix keyname generation issue
am: 5744dfe3cc

Change-Id: Iad7a5325249b609720a295473194e40ff1747d4a
2017-09-14 03:37:40 +00:00
TreeHugger Robot
e335ee8f72 Merge "Add support for gid derivation on private volumes" into oc-mr1-dev 2017-09-14 01:37:01 +00:00
Jeff Sharkey
814e9d308e Move unsolicited vold events to Binder.
Create IVoldListener and move most unsolicited vold events over to
this new interface.  The remaining events will be routed through
method-specific listeners instead of a global one.

Move to upstream DISALLOW_COPY_AND_ASSIGN macro.

Test: cts-tradefed run commandAndExit cts-dev -m CtsAppSecurityHostTestCases -t android.appsecurity.cts.DirectBootHostTest
Test: cts-tradefed run commandAndExit cts-dev -m CtsAppSecurityHostTestCases -t android.appsecurity.cts.AdoptableHostTest
Test: cts-tradefed run commandAndExit cts-dev -m CtsOsTestCases -t android.os.storage.cts.StorageManagerTest
Bug: 13758960
Change-Id: Ib9293487db2d525a76b9b9c2e9ac18d98601c6cf
2017-09-13 11:52:53 -06:00
Jeff Sharkey
83b559ced4 Move all crypto commands over to Binder.
Prefix FDE related commands with "fde" to make it clear which devices
they apply to.  This will also make it easier to remove once FDE
is fully deprecated in a future release.

To emulate the single-threaded nature of the old socket, introduce a
lock that is acquired for all encryption related methods.

Sprinkle some "const" around older files to make C++ happy.

Test: cts-tradefed run commandAndExit cts-dev -m CtsAppSecurityHostTestCases -t android.appsecurity.cts.DirectBootHostTest
Test: cts-tradefed run commandAndExit cts-dev -m CtsAppSecurityHostTestCases -t android.appsecurity.cts.AdoptableHostTest
Test: cts-tradefed run commandAndExit cts-dev -m CtsOsTestCases -t android.os.storage.cts.StorageManagerTest
Bug: 13758960
Change-Id: I0a6ec6e3660bbddc61424c344ff6ac6da953ccf0
2017-09-12 17:24:06 -06:00
Jeff Sharkey
ec4fda2459 Add some Binder argument sanity checking.
Yell if the remote caller is trying to pass shady arguments.

Test: cts-tradefed run commandAndExit cts-dev -m CtsAppSecurityHostTestCases -t android.appsecurity.cts.AdoptableHostTest
Test: cts-tradefed run commandAndExit cts-dev -m CtsOsTestCases -t android.os.storage.cts.StorageManagerTest
Bug: 13758960
Change-Id: I925dc9290a72fb4389574cd505fc4edfc8fbf0e1
2017-09-12 14:38:14 -06:00
Chen, Luhai
5744dfe3cc Fix keyname generation issue
The keyname binded to keyring return a wrong string when there are binary char larger than 127,
the sign extension will introduce unexpect FFFFFF string to the keyname.

Bug: 65423023
Test: local build with boot test and device encryption status check. 

Change-Id: I26482c98ac1858a63b9f5c3f84a8699fd6a21cd7
Signed-off-by: Ai, Ting A <ting.a.ai@intel.com>
Signed-off-by: Chen, Luhai <luhai.chen@intel.com>
2017-09-11 18:39:01 -07:00
Jeff Sharkey
11c2d380a7 Move even more vold commands over to Binder.
This moves fstrim, obb and appfuse commands over to the new Binder
interface.  This change also separates creating/destroying and
mounting/unmounting of OBB volumes, which means they finally flow
nicely into the modern VolumeInfo/VolumeBase design.

We now generate unique identifiers for all OBB volumes, instead of
using a shady MD5 hash.

Change all "loop" and "dm" devices to tag the kernel resources with
a vold-specific prefix so that we can clean them up if vold crashes;
there are new destroyAll() methods that handle this cleanup.

Move appfuse mounting/unmounting into VolumeManager so it can be
shared.  Move various model objects into a separate directory to
tidy things up.

Test: cts-tradefed run commandAndExit cts-dev -m CtsOsTestCases -t android.os.storage.cts.StorageManagerTest
Bug: 13758960
Change-Id: I7294e32b3fb6efe07cb3b77bd20166e70b66958f
2017-09-11 18:44:17 -06:00
Elliott Hughes
a94fc7cdcd Merge "<stdbool.h> unnecessary in C++." 2017-09-09 00:09:19 +00:00
Elliott Hughes
f654c04d01 <stdbool.h> unnecessary in C++.
Bug: N/A
Test: builds
Change-Id: Iddbd364e581477b8304dc6f0764f153dbcf122a7
2017-09-08 14:58:08 -07:00
Jeff Sharkey
cf2121435d Merge "Move "volume" commands over to Binder." 2017-09-08 21:55:43 +00:00