X-Git-Url: http://git.cascardo.info/?a=blobdiff_plain;f=mm%2Fmmap.c;h=7a0707a480479f1837cc6537182300bd6d94d51f;hb=521f3970853a4b2ff7f833763532bdba2ea11257;hp=ca9d91bca0d6c61983707f23641507dee0540af2;hpb=539294b76af8922297702a7ebb8cafe68f7e5376;p=cascardo%2Flinux.git diff --git a/mm/mmap.c b/mm/mmap.c index ca9d91bca0d6..7a0707a48047 100644 --- a/mm/mmap.c +++ b/mm/mmap.c @@ -88,6 +88,11 @@ static void unmap_region(struct mm_struct *mm, * w: (no) no w: (no) no w: (copy) copy w: (no) no * x: (no) no x: (no) yes x: (no) yes x: (yes) yes * + * On arm64, PROT_EXEC has the following behaviour for both MAP_SHARED and + * MAP_PRIVATE: + * r: (no) no + * w: (no) no + * x: (yes) yes */ pgprot_t protection_map[16] = { __P000, __P001, __P010, __P011, __P100, __P101, __P110, __P111, @@ -3063,6 +3068,14 @@ out: return ERR_PTR(ret); } +bool vma_is_special_mapping(const struct vm_area_struct *vma, + const struct vm_special_mapping *sm) +{ + return vma->vm_private_data == sm && + (vma->vm_ops == &special_mapping_vmops || + vma->vm_ops == &legacy_special_mapping_vmops); +} + /* * Called with mm->mmap_sem held for writing. * Insert a new vma covering the given region, with the given flags.