[PATCH 1/2] sigaction.2: Add SEGV_CPERR

From: Yu-cheng Yu
Date: Fri Feb 26 2021 - 12:28:56 EST


When a branch instruction (i.e. call/ret/jmp) triggers a control-protection
fault, si_code is set to SEGV_CPERR. Add the new si_code to sigaction.2.

Signed-off-by: Yu-cheng Yu <yu-cheng.yu@xxxxxxxxx>
Cc: Alejandro Colomar <alx.manpages@xxxxxxxxx>
Cc: Michael Kerrisk <mtk.manpages@xxxxxxxxx>
Cc: Andy Lutomirski <luto@xxxxxxxxxx>
Cc: Borislav Petkov <bp@xxxxxxxxx>
Cc: Dave Hansen <dave.hansen@xxxxxxxxxxxxxxx>
Cc: Florian Weimer <fweimer@xxxxxxxxxx>
Cc: "H.J. Lu" <hjl.tools@xxxxxxxxx>
Cc: linux-kernel@xxxxxxxxxxxxxxx
Cc: linux-api@xxxxxxxxxxxxxx
Link: https://lore.kernel.org/linux-api/20210217222730.15819-7-yu-cheng.yu@xxxxxxxxx/
---
man2/sigaction.2 | 3 +++
1 file changed, 3 insertions(+)

diff --git a/man2/sigaction.2 b/man2/sigaction.2
index cc183198d..49a30f11e 100644
--- a/man2/sigaction.2
+++ b/man2/sigaction.2
@@ -737,6 +737,9 @@ See
.BR pkeys (7).
The protection key which applied to this access is available via
.IR si_pkey .
+.TP
+.B SEGV_CPERR
+A branch instruction (call, ret, or jmp) triggered a control-protection fault.
.RE
.PP
The following values can be placed in
--
2.21.0