linux-stable/arch/parisc
John David Anglin 38860b2c8b parisc: Flush kernel data mapping in set_pte_at() when installing pte for user page
For years, there have been random segmentation faults in userspace on
SMP PA-RISC machines.  It occurred to me that this might be a problem in
set_pte_at().  MIPS and some other architectures do cache flushes when
installing PTEs with the present bit set.

Here I have adapted the code in update_mmu_cache() to flush the kernel
mapping when the kernel flush is deferred, or when the kernel mapping
may alias with the user mapping.  This simplifies calls to
update_mmu_cache().

I also changed the barrier in set_pte() from a compiler barrier to a
full memory barrier.  I know this change is not sufficient to fix the
problem.  It might not be needed.

I have had a few days of operation with 5.14.16 to 5.15.1 and haven't
seen any random segmentation faults on rp3440 or c8000 so far.

Signed-off-by: John David Anglin <dave.anglin@bell.net>
Signed-off-by: Helge Deller <deller@gmx.de>
Cc: stable@kernel.org # 5.12+
2021-11-13 22:10:56 +01:00
..
boot parisc: decompressor: clean up Makefile 2021-11-01 07:36:01 +01:00
configs parisc: Update defconfigs 2021-11-01 07:36:02 +01:00
include parisc: Flush kernel data mapping in set_pte_at() when installing pte for user page 2021-11-13 22:10:56 +01:00
kernel parisc: Flush kernel data mapping in set_pte_at() when installing pte for user page 2021-11-13 22:10:56 +01:00
lib parisc: mark xchg functions notrace 2021-11-01 07:36:00 +01:00
math-emu parisc: math-emu: Fix fall-through warnings 2021-09-01 22:18:18 +02:00
mm parisc: Fix set_fixmap() on PA1.x CPUs 2021-11-01 12:00:22 +01:00
defpalo.conf
install.sh parisc: Install vmlinuz instead of zImage file 2020-10-15 08:10:39 +02:00
Kbuild kbuild: use more subdir- for visiting subdirectories while cleaning 2021-10-24 13:49:46 +09:00
Kconfig parisc: Move thread_info into task struct 2021-11-01 07:35:59 +01:00
Kconfig.debug tracing: Refactor TRACE_IRQFLAGS_SUPPORT in Kconfig 2021-08-16 11:37:21 -04:00
Makefile kbuild: use more subdir- for visiting subdirectories while cleaning 2021-10-24 13:49:46 +09:00
nm