Commit graph

1888 commits

Author SHA1 Message Date
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
Daniel Rosenberg
1b38e33003 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-07 15:27:08 -07:00
Jeff Sharkey
9462bdd512 Move "volume" commands over to Binder.
Keep the old socket-based commands intact for awhile so we can
rapidly disable this change using the ENABLE_BINDER feature flag.

Define constants in AIDL to keep Java and C++ in sync.

Test: cts-tradefed run commandAndExit cts-dev -m CtsAppSecurityHostTestCases -t android.appsecurity.cts.ExternalStorageHostTest
Test: cts-tradefed run commandAndExit cts-dev --abi armeabi-v7a -m CtsAppSecurityHostTestCases -t android.appsecurity.cts.AdoptableHostTest
Bug: 13758960
Change-Id: I0d6f82cbebe67f671b60949fd727409aeb1fdc0d
2017-09-07 15:27:30 -06:00
Jeff Sharkey
48fb82cfbc Merge "Start paving the way for vold calls over Binder." 2017-09-07 01:10:20 +00:00
Luis Hector Chavez
769d195438 Merge "Invert the order of SO_RCVBUFFORCE and SO_RCVBUFF" am: a3258252ad am: 2aa4643dca am: d896787df7
am: b216a0a2ee

Change-Id: I369ffbf3be5253a0379dd56cfb3516486031dbc2
2017-09-06 22:58:26 +00:00
Jeff Sharkey
068c6be622 Start paving the way for vold calls over Binder.
This change is the bare minimum needed to publish a new vold
Binder service and move the simple "reset" call over to go through
the new interface.

Test: builds, boots
Bug: 13758960
Change-Id: I5b70976653c69f92e1efc8d1f432b2038eb618a4
2017-09-06 14:06:06 -06:00
Luis Hector Chavez
b216a0a2ee Merge "Invert the order of SO_RCVBUFFORCE and SO_RCVBUFF" am: a3258252ad am: 2aa4643dca
am: d896787df7

Change-Id: I3b72e82b030c685d7e11fa00601774eaba3c241c
2017-09-06 19:57:37 +00:00
Luis Hector Chavez
d896787df7 Merge "Invert the order of SO_RCVBUFFORCE and SO_RCVBUFF" am: a3258252ad
am: 2aa4643dca

Change-Id: I959f84c8e0962ddda76016f4bfa456970bf52be3
2017-09-06 19:52:35 +00:00
Luis Hector Chavez
2aa4643dca Merge "Invert the order of SO_RCVBUFFORCE and SO_RCVBUFF"
am: a3258252ad

Change-Id: I92981e2eb069c4b01ac8d1be51abddb47602529c
2017-09-06 19:48:35 +00:00
Treehugger Robot
a3258252ad Merge "Invert the order of SO_RCVBUFFORCE and SO_RCVBUFF" 2017-09-06 19:32:03 +00:00
Josh Gao
e78efb7df4 Merge "Switch RebootType to an enum class." am: db725d3348 am: da54114d23 am: c01810be33
am: 41770aab2c

Change-Id: Ia5e279208a7ed804abc898520f13ceb2d19b77c3
2017-08-30 02:52:55 +00:00
Josh Gao
41770aab2c Merge "Switch RebootType to an enum class." am: db725d3348 am: da54114d23
am: c01810be33

Change-Id: Ie54bffd0befd917165debfd8d6eff8f9552d6949
2017-08-29 22:01:20 +00:00
Josh Gao
c01810be33 Merge "Switch RebootType to an enum class." am: db725d3348
am: da54114d23

Change-Id: I36b78d3ece0bef5ebedc3193ba989afdfb97e777
2017-08-29 21:54:20 +00:00
Josh Gao
da54114d23 Merge "Switch RebootType to an enum class."
am: db725d3348

Change-Id: I72431dc56d20cf1acb2443ae3d67300a59e10ad3
2017-08-29 21:47:58 +00:00
Treehugger Robot
db725d3348 Merge "Switch RebootType to an enum class." 2017-08-29 21:26:39 +00:00
Luis Hector Chavez
d1b00de2c1 Invert the order of SO_RCVBUFFORCE and SO_RCVBUFF
This change swaps the order of SO_RCVBUFFORCE and SO_RCVBUFF, because
the latter is silently capped to sysctl_rmem_max. So, just try
SO_RCVBUFF if the former failed.

Bug: 62417946
Test: Run android in a new user and network namespace, vold does not
      abort here.

Change-Id: Iac2ddae6fbb80ba84afe5414eade978cd795ef3c
2017-08-29 10:29:48 -07:00
Josh Gao
fec4437972 Switch RebootType to an enum class.
RebootType's shutdown enumerator collides with the shutdown socket
function, which causes problems when <sys/socket.h> gets included
transitively. Switch RebootType into an enum class, to namespace its
enumerators.

Test: treehugger
Change-Id: Ib5e8667df363acb28771430fd43000d381dc8620
2017-08-28 13:22:55 -07:00
Gao Xiang
1e61eae45c mInternalEmulated could be used after shutdown() called am: 7056de1b42
am: bd6ca4a69a

Change-Id: Id886faeee6932641e45c0c9f58a826132d84d592
2017-08-18 18:11:17 +00:00
Gao Xiang
bd6ca4a69a mInternalEmulated could be used after shutdown() called
am: 7056de1b42

Change-Id: I26fd9a89730491f22397e92fb35275504ebcd744
2017-08-18 17:59:58 +00:00
Gao Xiang
7056de1b42 mInternalEmulated could be used after shutdown() called
It fixes the findvolume() / reset() use-after-free issue after
shutdown called to avoid vold crash.

bug: 64833901
Test: test reboot
Fixes: a5bbb5e3c1 ("make shutdown safe for double calls.")
Signed-off-by: Gao Xiang <gaoxiang25@huawei.com>

(cherry picked from commit d263da8807)

Change-Id: I636b28f30fb82e4672d88144cd04072d24ef3b85
2017-08-18 08:21:17 -07:00
Keun-young Park
a6447057e3 Merge "mInternalEmulated could be used after shutdown() called" am: 9b4a443bd6 am: 92052aa582 am: 1b6d8237f2 am: 23b87ecf41
am: eddeea7fa7

Change-Id: I139d2b65d0a280a173f2e32e87423dbd18cca3ad
2017-08-17 22:26:41 +00:00
Keun-young Park
eddeea7fa7 Merge "mInternalEmulated could be used after shutdown() called" am: 9b4a443bd6 am: 92052aa582 am: 1b6d8237f2
am: 23b87ecf41

Change-Id: I2aeed83fad9d3690c12e5e7a4603697f3a06119b
2017-08-17 22:23:40 +00:00
Keun-young Park
23b87ecf41 Merge "mInternalEmulated could be used after shutdown() called" am: 9b4a443bd6 am: 92052aa582
am: 1b6d8237f2

Change-Id: I71b1ec275e2850c1a8273ac5eebc7373a0729552
2017-08-17 22:21:40 +00:00
Keun-young Park
1b6d8237f2 Merge "mInternalEmulated could be used after shutdown() called" am: 9b4a443bd6
am: 92052aa582

Change-Id: I7cd336807b1084bb52fcc2d973b2fd8efe5f54c7
2017-08-17 22:17:10 +00:00
Keun-young Park
92052aa582 Merge "mInternalEmulated could be used after shutdown() called"
am: 9b4a443bd6

Change-Id: Ia1007988297c39f391b35ad51645556ceeaf0cc6
2017-08-17 22:13:40 +00:00
Keun-young Park
9b4a443bd6 Merge "mInternalEmulated could be used after shutdown() called" 2017-08-17 22:10:24 +00:00