diff --git a/dom/ipc/ContentParent.cpp b/dom/ipc/ContentParent.cpp index 35a32ba4071f..5faeef5af3c1 100644 --- a/dom/ipc/ContentParent.cpp +++ b/dom/ipc/ContentParent.cpp @@ -1502,6 +1502,17 @@ ContentParent::ContentParent(mozIApplication* aApp, } } +#ifdef MOZ_CONTENT_SANDBOX + // Bug 921817. We enable the sandbox in RecvSetProcessPrivileges, + // which is where a preallocated process drops unnecessary privileges, + // but a non-preallocated process will already have changed its + // uid/gid/etc immediately after forking. Thus, we send this message, + // which is otherwise a no-op, to sandbox it at an appropriate point + // during startup. + if (aOSPrivileges != base::PRIVILEGES_INHERIT) { + SendSetProcessPrivileges(base::PRIVILEGES_INHERIT); + } +#endif } #ifdef MOZ_NUWA_PROCESS