summaryrefslogtreecommitdiff
path: root/tools/lib/python
diff options
context:
space:
mode:
authorChen Pei <cp0613@linux.alibaba.com>2026-08-20 14:32:33 +0800
committerPaul Walmsley <pjw@kernel.org>2026-10-07 09:35:41 -0600
commitadadf6df0bd55aa40ccbc6519fb443133e103227 (patch)
treef92282623d42ccbc601c3d8f7a7af19c0ea792ba /tools/lib/python
parent07e23d0b6f58eec351e52058b9a0a8af7b019c09 (diff)
downloadlinux-next-adadf6df0bd55aa40ccbc6519fb443133e103227.tar.gz
linux-next-adadf6df0bd55aa40ccbc6519fb443133e103227.zip
riscv: ptrace: reject CFI regset access when extensions are absent
riscv_cfi_get() and riscv_cfi_set() do not check whether the Zicfilp or Zicfiss extensions are present. On systems without them, PTRACE_GETREGSET on REGSET_CFI still succeeds and returns a zeroed user_cfi_state, misleading debuggers into believing the register set is available, and PTRACE_SETREGSET silently accepts writes that have no effect (e.g. clearing SR_ELP). Reject the access with -EINVAL when neither branch landing pads nor shadow stack is available to userspace, using the same availability helpers as the prctl path. Fixes: 2af7c9cf021c ("riscv/ptrace: expose riscv CFI status and state via ptrace and in core files") Signed-off-by: Chen Pei <cp0613@linux.alibaba.com> Link: https://patch.msgid.link/20260820063233.2567-1-cp0613@linux.alibaba.com Cc: stable@vger.kernel.org Signed-off-by: Paul Walmsley <pjw@kernel.org>
Diffstat (limited to 'tools/lib/python')
0 files changed, 0 insertions, 0 deletions