Files
android_kernel_xiaomi_sm8450/arch/arm64/include/asm
Catalin Marinas ac15bd63bb arm64: Honour !PTE_WRITE in set_pte_at() for kernel mappings
Currently, set_pte_at() only checks the software PTE_WRITE bit for user
mappings when it sets or clears the hardware PTE_RDONLY accordingly. The
kernel ptes are written directly without any modification, relying
solely on the protection bits in macros like PAGE_KERNEL. However,
modifying kernel pte attributes via pte_wrprotect() would be ignored by
set_pte_at(). Since pte_wrprotect() does not set PTE_RDONLY (it only
clears PTE_WRITE), the new permission is not taken into account.

This patch changes set_pte_at() to adjust the read-only permission for
kernel ptes as well. As a side effect, existing PROT_* definitions used
for kernel ioremap*() need to include PTE_DIRTY | PTE_WRITE.

(additionally, white space fix for PTE_KERNEL_ROX)

Acked-by: Andrey Ryabinin <aryabinin@virtuozzo.com>
Tested-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
Reported-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Signed-off-by: Will Deacon <will.deacon@arm.com>
2016-01-25 11:09:06 +00:00
..
2016-01-12 20:46:53 +02:00
2014-04-18 11:40:33 +02:00
2015-10-28 19:09:17 +00:00
2012-09-17 13:42:21 +01:00
2014-11-05 09:03:25 +01:00
2015-07-27 11:08:42 +01:00
2012-09-17 13:42:21 +01:00
2012-09-17 13:42:04 +01:00
2015-09-16 16:53:39 +02:00
2014-09-25 15:35:41 +01:00
2016-01-15 17:56:32 -08:00
2012-09-17 13:41:56 +01:00
2012-09-17 13:42:19 +01:00
2015-10-19 17:55:12 +01:00
2015-05-19 15:27:42 +01:00
2015-10-29 16:55:15 +00:00
2014-11-28 10:24:59 +00:00
2015-10-12 17:46:36 +01:00
2014-07-10 11:06:00 +01:00
2015-10-14 13:51:41 +01:00
2015-10-14 13:51:41 +01:00
2012-09-17 13:42:09 +01:00
2012-09-17 13:42:09 +01:00