@@ -580,7 +580,7 @@ static inline pgprot_t static_protections(pgprot_t prot, unsigned long start,
580
580
}
581
581
582
582
/*
583
- * Validate and enforce strict W^X semantics.
583
+ * Validate strict W^X semantics.
584
584
*/
585
585
static inline pgprot_t verify_rwx (pgprot_t old , pgprot_t new , unsigned long start ,
586
586
unsigned long pfn , unsigned long npg )
@@ -595,7 +595,7 @@ static inline pgprot_t verify_rwx(pgprot_t old, pgprot_t new, unsigned long star
595
595
if (IS_ENABLED (CONFIG_X86_32 ))
596
596
return new ;
597
597
598
- /* Only enforce when NX is supported: */
598
+ /* Only verify when NX is supported: */
599
599
if (!(__supported_pte_mask & _PAGE_NX ))
600
600
return new ;
601
601
@@ -606,13 +606,17 @@ static inline pgprot_t verify_rwx(pgprot_t old, pgprot_t new, unsigned long star
606
606
return new ;
607
607
608
608
end = start + npg * PAGE_SIZE - 1 ;
609
- WARN_ONCE (1 , "CPA refuse W^X violation: %016llx -> %016llx range: 0x%016lx - 0x%016lx PFN %lx\n" ,
609
+ WARN_ONCE (1 , "CPA detected W^X violation: %016llx -> %016llx range: 0x%016lx - 0x%016lx PFN %lx\n" ,
610
610
(unsigned long long )pgprot_val (old ),
611
611
(unsigned long long )pgprot_val (new ),
612
612
start , end , pfn );
613
613
614
- /* refuse the transition into WX */
615
- return old ;
614
+ /*
615
+ * For now, allow all permission change attempts by returning the
616
+ * attempted permissions. This can 'return old' to actively
617
+ * refuse the permission change at a later time.
618
+ */
619
+ return new ;
616
620
}
617
621
618
622
/*
0 commit comments