[PW_SID:986268] [v7] riscv: hwprobe: Fix stale vDSO data for late-initialized keys at boot - #702
[PW_SID:986268] [v7] riscv: hwprobe: Fix stale vDSO data for late-initialized keys at boot#702linux-riscv-bot wants to merge 1 commit into
Conversation
The hwprobe vDSO data for some keys, like MISALIGNED_VECTOR_PERF, is determined by an asynchronous kthread. This can create a race condition where the kthread finishes after the vDSO data has already been populated, causing userspace to read stale values. To fix this race, a new 'ready' flag is added to the vDSO data, initialized to 'false' during late_initcall. This flag is checked by both the vDSO's user-space code and the riscv_hwprobe syscall. The syscall serves as a one-time gate, using a completion to wait for any pending probes before populating the data and setting the flag to 'true', thus ensuring userspace reads fresh values on its first request. Reported-by: Tsukasa OI <research_trasio@irq.a4lg.com> Closes: https://lore.kernel.org/linux-riscv/760d637b-b13b-4518-b6bf-883d55d44e7f@irq.a4lg.com/ Fixes: e7c9d66 ("RISC-V: Report vector unaligned access speed hwprobe") Cc: Palmer Dabbelt <palmer@dabbelt.com> Cc: Alexandre Ghiti <alexghiti@rivosinc.com> Cc: Olof Johansson <olof@lixom.net> Cc: stable@vger.kernel.org Co-developed-by: Palmer Dabbelt <palmer@dabbelt.com> Signed-off-by: Jingwei Wang <wangjingwei@iscas.ac.cn> Signed-off-by: Linux RISC-V bot <linux.riscv.bot@gmail.com>
|
Patch 1: "[v7] riscv: hwprobe: Fix stale vDSO data for late-initialized keys at boot" |
|
Patch 1: "[v7] riscv: hwprobe: Fix stale vDSO data for late-initialized keys at boot" |
|
Patch 1: "[v7] riscv: hwprobe: Fix stale vDSO data for late-initialized keys at boot" |
|
Patch 1: "[v7] riscv: hwprobe: Fix stale vDSO data for late-initialized keys at boot" |
|
Patch 1: "[v7] riscv: hwprobe: Fix stale vDSO data for late-initialized keys at boot" |
|
Patch 1: "[v7] riscv: hwprobe: Fix stale vDSO data for late-initialized keys at boot" |
|
Patch 1: "[v7] riscv: hwprobe: Fix stale vDSO data for late-initialized keys at boot" |
|
Patch 1: "[v7] riscv: hwprobe: Fix stale vDSO data for late-initialized keys at boot" |
|
Patch 1: "[v7] riscv: hwprobe: Fix stale vDSO data for late-initialized keys at boot" |
|
Patch 1: "[v7] riscv: hwprobe: Fix stale vDSO data for late-initialized keys at boot" |
|
Patch 1: "[v7] riscv: hwprobe: Fix stale vDSO data for late-initialized keys at boot" |
|
Patch 1: "[v7] riscv: hwprobe: Fix stale vDSO data for late-initialized keys at boot" |
PR for series 986268 applied to workflow__riscv__fixes
Name: [v7] riscv: hwprobe: Fix stale vDSO data for late-initialized keys at boot
URL: https://patchwork.kernel.org/project/linux-riscv/list/?series=986268
Version: 7