Skip to content
Commit c15b5c6f authored by Jiantao Shan's avatar Jiantao Shan Committed by Greg Kroah-Hartman
Browse files

LoongArch: Fix access error when read fault on a write-only VMA



commit efb44ff6 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: 09cfefb7 ("LoongArch: Add memory management")
Signed-off-by: default avatarJiantao Shan <shanjiantao@loongson.cn>
Signed-off-by: default avatarHuacai Chen <chenhuacai@loongson.cn>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 2c733bb7
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment