OpenCloudOS-Kernel/arch/loongarch/mm
Jiantao Shan c15b5c6fab LoongArch: Fix access error when read fault on a write-only VMA
commit efb44ff64c95340b06331fc48634b99efc9dd77c 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
..
Makefile LoongArch: Add KASAN (Kernel Address Sanitizer) support 2023-09-06 22:54:16 +08:00
cache.c LoongArch: Remove shm_align_mask and use SHMLBA instead 2023-09-06 22:53:09 +08:00
extable.c LoongArch: BPF: Add BPF exception tables 2022-12-14 08:36:11 +08:00
fault.c LoongArch: Fix access error when read fault on a write-only VMA 2024-05-02 16:32:45 +02:00
hugetlbpage.c LoongArch: Fix some build warnings with W=1 2023-09-20 14:26:28 +08:00
init.c LoongArch: Replace kmap_atomic() with kmap_local_page() in copy_user_highpage() 2023-10-18 08:42:52 +08:00
ioremap.c LoongArch: Fix some build warnings with W=1 2023-09-20 14:26:28 +08:00
kasan_init.c LoongArch: Fix earlycon parameter if KASAN enabled 2024-02-23 09:25:16 +01:00
maccess.c
mmap.c LoongArch: Remove shm_align_mask and use SHMLBA instead 2023-09-06 22:53:09 +08:00
page.S LoongArch: Replace #include <asm/export.h> with #include <linux/export.h> 2023-08-25 23:40:26 +08:00
pgtable.c LoongArch: Mark {dmw,tlb}_virt_to_page() exports as non-GPL 2023-12-20 17:01:57 +01:00
tlb.c LoongArch/smp: Call rcutree_report_cpu_starting() at tlb_init() 2024-02-05 20:14:38 +00:00
tlbex.S LoongArch: Use SYM_CODE_* to annotate exception handlers 2023-10-18 08:42:52 +08:00