Chromium Code Reviews| Index: content/common/sandbox_linux/bpf_renderer_policy_linux.cc |
| diff --git a/content/common/sandbox_linux/bpf_renderer_policy_linux.cc b/content/common/sandbox_linux/bpf_renderer_policy_linux.cc |
| index a3e74389425729b4762cb22e7d5acddd717a3281..b6a960ceef31fa377ebf9fdaeddc985a8ad1284a 100644 |
| --- a/content/common/sandbox_linux/bpf_renderer_policy_linux.cc |
| +++ b/content/common/sandbox_linux/bpf_renderer_policy_linux.cc |
| @@ -15,6 +15,19 @@ |
| #include "sandbox/linux/seccomp-bpf-helpers/syscall_sets.h" |
| #include "sandbox/linux/system_headers/linux_syscalls.h" |
| +#if defined(OS_CHROMEOS) |
| +// TODO(vignatti): replace the local definitions below with #include |
| +// <linux/dma-buf.h> once kernel version 4.6 becomes widely used. |
| +#include <linux/types.h> |
| + |
| +struct local_dma_buf_sync { |
| + __u64 flags; |
| +}; |
| +#define LOCAL_DMA_BUF_BASE 'b' |
|
rickyz (no longer on Chrome)
2016/04/06 02:04:48
Not sure how problematic this is likely to be with
vignatti (out of this project)
2016/04/06 13:52:46
https://github.com/torvalds/linux/blob/master/Docu
|
| +#define LOCAL_DMA_BUF_IOCTL_SYNC \ |
| + _IOW(LOCAL_DMA_BUF_BASE, 0, struct local_dma_buf_sync) |
| +#endif |
| + |
| using sandbox::SyscallSets; |
| using sandbox::bpf_dsl::Allow; |
| using sandbox::bpf_dsl::Arg; |
| @@ -30,6 +43,10 @@ ResultExpr RestrictIoctl() { |
| return Switch(request) |
| .SANDBOX_BPF_DSL_CASES((static_cast<unsigned long>(TCGETS), FIONREAD), |
| Allow()) |
| +#if defined(OS_CHROMEOS) |
| + .SANDBOX_BPF_DSL_CASES( |
| + (static_cast<unsigned long>(LOCAL_DMA_BUF_IOCTL_SYNC)), Allow()) |
| +#endif |
| .Default(sandbox::CrashSIGSYSIoctl()); |
| } |