diff options
Diffstat (limited to 'www/chromium/files/patch-content_gpu_gpu__sandbox__hook__linux.cc')
-rw-r--r-- | www/chromium/files/patch-content_gpu_gpu__sandbox__hook__linux.cc | 71 |
1 files changed, 55 insertions, 16 deletions
diff --git a/www/chromium/files/patch-content_gpu_gpu__sandbox__hook__linux.cc b/www/chromium/files/patch-content_gpu_gpu__sandbox__hook__linux.cc index 25321df57de9..b6184245fe81 100644 --- a/www/chromium/files/patch-content_gpu_gpu__sandbox__hook__linux.cc +++ b/www/chromium/files/patch-content_gpu_gpu__sandbox__hook__linux.cc @@ -1,27 +1,25 @@ ---- content/gpu/gpu_sandbox_hook_linux.cc.orig 2021-12-31 00:57:32 UTC +--- content/gpu/gpu_sandbox_hook_linux.cc.orig 2022-02-07 13:39:41 UTC +++ content/gpu/gpu_sandbox_hook_linux.cc -@@ -89,6 +89,12 @@ static const char kLibTegraPath[] = "/usr/lib64/libteg - static const char kLibV4l2Path[] = "/usr/lib64/libv4l2.so"; - static const char kLibV4lEncPluginPath[] = - "/usr/lib64/libv4l/plugins/libv4l-encplugin.so"; -+#elif defined(OS_BSD) -+static const char kLibGlesPath[] = "/usr/local/lib/libGLESv2.so.2"; -+static const char kLibEglPath[] = "/usr/local/lib/libEGL.so.1"; -+static const char kLibV4l2Path[] = "/usr/local/lib/libv4l2.so"; -+static const char kLibV4lEncPluginPath[] = -+ "/usr/local/lib/libv4l/plugins/libv4l-encplugin.so"; - #else - static const char kLibGlesPath[] = "/usr/lib/libGLESv2.so.2"; - static const char kLibEglPath[] = "/usr/lib/libEGL.so.1"; -@@ -401,6 +407,7 @@ std::vector<BrokerFilePermission> FilePermissionsForGp +@@ -101,6 +101,7 @@ static const char kLibV4lEncPluginPath[] = + + constexpr int dlopen_flag = RTLD_NOW | RTLD_GLOBAL | RTLD_NODELETE; + ++#if !defined(OS_BSD) + void AddV4L2GpuPermissions( + std::vector<BrokerFilePermission>* permissions, + const sandbox::policy::SandboxSeccompBPF::Options& options) { +@@ -395,8 +396,10 @@ std::vector<BrokerFilePermission> FilePermissionsForGp + AddStandardGpuPermissions(&permissions); + return permissions; } ++#endif void LoadArmGpuLibraries() { +#if !defined(OS_BSD) // Preload the Mali library. if (UseChromecastSandboxAllowlist()) { for (const char* path : kAllowedChromecastPaths) { -@@ -433,6 +440,7 @@ void LoadArmGpuLibraries() { +@@ -438,6 +441,7 @@ void LoadArmGpuLibraries() { dlopen(driver_paths[i], dlopen_flag); } } @@ -29,3 +27,44 @@ } bool LoadAmdGpuLibraries() { +@@ -501,12 +505,14 @@ void LoadV4L2Libraries( + } + + void LoadChromecastV4L2Libraries() { ++#if !defined(OS_BSD) + for (const char* path : kAllowedChromecastPaths) { + const std::string library_path(std::string(path) + + std::string("libvpcodec.so")); + if (dlopen(library_path.c_str(), dlopen_flag)) + break; + } ++#endif + } + + bool LoadLibrariesForGpu( +@@ -533,6 +539,7 @@ bool LoadLibrariesForGpu( + return true; + } + ++#if !defined(OS_BSD) + sandbox::syscall_broker::BrokerCommandSet CommandSetForGPU( + const sandbox::policy::SandboxLinux::Options& options) { + sandbox::syscall_broker::BrokerCommandSet command_set; +@@ -555,13 +562,17 @@ bool BrokerProcessPreSandboxHook( + SetProcessTitleFromCommandLine(nullptr); + return true; + } ++#endif + + } // namespace + + bool GpuProcessPreSandboxHook(sandbox::policy::SandboxLinux::Options options) { ++ NOTIMPLEMENTED(); ++#if !defined(OS_BSD) + sandbox::policy::SandboxLinux::GetInstance()->StartBrokerProcess( + CommandSetForGPU(options), FilePermissionsForGpu(options), + base::BindOnce(BrokerProcessPreSandboxHook), options); ++#endif + + if (!LoadLibrariesForGpu(options)) + return false; |