diff options
author | 2023-07-28 10:30:42 +0800 | |
---|---|---|
committer | 2023-07-28 10:30:42 +0800 | |
commit | e66d511fc92201ba481392e54896f1aeadfcf0e9 (patch) | |
tree | 4e520ef70f54e959e6ffd4c523b4c9f4dbf706cd /arch/loongarch/lib/copy_user.S | |
parent | LoongArch: Fix CMDLINE_EXTEND and CMDLINE_BOOTLOADER handling (diff) | |
download | wireguard-linux-e66d511fc92201ba481392e54896f1aeadfcf0e9.tar.xz wireguard-linux-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 '')
-rw-r--r-- | arch/loongarch/lib/copy_user.S | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/arch/loongarch/lib/copy_user.S b/arch/loongarch/lib/copy_user.S index b21f6d5d38f5..fecd08cad702 100644 --- a/arch/loongarch/lib/copy_user.S +++ b/arch/loongarch/lib/copy_user.S @@ -136,6 +136,7 @@ SYM_FUNC_START(__copy_user_fast) bgeu a1, a4, .Llt8 30: ld.d t0, a1, 0 31: st.d t0, a0, 0 + addi.d a0, a0, 8 .Llt8: 32: ld.d t0, a3, -8 @@ -246,7 +247,7 @@ SYM_FUNC_START(__copy_user_fast) _asm_extable 30b, .L_fixup_handle_0 _asm_extable 31b, .L_fixup_handle_0 _asm_extable 32b, .L_fixup_handle_0 - _asm_extable 33b, .L_fixup_handle_1 + _asm_extable 33b, .L_fixup_handle_0 _asm_extable 34b, .L_fixup_handle_s0 _asm_extable 35b, .L_fixup_handle_s0 _asm_extable 36b, .L_fixup_handle_s0 |