linux-stable/arch/loongarch
Jiantao Shan c15b5c6fab LoongArch: Fix access error when read fault on a write-only VMA
commit efb44ff64c upstream.

As with most architectures, allow handling of read faults in VMAs that
have VM_WRITE but without VM_READ (WRITE implies READ).

Otherwise, reading before writing a write-only memory will error while
reading after writing everything is fine.

BTW, move the VM_EXEC judgement before VM_READ/VM_WRITE to make logic a
little clearer.

Cc: stable@vger.kernel.org
Fixes: 09cfefb7fa ("LoongArch: Add memory management")
Signed-off-by: Jiantao Shan <shanjiantao@loongson.cn>
Signed-off-by: Huacai Chen <chenhuacai@loongson.cn>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2024-05-02 16:32:45 +02:00
..
boot loongarch: efi: enable generic EFI compressed boot 2022-09-20 09:50:31 +02:00
configs LoongArch: Update Loongson-3 default config file 2023-09-07 12:06:20 +08:00
crypto LoongArch/crypto: Clean up useless assignment operations 2024-04-03 15:28:36 +02:00
include LoongArch: Fix callchain parse error with kernel tracepoint events 2024-05-02 16:32:45 +02:00
kernel LoongArch: Update cpu_sibling_map when disabling nonboot CPUs 2024-03-01 13:34:58 +01:00
lib LoongArch: Add KASAN (Kernel Address Sanitizer) support 2023-09-06 22:54:16 +08:00
mm LoongArch: Fix access error when read fault on a write-only VMA 2024-05-02 16:32:45 +02:00
net LoongArch: BPF: Prevent out-of-bounds memory access 2024-01-25 15:35:58 -08:00
pci LoongArch: Add FDT booting support from efi system table 2022-12-14 08:41:53 +08:00
power LoongArch: Export some arch-specific pm interfaces 2023-06-29 20:58:44 +08:00
vdso LoongArch: vDSO: Disable UBSAN instrumentation 2024-03-01 13:34:55 +01:00
Kbuild LoongArch: Add BPF JIT support 2022-10-12 16:36:20 +08:00
Kconfig LoongArch: Select HAVE_ARCH_SECCOMP to use the common SECCOMP menu 2024-03-01 13:34:55 +01:00
Kconfig.debug LoongArch: Add prologue unwinder support 2022-08-12 13:10:11 +08:00
Makefile LoongArch: Apply dynamic relocations for LLD 2024-01-20 11:51:42 +01:00