From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id BE0EA287246 for ; Sat, 4 Apr 2026 01:40:58 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775266858; cv=none; b=GtA6Y/ru4hlenHAKVeTeriXBAd1CQwdkOp+BVSZzok6Wp915+9+PBiwHW3U1mahLbFd2QjW0mhnu3o0sIA/Eugk8lSTFDa+WiSr+IaZxkoNbkQVaC0m8OTnKkbLfAEwN/9G4D+iLBUBlKRFk1v6DbguDMHgMUdio9ogfstnss4o= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775266858; c=relaxed/simple; bh=ivuhrIaTVLnuIArBzndyE8aUuR5zdDlFZooJ4oon2WQ=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version:Content-Type; b=aN6MZonjcv0z6q3gI1qMdPn+/iTxUfa/eb0Z31WegGvnTjFMx+GlnXyS3unMgRxRD9dC/TLQPTCsyysX2Gf/EBeXb2A4Plb+TVNFLRsB6xqXvtBB2w9AXHzJX7tHnL5/KKf1LlsDSDHrbr8IkNu7YzbbzRtVyXGwoGne4v/25v8= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=RGpxC/Kf; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="RGpxC/Kf" Received: by smtp.kernel.org (Postfix) with ESMTPSA id BB12EC4CEF7; Sat, 4 Apr 2026 01:40:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1775266858; bh=ivuhrIaTVLnuIArBzndyE8aUuR5zdDlFZooJ4oon2WQ=; h=From:To:Cc:Subject:Date:From; b=RGpxC/KfsYvmrJX9Jk0M7F4CydNSVjBoP+M8fmzyLTxNIbc4358obUClY2tu3JyHm L8DqHBKaLbc1PWGRHskHnZrm0tcpZkKkfI+LpDmsK135+79Wi4A/jZShSC94xDMFUp OtFP8sqD9ptk4TwU21M/pGQdOulqZDIVDt9kCRlKaXohoPn5VxPkhdmhH8pp6Y58pG eyilUYveIl4Ln7R0babfFQUtj3Peh3P1C2kpObg3l9cT/K0lVvlms4VD8kYE0VyU0T ljdfw/j8/BEve7QHbAuyaxHtOFAhCe7fYB+mAig06cGU2zb2eucqxpRm5rb5xNKoCU BHiwGWB/3fH7A== From: Paul Walmsley To: linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org Cc: torvalds@linux-foundation.org, tglx@linutronix.de, peterz@infradead.org, broonie@kernel.org Subject: [PATCH 0/6] Restructure per-task CFI prctl() and ptrace interfaces Date: Fri, 3 Apr 2026 19:40:56 -0600 Message-ID: <177526680875.878386.16551569883089050686.stgit@seppa> X-Mailer: git-send-email 2.51.0 User-Agent: StGit/0.19 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit Restructure the per-task CFI indirect branch landing pad prctl() interface, as suggested by Linus [1]. In place of the current approach, which follows the style of shadow stack control prctl()s (PR_{GET,SET,LOCK}_SHADOW_STACK_STATUS), adopt the style of the speculation control prctl() constants (PR_{GET,SET}_SPECULATION_CTRL). Then, to improve readability, expand "indir_br_lp", "lpad", and related abbreviations in the interfaces, also as requested by Linus. While here, expand "ss" in the shadow stack ptrace macros to "shadow stack". While here, let's fix a few bugs in the interfaces that we should have caught earlier: - Fix a misspelling of "PTRACE" in one of the macros that is defined in a uapi header file - Add a "lock" parameter to the state locking functions, fixing a bug when a locked process calls exec() This series is intended to be applied before the v7.0 release, since it changes user API constants. This series applies on commit 2ff48e0382102b29cba20cdd8bf16a0f045f6e33 ("selftests: riscv: Add braces around EXPECT_EQ()") in the RISC-V fixes branch. - Paul 1. https://lore.kernel.org/linux-riscv/CAHk-=whhSLGZAx3N5jJpb4GLFDqH_QvS07D+6BnkPWmCEzTAgw@mail.gmail.com/ --- Paul Walmsley (5): riscv: ptrace: cfi: fix "PRACE" typo in uapi header riscv: ptrace: expand "LP" references to "branch landing pads" in uapi headers prctl: rename branch landing pad implementation functions to be more explicit riscv: ptrace: cfi: expand "SS" references to "shadow stack" in uapi headers prctl: cfi: change the branch landing pad prctl()s to be more descriptive Zong Li (1): riscv: cfi: clear CFI lock status in start_thread() Documentation/arch/riscv/zicfilp.rst | 63 ++++++++++++-------- arch/riscv/include/asm/usercfi.h | 8 +-- arch/riscv/include/uapi/asm/ptrace.h | 42 +++++++------ arch/riscv/kernel/process.c | 2 + arch/riscv/kernel/ptrace.c | 22 +++---- arch/riscv/kernel/usercfi.c | 39 ++++++------ include/linux/cpu.h | 6 +- include/uapi/linux/prctl.h | 37 +++++------- kernel/sys.c | 30 +++++----- tools/perf/trace/beauty/include/uapi/linux/prctl.h | 36 +++++------ tools/testing/selftests/riscv/cfi/cfitests.c | 13 ++-- 11 files changed, 154 insertions(+), 144 deletions(-)