Check that dir name is a pid before attempting to read
Prevents selinux denials for folders in /proc that do not have the default /proc label. Bug: 68146208 Test: no selinux denials for vold attempting to read proc_asound dir. Merged-In: I7cdd3bbe8e687e078372012773e9a34a5c76e0f8 Change-Id: I7cdd3bbe8e687e078372012773e9a34a5c76e0f8
This commit is contained in:
parent
2890b8d215
commit
a997db73d6
1 changed files with 5 additions and 0 deletions
|
@ -37,6 +37,7 @@
|
|||
#include <openssl/md5.h>
|
||||
|
||||
#include <android-base/logging.h>
|
||||
#include <android-base/parseint.h>
|
||||
#include <android-base/stringprintf.h>
|
||||
#include <cutils/fs.h>
|
||||
#include <cutils/log.h>
|
||||
|
@ -594,6 +595,10 @@ int VolumeManager::remountUid(uid_t uid, const std::string& mode) {
|
|||
|
||||
// Poke through all running PIDs look for apps running as UID
|
||||
while ((de = readdir(dir))) {
|
||||
pid_t pid;
|
||||
if (de->d_type != DT_DIR) continue;
|
||||
if (!android::base::ParseInt(de->d_name, &pid)) continue;
|
||||
|
||||
pidFd = -1;
|
||||
nsFd = -1;
|
||||
|
||||
|
|
Loading…
Reference in a new issue