linux-stable/arch/loongarch/mm
Jiantao Shan ba9bcc0e58 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:29:28 +02:00
..
cache.c LoongArch: Refactor cache probe and flush methods 2022-10-12 16:36:14 +08:00
extable.c
fault.c LoongArch: Fix access error when read fault on a write-only VMA 2024-05-02 16:29:28 +02:00
hugetlbpage.c
init.c LoongArch: Replace kmap_atomic() with kmap_local_page() in copy_user_highpage() 2023-11-08 14:11:01 +01:00
ioremap.c
maccess.c
Makefile
mmap.c LoongArch: Support access filter to /dev/mem interface 2022-10-12 16:36:14 +08:00
page.S LoongArch: Re-tab the assembly files 2022-07-29 18:22:32 +08:00
pgtable.c loongarch: drop definition of PGD_ORDER 2022-07-17 17:14:43 -07:00
tlb.c LoongArch/smp: Call rcutree_report_cpu_starting() at tlb_init() 2024-02-05 20:13:02 +00:00
tlbex.S LoongArch: mm: Fix huge page entry update for virtual machine 2022-12-08 14:59:15 +08:00