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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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.




[Index of Archives]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Share Photos]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Device Mapper]

  Powered by Linux