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

Side by Side Diff: content/common/sandbox_linux/bpf_cros_arm_gpu_policy_linux.cc

Issue 834113004: Add V4L2 device permissions on x86 CrOS which has ozone flag (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: address review comments Created 5 years, 11 months 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 unified diff | Download patch
« no previous file with comments | « no previous file | content/common/sandbox_linux/bpf_gpu_policy_linux.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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_cros_arm_gpu_policy_linux.h" 5 #include "content/common/sandbox_linux/bpf_cros_arm_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 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
52 return true; 52 return true;
53 #else 53 #else
54 return false; 54 return false;
55 #endif 55 #endif
56 } 56 }
57 57
58 void AddArmMaliGpuWhitelist(std::vector<BrokerFilePermission>* permissions) { 58 void AddArmMaliGpuWhitelist(std::vector<BrokerFilePermission>* permissions) {
59 // Device file needed by the ARM GPU userspace. 59 // Device file needed by the ARM GPU userspace.
60 static const char kMali0Path[] = "/dev/mali0"; 60 static const char kMali0Path[] = "/dev/mali0";
61 61
62 // Device nodes for V4L2 video decode accelerator drivers.
63 static const char kDevVideoDecPath[] = "/dev/video-dec";
64
65 // Video processor used on ARM Exynos platforms. 62 // Video processor used on ARM Exynos platforms.
66 static const char kDevGsc1Path[] = "/dev/gsc1"; 63 static const char kDevGsc1Path[] = "/dev/gsc1";
67 64
68 // Device nodes for V4L2 video encode accelerator drivers.
69 static const char kDevVideoEncPath[] = "/dev/video-enc";
70
71 permissions->push_back(BrokerFilePermission::ReadWrite(kMali0Path)); 65 permissions->push_back(BrokerFilePermission::ReadWrite(kMali0Path));
72 permissions->push_back(BrokerFilePermission::ReadWrite(kDevVideoDecPath));
73 permissions->push_back(BrokerFilePermission::ReadWrite(kDevGsc1Path)); 66 permissions->push_back(BrokerFilePermission::ReadWrite(kDevGsc1Path));
74 permissions->push_back(BrokerFilePermission::ReadWrite(kDevVideoEncPath));
75 } 67 }
76 68
77 void AddArmGpuWhitelist(std::vector<BrokerFilePermission>* permissions) { 69 void AddArmGpuWhitelist(std::vector<BrokerFilePermission>* permissions) {
78 // On ARM we're enabling the sandbox before the X connection is made, 70 // On ARM we're enabling the sandbox before the X connection is made,
79 // so we need to allow access to |.Xauthority|. 71 // so we need to allow access to |.Xauthority|.
80 static const char kXAuthorityPath[] = "/home/chronos/.Xauthority"; 72 static const char kXAuthorityPath[] = "/home/chronos/.Xauthority";
81 static const char kLdSoCache[] = "/etc/ld.so.cache"; 73 static const char kLdSoCache[] = "/etc/ld.so.cache";
82 74
83 // Files needed by the ARM GPU userspace. 75 // Files needed by the ARM GPU userspace.
84 static const char kLibGlesPath[] = "/usr/lib/libGLESv2.so.2"; 76 static const char kLibGlesPath[] = "/usr/lib/libGLESv2.so.2";
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after
176 // Preload the Tegra V4L2 (video decode acceleration) library. 168 // Preload the Tegra V4L2 (video decode acceleration) library.
177 dlopen("/usr/lib/libtegrav4l2.so", dlopen_flag); 169 dlopen("/usr/lib/libtegrav4l2.so", dlopen_flag);
178 // Resetting errno since platform-specific libraries will fail on other 170 // Resetting errno since platform-specific libraries will fail on other
179 // platforms. 171 // platforms.
180 errno = 0; 172 errno = 0;
181 173
182 return true; 174 return true;
183 } 175 }
184 176
185 } // namespace content 177 } // namespace content
OLDNEW
« no previous file with comments | « no previous file | content/common/sandbox_linux/bpf_gpu_policy_linux.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698