Merge "Do not read ro.apex.updatable." into main am: 170f15bb4c

Original change: https://android-review.googlesource.com/c/platform/system/vold/+/2727653

Change-Id: I1bfea3565d290b6723c1d8727fbfd748d91a43c9
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
Jooyung Han 2023-08-31 02:35:21 +00:00 committed by Automerger Merge Worker
commit d592cd545b
2 changed files with 13 additions and 20 deletions

View file

@ -165,7 +165,6 @@ cc_library_static {
},
},
whole_static_libs: [
"libcom.android.sysprop.apex",
"libc++fs",
],
}

View file

@ -35,7 +35,6 @@
#include <linux/kdev_t.h>
#include <ApexProperties.sysprop.h>
#include <android-base/file.h>
#include <android-base/logging.h>
#include <android-base/parseint.h>
@ -595,12 +594,11 @@ bool scanProcProcesses(uid_t uid, userid_t userId, ScanProcCallback callback, vo
struct dirent* de;
std::string rootName;
std::string pidName;
std::string exeName;
int pidFd;
int nsFd;
struct stat sb;
static bool apexUpdatable = android::sysprop::ApexProperties::updatable().value_or(false);
if (!(dir = opendir("/proc"))) {
async_safe_format_log(ANDROID_LOG_ERROR, "vold", "Failed to opendir");
return false;
@ -648,10 +646,7 @@ bool scanProcProcesses(uid_t uid, userid_t userId, ScanProcCallback callback, vo
goto next;
}
if (apexUpdatable) {
std::string exeName;
// When ro.apex.bionic_updatable is set to true,
// some early native processes have mount namespaces that are different
// Some early native processes have mount namespaces that are different
// from that of the init. Therefore, above check can't filter them out.
// Since the propagation type of / is 'shared', unmounting /storage
// for the early native processes affects other processes including
@ -664,7 +659,6 @@ bool scanProcProcesses(uid_t uid, userid_t userId, ScanProcCallback callback, vo
if (!StartsWith(exeName, "/system/bin/app_process") && sb.st_uid < AID_APP_START) {
goto next;
}
}
// We purposefully leave the namespace open across the fork
// NOLINTNEXTLINE(android-cloexec-open): Deliberately not O_CLOEXEC