forked from chromium/chromium
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Remove default sandbox type for services
Deletes content::GetServiceSandboxType<>() (see content/public/browser/service_process_host.h) so that ::Launch cannot compile if a sandbox is not specified by a specialized template. All existing services without a specified sandbox are launched as kUtility, so these now have that specified. No functional changes. Template for recording::mojom::RecordingService moved to chromeos and includes adjusted. Bug: 1210301 Change-Id: I1ae3f7e70246d9957940e71dc6b3e21ce6861d99 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2901584 Commit-Queue: Alex Gough <ajgo@chromium.org> Reviewed-by: Tony Yeoman <tby@chromium.org> Reviewed-by: Thanh Nguyen <thanhdng@chromium.org> Reviewed-by: Noel Gordon <noel@chromium.org> Reviewed-by: Marc Treib <treib@chromium.org> Reviewed-by: Glenn Hartmann <hartmanng@chromium.org> Reviewed-by: Stephen Nusko <nuskos@chromium.org> Reviewed-by: Robert Sesek <rsesek@chromium.org> Reviewed-by: Nasko Oskov <nasko@chromium.org> Reviewed-by: Ahmed Fakhry <afakhry@chromium.org> Reviewed-by: Ken Rockot <rockot@google.com> Cr-Commit-Position: refs/heads/master@{#886572}
- Loading branch information
Showing
40 changed files
with
342 additions
and
70 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
# Copyright 2021 The Chromium Authors. All rights reserved. | ||
# Use of this source code is governed by a BSD-style license that can be | ||
# found in the LICENSE file. | ||
|
||
source_set("sandbox_types") { | ||
sources = [ "service_sandbox_type.h" ] | ||
deps = [ | ||
"//content/public/browser", | ||
"//sandbox/policy", | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,5 @@ | ||
rockot@google.com | ||
|
||
# Service sandbox specialization must be reviewed by SECURITY_OWNERS | ||
per-file service_sandbox_type.h=set noparent | ||
per-file service_sandbox_type.h=file://ipc/SECURITY_OWNERS |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
// Copyright 2021 The Chromium Authors. All rights reserved. | ||
// Use of this source code is governed by a BSD-style license that can be | ||
// found in the LICENSE file. | ||
|
||
#ifndef CHROME_SERVICES_SERVICE_SANDBOX_TYPE_H_ | ||
#define CHROME_SERVICES_SERVICE_SANDBOX_TYPE_H_ | ||
|
||
#include "content/public/browser/service_process_host.h" | ||
#include "sandbox/policy/sandbox_type.h" | ||
|
||
// This file maps service classes to sandbox types. See | ||
// ServiceProcessHost::Launch() for how these templates are consumed. | ||
|
||
// chrome::mojom::MediaParserFactory | ||
namespace chrome { | ||
namespace mojom { | ||
class MediaParserFactory; | ||
} | ||
} // namespace chrome | ||
template <> | ||
inline sandbox::policy::SandboxType | ||
content::GetServiceSandboxType<chrome::mojom::MediaParserFactory>() { | ||
return sandbox::policy::SandboxType::kUtility; | ||
} | ||
|
||
// ipp_parser::mojom::IppParser | ||
namespace ipp_parser { | ||
namespace mojom { | ||
class IppParser; | ||
} | ||
} // namespace ipp_parser | ||
template <> | ||
inline sandbox::policy::SandboxType | ||
content::GetServiceSandboxType<ipp_parser::mojom::IppParser>() { | ||
return sandbox::policy::SandboxType::kUtility; | ||
} | ||
|
||
// qrcode_generator::mojom::QRCodeGeneratorService | ||
namespace qrcode_generator { | ||
namespace mojom { | ||
class QRCodeGeneratorService; | ||
} | ||
} // namespace qrcode_generator | ||
template <> | ||
inline sandbox::policy::SandboxType content::GetServiceSandboxType< | ||
qrcode_generator::mojom::QRCodeGeneratorService>() { | ||
return sandbox::policy::SandboxType::kUtility; | ||
} | ||
|
||
#endif // CHROME_SERVICES_SERVICE_SANDBOX_TYPE_H_ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.