Pass both partition GUID and filesystem UUID.

FDE keys are indexed using the partition GUID, while FBE keys will be
indexed using the filesystem UUID, so pass both of those identifiers
along when forgetting a volume.

Test: cts-tradefed run commandAndExit cts-dev -m CtsAppSecurityHostTestCases -t android.appsecurity.cts.AdoptableHostTest
Bug: 25861755
Change-Id: I6e239d5ba67a01c9a848d705f6167da00f975924
gugelfrei
Jeff Sharkey 7 years ago
parent ac46172c79
commit 3ce18256a1

@ -302,12 +302,14 @@ binder::Status VoldNativeService::partition(const std::string& diskId, int32_t p
}
}
binder::Status VoldNativeService::forgetPartition(const std::string& partGuid) {
binder::Status VoldNativeService::forgetPartition(const std::string& partGuid,
const std::string& fsUuid) {
ENFORCE_UID(AID_SYSTEM);
CHECK_ARGUMENT_HEX(partGuid);
CHECK_ARGUMENT_HEX(fsUuid);
ACQUIRE_LOCK;
return translate(VolumeManager::Instance()->forgetPartition(partGuid));
return translate(VolumeManager::Instance()->forgetPartition(partGuid, fsUuid));
}
binder::Status VoldNativeService::mount(const std::string& volId, int32_t mountFlags,

@ -44,7 +44,7 @@ public:
binder::Status onUserStopped(int32_t userId);
binder::Status partition(const std::string& diskId, int32_t partitionType, int32_t ratio);
binder::Status forgetPartition(const std::string& partGuid);
binder::Status forgetPartition(const std::string& partGuid, const std::string& fsUuid);
binder::Status mount(const std::string& volId, int32_t mountFlags, int32_t mountUserId);
binder::Status unmount(const std::string& volId);

@ -293,7 +293,7 @@ void VolumeManager::listVolumes(android::vold::VolumeBase::Type type,
}
}
int VolumeManager::forgetPartition(const std::string& partGuid) {
int VolumeManager::forgetPartition(const std::string& partGuid, const std::string& fsUuid) {
std::string normalizedGuid;
if (android::vold::NormalizeHex(partGuid, normalizedGuid)) {
LOG(WARNING) << "Invalid GUID " << partGuid;

@ -89,7 +89,7 @@ public:
void listVolumes(android::vold::VolumeBase::Type type, std::list<std::string>& list);
int forgetPartition(const std::string& partGuid);
int forgetPartition(const std::string& partGuid, const std::string& fsUuid);
int onUserAdded(userid_t userId, int userSerialNumber);
int onUserRemoved(userid_t userId);

@ -34,7 +34,7 @@ interface IVold {
void onUserStopped(int userId);
void partition(@utf8InCpp String diskId, int partitionType, int ratio);
void forgetPartition(@utf8InCpp String partGuid);
void forgetPartition(@utf8InCpp String partGuid, @utf8InCpp String fsUuid);
void mount(@utf8InCpp String volId, int mountFlags, int mountUserId);
void unmount(@utf8InCpp String volId);

Loading…
Cancel
Save