Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(897)

Unified Diff: content/common/sandbox_linux/bpf_gpu_policy_linux.cc

Issue 759613008: bpf gpu policy: Change GPU bpf policy to support DRI3 (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | content/gpu/gpu_main.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/common/sandbox_linux/bpf_gpu_policy_linux.cc
diff --git a/content/common/sandbox_linux/bpf_gpu_policy_linux.cc b/content/common/sandbox_linux/bpf_gpu_policy_linux.cc
index 711f9b4a552b23ed22d4a4060ad89bbf7b0ab6ee..e7e86312c55b698b0be7f77a3221effb1bdbbe96 100644
--- a/content/common/sandbox_linux/bpf_gpu_policy_linux.cc
+++ b/content/common/sandbox_linux/bpf_gpu_policy_linux.cc
@@ -141,6 +141,9 @@ ResultExpr GpuBrokerProcessPolicy::EvaluateSyscall(int sysno) const {
case __NR_access:
case __NR_open:
case __NR_openat:
+#if !defined(OS_CHROMEOS)
+ case __NR_unlink:
+#endif
return Allow();
default:
return GpuProcessPolicy::EvaluateSyscall(sysno);
@@ -184,6 +187,9 @@ GpuProcessPolicy::~GpuProcessPolicy() {}
// Main policy for x86_64/i386. Extended by CrosArmGpuProcessPolicy.
ResultExpr GpuProcessPolicy::EvaluateSyscall(int sysno) const {
switch (sysno) {
+#if !defined(OS_CHROMEOS)
+ case __NR_ftruncate:
+#endif
case __NR_ioctl:
return Allow();
case __NR_mincore:
@@ -261,6 +267,7 @@ void GpuProcessPolicy::InitGpuBrokerProcess(
const std::vector<BrokerFilePermission>& permissions_extra) {
static const char kDriRcPath[] = "/etc/drirc";
static const char kDriCard0Path[] = "/dev/dri/card0";
+ static const char kDevShm[] = "/dev/shm/";
CHECK(broker_process_ == NULL);
@@ -268,7 +275,10 @@ void GpuProcessPolicy::InitGpuBrokerProcess(
std::vector<BrokerFilePermission> permissions;
permissions.push_back(BrokerFilePermission::ReadWrite(kDriCard0Path));
permissions.push_back(BrokerFilePermission::ReadOnly(kDriRcPath));
-
+ if (!IsChromeOS()) {
+ permissions.push_back(
+ BrokerFilePermission::ReadWriteCreateUnlinkRecursive(kDevShm));
+ }
Jorge Lucangeli Obes 2014/12/02 21:09:06 Let's keep the empty line below.
leecam 2014/12/03 17:08:51 Done.
// Add eventual extra files from permissions_extra.
for (const auto& perm : permissions_extra) {
permissions.push_back(perm);
« no previous file with comments | « no previous file | content/gpu/gpu_main.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698