[PW_SID:1148295] riscv: lib: Fix address overflow due to large count values in strnlen ZBB path - #2492
[PW_SID:1148295] riscv: lib: Fix address overflow due to large count values in strnlen ZBB path#2492linux-riscv-bot wants to merge 1 commit into
Conversation
… ZBB path Hi all, This patch fixes an issue in the RISC-V ZBB optimized strnlen implementation. Problem description: When using the ZBB optimized strnlen implementation, passing very large count values (such as SIZE_MAX) can cause address overflow and return incorrect results. This issue was observed in device-mapper tests: sh-5.2# dmsetup create testname9 --table "0 8 zero" sh-5.2# cat /sys/block/dm-*/dm/name testname sh-5.2# dmsetup remove testname9 The overflow in strnlen caused failures in string handling during device-mapper operations. Patch summary: - Explicitly introduce the strnlen_generic label. - Simplify the generic implementation loop. - Add fallback logic in strnlen_zbb to redirect to the generic path when a0 + a1 overflows. This ensures correct behavior for large count values and SIZE_MAX cases. Fixes: 5ba15d4 ("riscv: lib: add strnlen() implementation") Signed-off-by: Gao Rui <gao.rui@zte.com.cn> Signed-off-by: Linux RISC-V bot <linux.riscv.bot@gmail.com>
|
Patch 1: "riscv: lib: Fix address overflow due to large count values in strnlen ZBB path" |
|
Patch 1: "riscv: lib: Fix address overflow due to large count values in strnlen ZBB path" |
|
Patch 1: "riscv: lib: Fix address overflow due to large count values in strnlen ZBB path" |
|
Patch 1: "riscv: lib: Fix address overflow due to large count values in strnlen ZBB path" |
|
Patch 1: "riscv: lib: Fix address overflow due to large count values in strnlen ZBB path" |
|
Patch 1: "riscv: lib: Fix address overflow due to large count values in strnlen ZBB path" |
|
Patch 1: "riscv: lib: Fix address overflow due to large count values in strnlen ZBB path" |
|
Patch 1: "riscv: lib: Fix address overflow due to large count values in strnlen ZBB path" |
|
Patch 1: "riscv: lib: Fix address overflow due to large count values in strnlen ZBB path" |
|
Patch 1: "riscv: lib: Fix address overflow due to large count values in strnlen ZBB path" |
|
Patch 1: "riscv: lib: Fix address overflow due to large count values in strnlen ZBB path" |
|
Patch 1: "riscv: lib: Fix address overflow due to large count values in strnlen ZBB path" |
PR for series 1148295 applied to workflow__riscv__fixes
Name: riscv: lib: Fix address overflow due to large count values in strnlen ZBB path
URL: https://patchwork.kernel.org/project/linux-riscv/list/?series=1148295
Version: 1