From: Ard Biesheuvel <[email protected]>

Currently, pgattr_change_is_safe() is overly pedantic when it comes to
descriptors with the contiguous hint attribute set, as it rejects
assignments even if the old and the new value are the same.

So relax the check to allow that.

Signed-off-by: Ard Biesheuvel <[email protected]>
---
 arch/arm64/mm/mmu.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/arm64/mm/mmu.c b/arch/arm64/mm/mmu.c
index c36422a3fae2..9d39de3cfe67 100644
--- a/arch/arm64/mm/mmu.c
+++ b/arch/arm64/mm/mmu.c
@@ -141,7 +141,7 @@ bool pgattr_change_is_safe(pteval_t old, pteval_t new)
                return false;
 
        /* live contiguous mappings may not be manipulated at all */
-       if ((old | new) & PTE_CONT)
+       if ((old | new) & PTE_CONT && old != new)
                return false;
 
        /* Transitioning from Non-Global to Global is unsafe */
-- 
2.52.0.457.g6b5491de43-goog


Reply via email to