1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
|
--- content/gpu/gpu_sandbox_hook_linux.cc.orig 2019-10-21 19:06:32 UTC
+++ content/gpu/gpu_sandbox_hook_linux.cc
@@ -96,8 +96,9 @@ static const char kLibV4lEncPluginPath[] =
"/usr/lib/libv4l/plugins/libv4l-encplugin.so";
#endif
-constexpr int dlopen_flag = RTLD_NOW | RTLD_GLOBAL | RTLD_NODELETE;
+constexpr int dlopen_flag = RTLD_NOW | RTLD_GLOBAL;
+#if !defined(OS_BSD)
void AddV4L2GpuWhitelist(
std::vector<BrokerFilePermission>* permissions,
const service_manager::SandboxSeccompBPF::Options& options) {
@@ -299,8 +300,10 @@ std::vector<BrokerFilePermission> FilePermissionsForGp
AddStandardGpuWhiteList(&permissions);
return permissions;
}
+#endif
void LoadArmGpuLibraries() {
+#if !defined(OS_BSD)
// Preload the Mali library.
if (UseChromecastSandboxWhitelist()) {
for (const char* path : kWhitelistedChromecastPaths) {
@@ -315,6 +318,7 @@ void LoadArmGpuLibraries() {
// Preload the Tegra V4L2 (video decode acceleration) library.
dlopen(kLibTegraPath, dlopen_flag);
}
+#endif
}
bool LoadAmdGpuLibraries() {
@@ -370,6 +374,7 @@ bool LoadLibrariesForGpu(
return true;
}
+#if !defined(OS_BSD)
sandbox::syscall_broker::BrokerCommandSet CommandSetForGPU(
const service_manager::SandboxLinux::Options& options) {
sandbox::syscall_broker::BrokerCommandSet command_set;
@@ -390,13 +395,17 @@ bool BrokerProcessPreSandboxHook(
service_manager::SetProcessTitleFromCommandLine(nullptr);
return true;
}
+#endif
} // namespace
bool GpuProcessPreSandboxHook(service_manager::SandboxLinux::Options options) {
+ NOTIMPLEMENTED();
+#if !defined(OS_BSD)
service_manager::SandboxLinux::GetInstance()->StartBrokerProcess(
CommandSetForGPU(options), FilePermissionsForGpu(options),
base::BindOnce(BrokerProcessPreSandboxHook), options);
+#endif
if (!LoadLibrariesForGpu(options))
return false;
|