summaryrefslogtreecommitdiff
path: root/VolumeManager.cpp
diff options
context:
space:
mode:
authorEric Biggers <ebiggers@google.com>2022-03-01 21:19:18 +0000
committerEric Biggers <ebiggers@google.com>2022-03-01 21:19:18 +0000
commit7e79a43a72fd06e491063f7291358f8c6e86cda9 (patch)
treedc96a39c7110048c147918c96e11137c34b06f00 /VolumeManager.cpp
parent537b76cd98aa1337b384fb466d6bbf62a10d2273 (diff)
downloadvold-7e79a43a72fd06e491063f7291358f8c6e86cda9.tar.gz
Remove broken code for mounting encrypted OBB files
Mounting encrypted OBB files has never worked reliably across devices, partly due to its reliance on Twofish encryption support in the kernel. This is because Twofish support (CONFIG_CRYPTO_TWOFISH) has never been required or even recommended for Android. It has never been enabled in GKI, but even before GKI it wasn't required or recommended. Moreover, this is now the only Android feature that still uses dm-crypt (CONFIG_DM_CRYPT), and some devices don't have that enabled either. Therefore, it appears that this feature is unused. That's perhaps not surprising, considering that the documentation for OBBs (https://developer.android.com/google/play/expansion-files) says that they are deprecated, and also it explains OBBs as being app files that are opaque to the platform; the ability of the platform to mount OBBs that happen to be in a particular format is never mentioned. That means that OBB mounting is probably rarely used even with unencrypted OBBs. Finally, the usefulness of OBBs having their own encryption layer (in addition to what the platform already provides via FBE) is not clear either, especially with such an unusual choice of cipher. To avoid the confusion that is being caused by having the broken code for mounting encrypted OBBs still sitting around, let's remove it. Test: atest StorageManagerTest # on Cuttlefish Test: atest StorageManagerIntegrationTest # on Cuttlefish Bug: 216475849 Change-Id: Iaef32cce90f95ea745ba2b143f89e66f533f3479
Diffstat (limited to 'VolumeManager.cpp')
-rw-r--r--VolumeManager.cpp8
1 files changed, 3 insertions, 5 deletions
diff --git a/VolumeManager.cpp b/VolumeManager.cpp
index 93113215..bc51042a 100644
--- a/VolumeManager.cpp
+++ b/VolumeManager.cpp
@@ -55,7 +55,6 @@
#include <fscrypt/fscrypt.h>
#include "AppFuseUtil.h"
-#include "Devmapper.h"
#include "FsCrypt.h"
#include "Loop.h"
#include "NetlinkManager.h"
@@ -179,7 +178,6 @@ int VolumeManager::start() {
// directories that we own, in case we crashed.
unmountAll();
- Devmapper::destroyAll();
Loop::destroyAll();
// Assume that we always have an emulated volume on internal
@@ -1075,8 +1073,8 @@ int VolumeManager::fixupAppDir(const std::string& path, int32_t appUid) {
return setupAppDir(path, appUid, true /* fixupExistingOnly */);
}
-int VolumeManager::createObb(const std::string& sourcePath, const std::string& sourceKey,
- int32_t ownerGid, std::string* outVolId) {
+int VolumeManager::createObb(const std::string& sourcePath, int32_t ownerGid,
+ std::string* outVolId) {
int id = mNextObbId++;
std::string lowerSourcePath;
@@ -1114,7 +1112,7 @@ int VolumeManager::createObb(const std::string& sourcePath, const std::string& s
}
auto vol = std::shared_ptr<android::vold::VolumeBase>(
- new android::vold::ObbVolume(id, lowerSourcePath, sourceKey, ownerGid));
+ new android::vold::ObbVolume(id, lowerSourcePath, ownerGid));
vol->create();
mObbVolumes.push_back(vol);