linux-stable/arch/loongarch/mm
Jiantao Shan efb44ff64c LoongArch: Fix access error when read fault on a write-only VMA
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>
2024-04-24 12:36:07 +08: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-04-24 12:36:07 +08: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-06 12:32:05 +08:00
maccess.c
mmap.c LoongArch: Make virt_addr_valid()/__virt_addr_valid() work with KFENCE 2024-04-10 21:08:51 +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: Make {virt, phys, page, pfn} translation work with KFENCE 2024-04-10 21:08:51 +08:00
tlb.c LoongArch: Add ORC stack unwinder support 2024-03-11 22:23:47 +08:00
tlbex.S LoongArch: Add ORC stack unwinder support 2024-03-11 22:23:47 +08:00