Re: [PATCH v2 12/19] x86/signal: Land on &frame->retcode when vdso isn't mapped

Andy Lutomirski
2020-11-24T23:09:07Z

On Mon, Nov 23, 2020 at 4:30 PM Dmitry Safonov <dima@arista.com> wrote:
>
> Since commit 9fbbd4dd17d0 ("x86: Don't require the vDSO for handling
> a.out signals") after processing 32-bit signal if there is no vdso
> mapped frame->retcode is used as a landing.
> Do the same for rt ia32 signals.
> It also makes the ia32 compat signals match the native ia32 case.
>
> This shouldn't be mistaken for encouragement for running binaries with
> executable stack, rather something to do in hopefully very rare
> situation with disabled or unmapped vdso and absent SA_RESTORER.
> For non-executable stack it'll segfault on attempt to land, rather than
> land on a random address where vdso was previously mapped.
> For programs with executable stack it'll just do the same for rt signals
> as for non-rt.
>
> Discouraging users to run with executable stack is done separately in
> commit 47a2ebb7f505 ("execve: warn if process starts with executable
> stack").
>
> Signed-off-by: Dmitry Safonov <dima@arista.com>

The new code is more readable than the old code, too.

Acked-by: Andy Lutomirski <luto@kernel.org>