linux-stable/arch
Catalin Marinas 343e5699b7 arm64: Ensure VM_WRITE|VM_SHARED ptes are clean by default
commit aa57157be6 upstream.

Shared and writable mappings (__S.1.) should be clean (!dirty) initially
and made dirty on a subsequent write either through the hardware DBM
(dirty bit management) mechanism or through a write page fault. A clean
pte for the arm64 kernel is one that has PTE_RDONLY set and PTE_DIRTY
clear.

The PAGE_SHARED{,_EXEC} attributes have PTE_WRITE set (PTE_DBM) and
PTE_DIRTY clear. Prior to commit 73e86cb03c ("arm64: Move PTE_RDONLY
bit handling out of set_pte_at()"), it was the responsibility of
set_pte_at() to set the PTE_RDONLY bit and mark the pte clean if the
software PTE_DIRTY bit was not set. However, the above commit removed
the pte_sw_dirty() check and the subsequent setting of PTE_RDONLY in
set_pte_at() while leaving the PAGE_SHARED{,_EXEC} definitions
unchanged. The result is that shared+writable mappings are now dirty by
default

Fix the above by explicitly setting PTE_RDONLY in PAGE_SHARED{,_EXEC}.
In addition, remove the superfluous PTE_DIRTY bit from the kernel PROT_*
attributes.

Fixes: 73e86cb03c ("arm64: Move PTE_RDONLY bit handling out of set_pte_at()")
Cc: <stable@vger.kernel.org> # 4.14.x-
Cc: Will Deacon <will@kernel.org>
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
Signed-off-by: Will Deacon <will@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-11-06 12:43:35 +01:00
..
alpha alpha: Fix Eiger NR_IRQS to 128 2019-02-20 10:20:53 +01:00
arc ARC: hide unused function unw_hdr_alloc 2019-07-21 09:04:41 +02:00
arm xen/efi: Set nonblocking callbacks 2019-10-29 09:16:56 +01:00
arm64 arm64: Ensure VM_WRITE|VM_SHARED ptes are clean by default 2019-11-06 12:43:35 +01:00
blackfin
c6x
cris bug.h: work around GCC PR82365 in BUG() 2018-05-30 07:52:00 +02:00
frv
h8300 h8300: use cc-cross-prefix instead of hardcoding h8300-unknown-linux- 2019-04-05 22:31:25 +02:00
hexagon hexagon: modify ffs() and fls() to return int 2018-10-10 08:54:25 +02:00
ia64 ia64:unwind: fix double free for mod->arch.init_unw_table 2019-10-05 12:47:48 +02:00
m32r m32r: fix endianness constraints 2018-02-28 10:19:44 +01:00
m68k m68k: Add -ffreestanding to CFLAGS 2019-03-23 14:35:21 +01:00
metag
microblaze microblaze: Fix simpleImage format generation 2018-08-03 07:50:40 +02:00
mips MIPS: fw: sni: Fix out of bounds init of o32 stack 2019-11-06 12:43:17 +01:00
mn10300
nios2
openrisc openrisc: entry: Fix delay slot exception detection 2018-08-24 13:09:11 +02:00
parisc parisc: Fix vmap memory leak in ioremap()/iounmap() 2019-10-29 09:17:40 +01:00
powerpc powerpc/powernv: hold device_hotplug_lock when calling memtrace_offline_pages() 2019-11-06 12:42:53 +01:00
s390 s390/idle: fix cpu idle time calculation 2019-11-06 12:43:35 +01:00
score
sh sh: kernel: hw_breakpoint: Fix missing break in switch statement 2019-08-25 10:50:01 +02:00
sparc bpf: get rid of pure_initcall dependency to enable jits 2019-08-25 10:50:02 +02:00
tile
um um: Silence lockdep complaint about mmap_sem 2019-07-31 07:28:53 +02:00
unicore32
x86 perf/x86/amd: Change/fix NMI latency mitigation to use a timestamp 2019-11-06 12:43:16 +01:00
xtensa xtensa: drop EXPORT_SYMBOL for outs*/ins* 2019-10-29 09:17:40 +01:00
.gitignore
Kconfig compiler.h: Allow arch-specific asm/compiler.h 2018-11-04 14:52:46 +01:00