From 81027b292e23bf021b6206009fa2b3369017a858 Mon Sep 17 00:00:00 2001 From: Masatoshi Kimura Date: Thu, 19 Oct 2023 09:06:40 +0000 Subject: [PATCH] Bug 1859445 - Do not include grandchilren into a job object. r=mhowell,win-reviewers,rkraesig,bobowen Differential Revision: https://phabricator.services.mozilla.com/D191168 --- browser/app/winlauncher/LauncherProcessWin.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/browser/app/winlauncher/LauncherProcessWin.cpp b/browser/app/winlauncher/LauncherProcessWin.cpp index d3fa2a973619..b40e0fceb567 100644 --- a/browser/app/winlauncher/LauncherProcessWin.cpp +++ b/browser/app/winlauncher/LauncherProcessWin.cpp @@ -93,12 +93,11 @@ static nsReturnRef 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();