linux/tools/testing/selftests/riscv
Wang Yan 58a37e7317 selftests/riscv: ptrace: Fix memory leak of regset_data in vector tests
The regset_data buffer allocated with calloc() in the parent process
of several vector ptrace tests is never freed before returning,
causing memory leaks in:

- ptrace_v_not_enabled
- ptrace_v_early_debug
- ptrace_v_syscall_clobbering
- v_csr_invalid/ptrace_v_invalid_values
- v_csr_valid/ptrace_v_valid_values

Add free(regset_data) before kill(pid, SIGKILL) to release the
allocated buffer.

Signed-off-by: Wang Yan <wangyan01@kylinos.cn>
Reviewed-by: Sergey Matyukevich <geomatsi@gmail.com>
Link: https://patch.msgid.link/20260710083437.489648-1-wangyan01@kylinos.cn
[pjw@kernel.org: Fixed Sergey's E-mail address]
Signed-off-by: Paul Walmsley <pjw@kernel.org>
2026-07-10 09:32:35 -06:00
..
abi selftests/riscv: fix compiler output flag spacing in all Makefiles 2026-06-06 20:17:52 -06:00
cfi selftests/riscv: fix compiler output flag spacing in all Makefiles 2026-06-06 20:17:52 -06:00
hwprobe selftests/riscv: fix compiler output flag spacing in all Makefiles 2026-06-06 20:17:52 -06:00
mm selftests/riscv: fix compiler output flag spacing in all Makefiles 2026-06-06 20:17:52 -06:00
sigreturn selftests/riscv: fix compiler output flag spacing in all Makefiles 2026-06-06 20:17:52 -06:00
vector selftests/riscv: ptrace: Fix memory leak of regset_data in vector tests 2026-07-10 09:32:35 -06:00
Makefile kselftest/riscv: add kselftest for user mode CFI 2026-01-29 02:38:40 -07:00
README selftests: riscv: Add README for RISC-V KSelfTest 2025-09-18 19:26:07 -06:00

KSelfTest RISC-V
================

- These tests are riscv specific and so not built or run but just skipped
  completely when env-variable ARCH is found to be different than 'riscv'.

- Holding true the above, RISC-V KSFT tests can be run within the
  KSelfTest framework using standard Linux top-level-makefile targets:

      $ make TARGETS=riscv kselftest-clean
      $ make TARGETS=riscv kselftest

      or

      $ make -C tools/testing/selftests TARGETS=riscv \
		INSTALL_PATH=<your-installation-path> install

      or, alternatively, only specific riscv/ subtargets can be picked:

      $ make -C tools/testing/selftests TARGETS=riscv RISCV_SUBTARGETS="mm vector" \
		INSTALL_PATH=<your-installation-path> install

   Further details on building and running KSFT can be found in:
     Documentation/dev-tools/kselftest.rst