lkml.org 
[lkml]   [2021]   [Oct]   [5]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [PATCH v11 16/29] x86/fpu/xstate: Support both legacy and expanded signal XSTATE size
Date
On Fri, Oct 01 2021 at 15:37, Chang S. Bae wrote:
> static int
> do_sigaltstack (const stack_t *ss, stack_t *oss, unsigned long sp,
> size_t min_ss_size)
> @@ -4187,6 +4192,9 @@ do_sigaltstack (const stack_t *ss, stack_t *oss, unsigned long sp,
> return -ENOMEM;
> }
>
> + if (!arch_enough_sigaltstack(t, ss_size))
> + return -EINVAL;
> +

How is this even remotely correct?

sigaltstack(2):

To disable an existing stack, specify ss.ss_flags as SS_DISABLE. In
this case, the kernel ignores any other flags in ss.ss_flags and the
remaining fields in ss.

So for SS_DISABLE ss_size can be legitimately 0 or any other random
number smaller than the required stack.

The min_ss_minsize check is conditional for this very reason.

Thanks,

tglx


\
 
 \ /
  Last update: 2021-10-05 14:31    [W:0.269 / U:0.428 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site