Thread (107 messages) 107 messages, 6 authors, 2023-01-05

Re: [PATCH v4 37/39] x86: Add PTRACE interface for shadow stack

From: "Edgecombe, Rick P" <rick.p.edgecombe@intel.com>
Date: 2022-12-09 17:14:09
Also in: linux-api, linux-arch, linux-mm, lkml

On Fri, 2022-12-09 at 19:04 +0200, Mike Rapoport wrote:
quoted
  /*
   * xstateregs_active == regset_fpregs_active. Please refer to the
comment
diff --git a/arch/x86/kernel/fpu/regset.c
b/arch/x86/kernel/fpu/regset.c
index 6d056b68f4ed..00f3d5c9b682 100644
--- a/arch/x86/kernel/fpu/regset.c
+++ b/arch/x86/kernel/fpu/regset.c
@@ -8,6 +8,7 @@
  #include <asm/fpu/api.h>
  #include <asm/fpu/signal.h>
  #include <asm/fpu/regset.h>
+#include <asm/prctl.h>
  
  #include "context.h"
  #include "internal.h"
@@ -174,6 +175,92 @@ int xstateregs_set(struct task_struct *target,
const struct user_regset *regset,
       return ret;
  }
  
+
+#ifdef CONFIG_X86_USER_SHADOW_STACK
+int ssp_active(struct task_struct *target, const struct
user_regset *regset)
+{
+     if (shstk_enabled())
This is not going to work with ptrace as shstk_enabled() checks
current
rather than target.
Oh right, thanks. I can change shstk_enabled() to take a task_struct.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help