<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel/git/stable/linux.git/tools/testing/selftests/riscv, branch master</title>
<subtitle>Linux kernel stable tree</subtitle>
<id>https://git.rulkc.org/pub/scm/linux/kernel/git/stable/linux.git/atom?h=master</id>
<link rel='self' href='https://git.rulkc.org/pub/scm/linux/kernel/git/stable/linux.git/atom?h=master'/>
<link rel='alternate' type='text/html' href='https://git.rulkc.org/pub/scm/linux/kernel/git/stable/linux.git/'/>
<updated>2026-07-10T15:32:35+00:00</updated>
<entry>
<title>selftests/riscv: ptrace: Fix memory leak of regset_data in vector tests</title>
<updated>2026-07-10T15:32:35+00:00</updated>
<author>
<name>Wang Yan</name>
<email>wangyan01@kylinos.cn</email>
</author>
<published>2026-07-10T08:34:37+00:00</published>
<link rel='alternate' type='text/html' href='https://git.rulkc.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=58a37e7317b06665e21609a2f867a9962e9e2919'/>
<id>urn:sha1:58a37e7317b06665e21609a2f867a9962e9e2919</id>
<content type='text'>
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 &lt;wangyan01@kylinos.cn&gt;
Reviewed-by: Sergey Matyukevich &lt;geomatsi@gmail.com&gt;
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 &lt;pjw@kernel.org&gt;</content>
</entry>
<entry>
<title>selftests: riscv: Bypass libc in inactive vector ptrace test</title>
<updated>2026-07-08T02:30:31+00:00</updated>
<author>
<name>Andrew Jones</name>
<email>andrew.jones@oss.qualcomm.com</email>
</author>
<published>2026-07-07T15:38:27+00:00</published>
<link rel='alternate' type='text/html' href='https://git.rulkc.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=70b439e46effd782097f640c0b64f5f8b0e79913'/>
<id>urn:sha1:70b439e46effd782097f640c0b64f5f8b0e79913</id>
<content type='text'>
The ptrace_v_not_enabled test expects the child to reach its ebreak
before it has used the vector extension. That is not guaranteed when
using fork(), because libc may run child atfork handlers before
returning to the test code. In those cases PTRACE_GETREGSET for
NT_RISCV_VECTOR then succeeds instead of returning ENODATA for
inactive vector state.

Use the raw clone syscall with SIGCHLD to keep fork-like semantics
while bypassing libc's fork wrapper and atfork handler chain.

Cc: Andy Chiu &lt;tchiu@tenstorrent.com&gt;
Assisted-by: Claude:claude-sonnet-4-6
Signed-off-by: Andrew Jones &lt;andrew.jones@oss.qualcomm.com&gt;
Link: https://patch.msgid.link/20260707153827.175245-1-andrew.jones@oss.qualcomm.com
Signed-off-by: Paul Walmsley &lt;pjw@kernel.org&gt;</content>
</entry>
<entry>
<title>selftests/riscv: fix compiler output flag spacing in all Makefiles</title>
<updated>2026-06-07T02:17:52+00:00</updated>
<author>
<name>Zong Li</name>
<email>zong.li@sifive.com</email>
</author>
<published>2026-06-07T02:17:52+00:00</published>
<link rel='alternate' type='text/html' href='https://git.rulkc.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=c0db0690f7fae7bd8cf1493e2f6b2a672e0c0de8'/>
<id>urn:sha1:c0db0690f7fae7bd8cf1493e2f6b2a672e0c0de8</id>
<content type='text'>
Standardize the compiler output flag format across all RISC-V
selftests by adding a space between '-o' and '$@'.

Although '-o$@' is perfectly valid for GCC/Clang to parse,
changing it to '-o $@' with a space aligns with the GNU
official documentation conventions, improves readability by
visually separating the flag from the target variable, and
ensures consistency with other architectures.

Currently, RISC-V selftests use '-o$@' (without space) in 13
instances across 6 Makefiles, while all other architectures
consistently use '-o $@' (with space). This inconsistency makes
RISC-V an outlier in the kernel's selftest infrastructure.

Signed-off-by: Zong Li &lt;zong.li@sifive.com&gt;
Link: https://patch.msgid.link/20260511032917.3542802-1-zong.li@sifive.com
[pjw@kernel.org: cleaned up patch description]
Signed-off-by: Paul Walmsley &lt;pjw@kernel.org&gt;
</content>
</entry>
<entry>
<title>riscv: cfi: reject unknown flags in PR_SET_CFI</title>
<updated>2026-06-07T02:17:05+00:00</updated>
<author>
<name>Richard Patel</name>
<email>ripatel@wii.dev</email>
</author>
<published>2026-05-18T18:39:18+00:00</published>
<link rel='alternate' type='text/html' href='https://git.rulkc.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=15b4155138505669d3d43d7692459ee8ea2a86e7'/>
<id>urn:sha1:15b4155138505669d3d43d7692459ee8ea2a86e7</id>
<content type='text'>
prctl(PR_SET_CFI,PR_CFI_BRANCH_LANDING_PADS) silently ignored
unknown control values. Only PR_CFI_{ENABLE,DISABLE,LOCK} should
be permitted.

This changes the behavior of the uABI (fails previously accepted bits
with EINVAL).

Fixes: 08ee1559052b ("prctl: cfi: change the branch landing pad prctl()s to be more descriptive")
Signed-off-by: Richard Patel &lt;ripatel@wii.dev&gt;
Link: https://patch.msgid.link/20260518183918.322545-1-ripatel@wii.dev
[pjw@kernel.org: change the patch description to note that although this is a uABI change, it does not break the uABI]
Signed-off-by: Paul Walmsley &lt;pjw@kernel.org&gt;</content>
</entry>
<entry>
<title>selftests: riscv: Add license to cfi selftest</title>
<updated>2026-04-05T00:42:41+00:00</updated>
<author>
<name>Charlie Jenkins</name>
<email>thecharlesjenkins@gmail.com</email>
</author>
<published>2026-04-05T00:42:41+00:00</published>
<link rel='alternate' type='text/html' href='https://git.rulkc.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=7eb2e2954687bae09ca1b813df5d338744e7e538'/>
<id>urn:sha1:7eb2e2954687bae09ca1b813df5d338744e7e538</id>
<content type='text'>
The cfi selftest was missing a license so add it.

Signed-off-by: Charlie Jenkins &lt;thecharlesjenkins@gmail.com&gt;
Reviewed-by: Deepak Gupta &lt;debug@rivosinc.com&gt;
Link: https://patch.msgid.link/20260309-fix_selftests-v2-4-9d5a553a531e@gmail.com
Signed-off-by: Paul Walmsley &lt;pjw@kernel.org&gt;
</content>
</entry>
<entry>
<title>prctl: cfi: change the branch landing pad prctl()s to be more descriptive</title>
<updated>2026-04-05T00:40:58+00:00</updated>
<author>
<name>Paul Walmsley</name>
<email>pjw@kernel.org</email>
</author>
<published>2026-04-05T00:40:58+00:00</published>
<link rel='alternate' type='text/html' href='https://git.rulkc.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=08ee1559052be302f1d3752f48360b89517d9f8d'/>
<id>urn:sha1:08ee1559052be302f1d3752f48360b89517d9f8d</id>
<content type='text'>
Per Linus' comments requesting the replacement of "INDIR_BR_LP" in the
indirect branch tracking prctl()s with something more readable, and
suggesting the use of the speculation control prctl()s as an exemplar,
reimplement the prctl()s and related constants that control per-task
forward-edge control flow integrity.

This primarily involves two changes.  First, the prctls are
restructured to resemble the style of the speculative execution
workaround control prctls PR_{GET,SET}_SPECULATION_CTRL, to make them
easier to extend in the future.  Second, the "indir_br_lp" abbrevation
is expanded to "branch_landing_pads" to be less telegraphic.  The
kselftest and documentation is adjusted accordingly.

Link: https://lore.kernel.org/linux-riscv/CAHk-=whhSLGZAx3N5jJpb4GLFDqH_QvS07D+6BnkPWmCEzTAgw@mail.gmail.com/
Cc: Deepak Gupta &lt;debug@rivosinc.com&gt;
Cc: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
Cc: Mark Brown &lt;broonie@kernel.org&gt;
Signed-off-by: Paul Walmsley &lt;pjw@kernel.org&gt;
</content>
</entry>
<entry>
<title>riscv: ptrace: cfi: expand "SS" references to "shadow stack" in uapi headers</title>
<updated>2026-04-05T00:40:58+00:00</updated>
<author>
<name>Paul Walmsley</name>
<email>pjw@kernel.org</email>
</author>
<published>2026-04-05T00:40:58+00:00</published>
<link rel='alternate' type='text/html' href='https://git.rulkc.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=e5342fe2c1bb5b4fab6ed531a0122c6417e57ecf'/>
<id>urn:sha1:e5342fe2c1bb5b4fab6ed531a0122c6417e57ecf</id>
<content type='text'>
Similar to the recent change to expand "LP" to "branch landing pad",
let's expand "SS" in the ptrace uapi macros to "shadow stack" as well.
This aligns with the existing prctl() arguments, which use the
expanded "shadow stack" names, rather than just the abbreviation.

Link: https://lore.kernel.org/linux-riscv/CAHk-=whhSLGZAx3N5jJpb4GLFDqH_QvS07D+6BnkPWmCEzTAgw@mail.gmail.com/
Cc: Deepak Gupta &lt;debug@rivosinc.com&gt;
Signed-off-by: Paul Walmsley &lt;pjw@kernel.org&gt;
</content>
</entry>
<entry>
<title>riscv: ptrace: expand "LP" references to "branch landing pads" in uapi headers</title>
<updated>2026-04-05T00:40:58+00:00</updated>
<author>
<name>Paul Walmsley</name>
<email>pjw@kernel.org</email>
</author>
<published>2026-04-05T00:40:58+00:00</published>
<link rel='alternate' type='text/html' href='https://git.rulkc.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=ac4e61c730d778f8d8b8455da052952dbf8e0317'/>
<id>urn:sha1:ac4e61c730d778f8d8b8455da052952dbf8e0317</id>
<content type='text'>
Per Linus' comments about the unreadability of abbreviations such as
"LP", rename the RISC-V ptrace landing pad CFI macro names to be more
explicit.  This primarily involves expanding "LP" in the names to some
variant of "branch landing pad."

Link: https://lore.kernel.org/linux-riscv/CAHk-=whhSLGZAx3N5jJpb4GLFDqH_QvS07D+6BnkPWmCEzTAgw@mail.gmail.com/
Cc: Deepak Gupta &lt;debug@rivosinc.com&gt;
Signed-off-by: Paul Walmsley &lt;pjw@kernel.org&gt;
</content>
</entry>
<entry>
<title>selftests: riscv: Add braces around EXPECT_EQ()</title>
<updated>2026-04-05T00:37:57+00:00</updated>
<author>
<name>Charlie Jenkins</name>
<email>thecharlesjenkins@gmail.com</email>
</author>
<published>2026-03-10T01:52:11+00:00</published>
<link rel='alternate' type='text/html' href='https://git.rulkc.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=511361fe7a8856e2f415010942808c237a1b8061'/>
<id>urn:sha1:511361fe7a8856e2f415010942808c237a1b8061</id>
<content type='text'>
EXPECT_EQ() expands to multiple lines, breaking up one-line if
statements. This issue was not present in the patch on the mailing list
but was instead introduced by the maintainer when attempting to fix up
checkpatch warnings. Add braces around EXPECT_EQ() to avoid the error
even though checkpatch suggests them to be removed:

validate_v_ptrace.c:626:17: error: ‘else’ without a previous ‘if’

Fixes: 3789d5eecd5a ("selftests: riscv: verify syscalls discard vector context")
Fixes: 30eb191c895b ("selftests: riscv: verify ptrace rejects invalid vector csr inputs")
Fixes: 849f05ae1ea6 ("selftests: riscv: verify ptrace accepts valid vector csr values")
Signed-off-by: Charlie Jenkins &lt;thecharlesjenkins@gmail.com&gt;
Reviewed-and-tested-by: Sergey Matyukevich &lt;geomatsi@gmail.com&gt;
Link: https://patch.msgid.link/20260309-fix_selftests-v2-2-9d5a553a531e@gmail.com
Signed-off-by: Paul Walmsley &lt;pjw@kernel.org&gt;</content>
</entry>
<entry>
<title>riscv: use _BITUL macro rather than BIT() in ptrace uapi and kselftests</title>
<updated>2026-04-05T00:37:54+00:00</updated>
<author>
<name>Paul Walmsley</name>
<email>pjw@kernel.org</email>
</author>
<published>2026-04-02T23:18:03+00:00</published>
<link rel='alternate' type='text/html' href='https://git.rulkc.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=87ad7cc9aa7f0a202189640c5015aa985e7e8f3b'/>
<id>urn:sha1:87ad7cc9aa7f0a202189640c5015aa985e7e8f3b</id>
<content type='text'>
Fix the build of non-kernel code that includes the RISC-V ptrace uapi
header, and the RISC-V validate_v_ptrace.c kselftest, by using the
_BITUL() macro rather than BIT().  BIT() is not available outside
the kernel.

Based on patches and comments from Charlie Jenkins, Michael Neuling,
and Andreas Schwab.

Fixes: 30eb191c895b ("selftests: riscv: verify ptrace rejects invalid vector csr inputs")
Fixes: 2af7c9cf021c ("riscv/ptrace: expose riscv CFI status and state via ptrace and in core files")
Cc: Andreas Schwab &lt;schwab@suse.de&gt;
Cc: Michael Neuling &lt;mikey@neuling.org&gt;
Cc: Charlie Jenkins &lt;thecharlesjenkins@gmail.com&gt;
Link: https://patch.msgid.link/20260330024248.449292-1-mikey@neuling.org
Link: https://lore.kernel.org/linux-riscv/20260309-fix_selftests-v2-1-9d5a553a531e@gmail.com/
Link: https://lore.kernel.org/linux-riscv/20260309-fix_selftests-v2-3-9d5a553a531e@gmail.com/
Signed-off-by: Paul Walmsley &lt;pjw@kernel.org&gt;</content>
</entry>
</feed>
