| OLD | NEW |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "content/common/sandbox_linux/bpf_gpu_policy_linux.h" | 5 #include "content/common/sandbox_linux/bpf_gpu_policy_linux.h" |
| 6 | 6 |
| 7 #include <dlfcn.h> | 7 #include <dlfcn.h> |
| 8 #include <errno.h> | 8 #include <errno.h> |
| 9 #include <fcntl.h> | 9 #include <fcntl.h> |
| 10 #include <sys/socket.h> | 10 #include <sys/socket.h> |
| (...skipping 255 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 266 const char* I965DrvVideoPath = NULL; | 266 const char* I965DrvVideoPath = NULL; |
| 267 | 267 |
| 268 if (IsArchitectureX86_64()) { | 268 if (IsArchitectureX86_64()) { |
| 269 I965DrvVideoPath = "/usr/lib64/va/drivers/i965_drv_video.so"; | 269 I965DrvVideoPath = "/usr/lib64/va/drivers/i965_drv_video.so"; |
| 270 } else if (IsArchitectureI386()) { | 270 } else if (IsArchitectureI386()) { |
| 271 I965DrvVideoPath = "/usr/lib/va/drivers/i965_drv_video.so"; | 271 I965DrvVideoPath = "/usr/lib/va/drivers/i965_drv_video.so"; |
| 272 } | 272 } |
| 273 | 273 |
| 274 dlopen(I965DrvVideoPath, RTLD_NOW|RTLD_GLOBAL|RTLD_NODELETE); | 274 dlopen(I965DrvVideoPath, RTLD_NOW|RTLD_GLOBAL|RTLD_NODELETE); |
| 275 dlopen("libva.so.1", RTLD_NOW|RTLD_GLOBAL|RTLD_NODELETE); | 275 dlopen("libva.so.1", RTLD_NOW|RTLD_GLOBAL|RTLD_NODELETE); |
| 276 #if defined(USE_OZONE) |
| 277 dlopen("libva-drm.so.1", RTLD_NOW | RTLD_GLOBAL | RTLD_NODELETE); |
| 278 #elif defined(USE_X11) |
| 276 dlopen("libva-x11.so.1", RTLD_NOW|RTLD_GLOBAL|RTLD_NODELETE); | 279 dlopen("libva-x11.so.1", RTLD_NOW|RTLD_GLOBAL|RTLD_NODELETE); |
| 280 #endif |
| 277 } | 281 } |
| 278 } | 282 } |
| 279 | 283 |
| 280 return true; | 284 return true; |
| 281 } | 285 } |
| 282 | 286 |
| 283 void GpuProcessPolicy::InitGpuBrokerProcess( | 287 void GpuProcessPolicy::InitGpuBrokerProcess( |
| 284 sandbox::bpf_dsl::Policy* (*broker_sandboxer_allocator)(void), | 288 sandbox::bpf_dsl::Policy* (*broker_sandboxer_allocator)(void), |
| 285 const std::vector<BrokerFilePermission>& permissions_extra) { | 289 const std::vector<BrokerFilePermission>& permissions_extra) { |
| 286 static const char kDriRcPath[] = "/etc/drirc"; | 290 static const char kDriRcPath[] = "/etc/drirc"; |
| (...skipping 17 matching lines...) Expand all Loading... |
| 304 } | 308 } |
| 305 | 309 |
| 306 broker_process_ = new BrokerProcess(GetFSDeniedErrno(), permissions); | 310 broker_process_ = new BrokerProcess(GetFSDeniedErrno(), permissions); |
| 307 // The initialization callback will perform generic initialization and then | 311 // The initialization callback will perform generic initialization and then |
| 308 // call broker_sandboxer_callback. | 312 // call broker_sandboxer_callback. |
| 309 CHECK(broker_process_->Init(base::Bind(&UpdateProcessTypeAndEnableSandbox, | 313 CHECK(broker_process_->Init(base::Bind(&UpdateProcessTypeAndEnableSandbox, |
| 310 broker_sandboxer_allocator))); | 314 broker_sandboxer_allocator))); |
| 311 } | 315 } |
| 312 | 316 |
| 313 } // namespace content | 317 } // namespace content |
| OLD | NEW |