Skip to content

Commit

Permalink
[linux][sandbox] Allow memfd_create() syscall in GPU process
Browse files Browse the repository at this point in the history
Some Vulkan implementations, particularly swiftshader and i915 drivers
use memdfd_create() to implement vkGetSemaphoreFdKHR() API. That syscall
was previously enabled only on ChromeOS, which was breaking swiftshader
tests when trying to enable synchronization for some images (see
http://crrev.com/c/2353413 )

Bug: 1115692
Change-Id: Id0898d6d77ad8aa5140ffe34aa7dafbc3fe19249
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2354205
Commit-Queue: Sergey Ulanov <sergeyu@chromium.org>
Commit-Queue: Robert Sesek <rsesek@chromium.org>
Auto-Submit: Sergey Ulanov <sergeyu@chromium.org>
Reviewed-by: Robert Sesek <rsesek@chromium.org>
Cr-Commit-Position: refs/heads/master@{#797886}
  • Loading branch information
SergeyUlanov authored and Commit Bot committed Aug 13, 2020
1 parent f8c588c commit 16c358c
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions sandbox/policy/linux/bpf_gpu_policy_linux.cc
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,7 @@ ResultExpr GpuProcessPolicy::EvaluateSyscall(int sysno) const {
switch (sysno) {
case __NR_kcmp:
return Error(ENOSYS);
#if defined(OS_CHROMEOS)
case __NR_memfd_create:
#else // !defined(OS_CHROMEOS)
#if !defined(OS_CHROMEOS)
case __NR_fallocate:
#endif // defined(OS_CHROMEOS)
case __NR_ftruncate:
Expand All @@ -55,6 +53,7 @@ ResultExpr GpuProcessPolicy::EvaluateSyscall(int sysno) const {
#endif
case __NR_getdents64:
case __NR_ioctl:
case __NR_memfd_create:
return Allow();
#if defined(__i386__) || defined(__x86_64__) || defined(__mips__)
// The Nvidia driver uses flags not in the baseline policy
Expand Down

0 comments on commit 16c358c

Please sign in to comment.