mm/core, x86/mm/pkeys: Differentiate instruction fetches
[linux-2.6-block.git] / arch / x86 / include / asm / mmu_context.h
index b4d939a17e609ec771f5579c9b7350f68e8cb0f6..6572b949cbca61bbe37ceba849a84695067ef866 100644 (file)
@@ -323,8 +323,11 @@ static inline bool vma_is_foreign(struct vm_area_struct *vma)
 }
 
 static inline bool arch_vma_access_permitted(struct vm_area_struct *vma,
-               bool write, bool foreign)
+               bool write, bool execute, bool foreign)
 {
+       /* pkeys never affect instruction fetches */
+       if (execute)
+               return true;
        /* allow access if the VMA is not one from this process */
        if (foreign || vma_is_foreign(vma))
                return true;