Bug 1859445 - Do not include grandchilren into a job object. r=mhowell,win-reviewers,rkraesig,bobowen

Differential Revision: https://phabricator.services.mozilla.com/D191168
This commit is contained in:
Masatoshi Kimura 2023-10-19 09:06:40 +00:00
Родитель d6cd426b05
Коммит 81027b292e
1 изменённых файлов: 3 добавлений и 4 удалений

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

@ -93,12 +93,11 @@ static nsReturnRef<HANDLE> CreateJobAndAssignProcess(HANDLE aProcess) {
nsAutoHandle empty;
nsAutoHandle job(::CreateJobObjectW(nullptr, nullptr));
// Set JOB_OBJECT_LIMIT_BREAKAWAY_OK to allow the browser process
// to put child processes into a job on Win7, which does not support
// nested jobs. See CanUseJob() in sandboxBroker.cpp.
// Set JOB_OBJECT_LIMIT_SILENT_BREAKAWAY_OK to put only browser process
// into a job without putting children of browser process into the job.
JOBOBJECT_EXTENDED_LIMIT_INFORMATION jobInfo = {};
jobInfo.BasicLimitInformation.LimitFlags =
JOB_OBJECT_LIMIT_KILL_ON_JOB_CLOSE | JOB_OBJECT_LIMIT_BREAKAWAY_OK;
JOB_OBJECT_LIMIT_KILL_ON_JOB_CLOSE | JOB_OBJECT_LIMIT_SILENT_BREAKAWAY_OK;
if (!::SetInformationJobObject(job.get(), JobObjectExtendedLimitInformation,
&jobInfo, sizeof(jobInfo))) {
return empty.out();