Thread (51 messages) 51 messages, 5 authors, 2021-09-01

Re: [PATCH v29 25/32] x86/cet/shstk: Handle thread shadow stack

From: H.J. Lu <hidden>
Date: 2021-08-26 17:23:08
Also in: linux-api, linux-arch, linux-mm, lkml

On Thu, Aug 26, 2021 at 9:49 AM Borislav Petkov [off-list ref] wrote:
On Fri, Aug 20, 2021 at 11:11:54AM -0700, Yu-cheng Yu wrote:
quoted
diff --git a/arch/x86/kernel/shstk.c b/arch/x86/kernel/shstk.c
index 5993aa8db338..7c1ca2476a5e 100644
--- a/arch/x86/kernel/shstk.c
+++ b/arch/x86/kernel/shstk.c
@@ -75,6 +75,61 @@ int shstk_setup(void)
      return err;
 }

+int shstk_alloc_thread_stack(struct task_struct *tsk, unsigned long clone_flags,
+                          unsigned long stack_size)
+{
+     struct thread_shstk *shstk = &tsk->thread.shstk;
+     struct cet_user_state *state;
+     unsigned long addr;
+
+     if (!shstk->size)
+             return 0;
+
+     /*
+      * Earlier clone() does not pass stack_size.  Use RLIMIT_STACK and
What is "earlier clone()"?
clone() doesn't have stack size info which was added to clone3().
quoted
+      * cap to 4 GB.
+      */
--
Regards/Gruss,
    Boris.

https://people.kernel.org/tglx/notes-about-netiquette


-- 
H.J.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help