Bug 1664922 - Allow CPU information in the "utility" sandbox policy, for nsSystemInfo. r=gcp

Differential Revision: https://phabricator.services.mozilla.com/D90603
This commit is contained in:
Jed Davis 2020-10-06 20:21:32 +00:00
Родитель 1487466d5a
Коммит 5d2c793134
1 изменённых файлов: 9 добавлений и 0 удалений

Просмотреть файл

@ -683,6 +683,15 @@ SandboxBrokerPolicyFactory::GetUtilityPolicy(int aPid) {
AddSharedMemoryPaths(policy.get(), aPid);
// FIXME (bug 1662321): we should fix nsSystemInfo so that every
// child process doesn't need to re-read these files to get the info
// the parent process already has.
policy->AddPath(rdonly, "/proc/cpuinfo");
policy->AddPath(rdonly,
"/sys/devices/system/cpu/cpu0/cpufreq/cpuinfo_max_freq");
policy->AddPath(rdonly, "/sys/devices/system/cpu/cpu0/cache/index2/size");
policy->AddPath(rdonly, "/sys/devices/system/cpu/cpu0/cache/index3/size");
if (policy->IsEmpty()) {
policy = nullptr;
}