Thread (18 messages) 18 messages, 4 authors, 2024-02-15

Re: [PATCH RFT v5 4/7] fork: Add shadow stack support to clone3()

From: "Edgecombe, Rick P" <rick.p.edgecombe@intel.com>
Date: 2024-02-10 00:56:38
Also in: linux-kselftest, lkml

On Sat, 2024-02-03 at 00:05 +0000, Mark Brown wrote:
+       if (args->shadow_stack) {
+               addr = args->shadow_stack;
+               size = args->shadow_stack_size;
 
-       size = adjust_shstk_size(stack_size);
-       addr = alloc_shstk(0, size, 0, false);
-       if (IS_ERR_VALUE(addr))
-               return addr;
+               /* There should be a valid token at the top of the
stack. */
+               if (!shstk_consume_token(tsk, addr + size -
sizeof(u64)))
+                       return (unsigned long)ERR_PTR(-EINVAL);
I think for this case, it needs:
	shstk->base = 0;
	shstk->size = 0;

To prevent trying to free the parents shadow stack when the child
exits.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help