Bug 1068000 - Add client side chrome.* pipe rule for Windows content sandbox. r=tabraldes

This commit is contained in:
Bob Owen 2014-09-16 15:44:25 +01:00
parent eab4f246d5
commit 27ae4de9b6

View File

@ -86,6 +86,14 @@ SandboxBroker::SetSecurityLevelForContentProcess(bool inWarnOnlyMode)
result = mPolicy->SetAlternateDesktop(true);
ret = ret && (sandbox::SBOX_ALL_OK == result);
// Add the policy for the client side of a pipe. It is just a file
// in the \pipe\ namespace. We restrict it to pipes that start with
// "chrome." so the sandboxed process cannot connect to system services.
result = mPolicy->AddRule(sandbox::TargetPolicy::SUBSYS_FILES,
sandbox::TargetPolicy::FILES_ALLOW_ANY,
L"\\??\\pipe\\chrome.*");
ret = ret && (sandbox::SBOX_ALL_OK == result);
if (inWarnOnlyMode) {
mozilla::warnonlysandbox::ApplyWarnOnlyPolicy(*mPolicy);
}