Author: skra
Date: Wed Feb 17 12:30:59 2016
New Revision: 295693
URL: https://svnweb.freebsd.org/changeset/base/295693

Log:
  Evaluate also VM_PROT_EXECUTE protection in pmap_preboot_map_attr().
  Before this change all mappings done by this function were executable
  as pte entries have NOT EXECUTABLE bit.
  
  The function is used only for static device mappings at present. Thus
  this is also a fix as DEVICE memory should not be mapped as executable.

Modified:
  head/sys/arm/arm/pmap-v6.c

Modified: head/sys/arm/arm/pmap-v6.c
==============================================================================
--- head/sys/arm/arm/pmap-v6.c  Wed Feb 17 11:40:03 2016        (r295692)
+++ head/sys/arm/arm/pmap-v6.c  Wed Feb 17 12:30:59 2016        (r295693)
@@ -1022,6 +1022,7 @@ pmap_preboot_map_attr(vm_paddr_t pa, vm_
        pt2_entry_t *pte2p;
 
        l2_prot = prot & VM_PROT_WRITE ? PTE2_AP_KRW : PTE2_AP_KR;
+       l2_prot |= (prot & VM_PROT_EXECUTE) ? PTE2_X : PTE2_NX;
        l2_attr = vm_memattr_to_pte2(attr);
        l1_prot = ATTR_TO_L1(l2_prot);
        l1_attr = ATTR_TO_L1(l2_attr);
_______________________________________________
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"

Reply via email to