Bug 1462640 - Allow content processes to mincore() individual pages. r?gcp draft
authorJed Davis <jld@mozilla.com>
Fri, 18 May 2018 17:36:47 -0600
changeset 797423 e777d14901d1a5b9983e29034cc9252cd4b4810c
parent 797378 e1fafe357b36270b835acf86f17aef855ce76fa5
push id110476
push userbmo:jld@mozilla.com
push dateSat, 19 May 2018 02:11:05 +0000
reviewersgcp
bugs1462640
milestone62.0a1
Bug 1462640 - Allow content processes to mincore() individual pages. r?gcp MozReview-Commit-ID: IclghYFyMPp
security/sandbox/linux/SandboxFilter.cpp
--- a/security/sandbox/linux/SandboxFilter.cpp
+++ b/security/sandbox/linux/SandboxFilter.cpp
@@ -1048,16 +1048,24 @@ public:
 
     case __NR_mprotect:
     case __NR_brk:
     case __NR_madvise:
       // libc's realloc uses mremap (Bug 1286119); wasm does too (bug 1342385).
     case __NR_mremap:
       return Allow();
 
+      // Bug 1462640: Mesa libEGL uses mincore to test whether values
+      // are pointers, for reasons.
+    case __NR_mincore: {
+      Arg<size_t> length(1);
+      return If(length == getpagesize(), Allow())
+             .Else(SandboxPolicyCommon::EvaluateSyscall(sysno));
+    }
+
     case __NR_sigaltstack:
       return Allow();
 
 #ifdef __NR_set_thread_area
     case __NR_set_thread_area:
       return Allow();
 #endif