]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
riscv: cfi: reject unknown flags in PR_SET_CFI
authorRichard Patel <ripatel@wii.dev>
Mon, 18 May 2026 18:39:18 +0000 (18:39 +0000)
committerPaul Walmsley <pjw@kernel.org>
Sun, 7 Jun 2026 02:17:05 +0000 (20:17 -0600)
commit15b4155138505669d3d43d7692459ee8ea2a86e7
treebaa36ce9115747e83ef66d50ada3ae12d8173b4e
parentaad60bdd0b5a6dfa40454ab03ce658408eaf4615
riscv: cfi: reject unknown flags in PR_SET_CFI

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 <ripatel@wii.dev>
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 <pjw@kernel.org>
arch/riscv/include/asm/usercfi.h
arch/riscv/kernel/usercfi.c
tools/testing/selftests/riscv/cfi/cfitests.c