summaryrefslogtreecommitdiffstats
path: root/arch/loongarch/lib/clear_user.S
diff options
context:
space:
mode:
authorWANG Rui <wangrui@loongson.cn>2023-07-28 10:30:42 +0800
committerHuacai Chen <chenhuacai@loongson.cn>2023-07-28 10:30:42 +0800
commite66d511fc92201ba481392e54896f1aeadfcf0e9 (patch)
tree4e520ef70f54e959e6ffd4c523b4c9f4dbf706cd /arch/loongarch/lib/clear_user.S
parent83da30d73b86ab5898fb84f8b49c11557c3fcc67 (diff)
downloadlinux-stable-e66d511fc92201ba481392e54896f1aeadfcf0e9.tar.gz
linux-stable-e66d511fc92201ba481392e54896f1aeadfcf0e9.tar.bz2
linux-stable-e66d511fc92201ba481392e54896f1aeadfcf0e9.zip
LoongArch: Fix return value underflow in exception path
This patch fixes an underflow issue in the return value within the exception path, specifically at .Llt8 when the remaining length is less than 8 bytes. Cc: stable@vger.kernel.org Fixes: 8941e93ca590 ("LoongArch: Optimize memory ops (memset/memcpy/memmove)") Reported-by: Weihao Li <liweihao@loongson.cn> Signed-off-by: WANG Rui <wangrui@loongson.cn> Signed-off-by: Huacai Chen <chenhuacai@loongson.cn>
Diffstat (limited to 'arch/loongarch/lib/clear_user.S')
-rw-r--r--arch/loongarch/lib/clear_user.S3
1 files changed, 2 insertions, 1 deletions
diff --git a/arch/loongarch/lib/clear_user.S b/arch/loongarch/lib/clear_user.S
index fd1d62b244f2..9dcf71719387 100644
--- a/arch/loongarch/lib/clear_user.S
+++ b/arch/loongarch/lib/clear_user.S
@@ -108,6 +108,7 @@ SYM_FUNC_START(__clear_user_fast)
addi.d a3, a2, -8
bgeu a0, a3, .Llt8
15: st.d zero, a0, 0
+ addi.d a0, a0, 8
.Llt8:
16: st.d zero, a2, -8
@@ -188,7 +189,7 @@ SYM_FUNC_START(__clear_user_fast)
_asm_extable 13b, .L_fixup_handle_0
_asm_extable 14b, .L_fixup_handle_1
_asm_extable 15b, .L_fixup_handle_0
- _asm_extable 16b, .L_fixup_handle_1
+ _asm_extable 16b, .L_fixup_handle_0
_asm_extable 17b, .L_fixup_handle_s0
_asm_extable 18b, .L_fixup_handle_s0
_asm_extable 19b, .L_fixup_handle_s0