Re: [PATCH v1 1/1] m68k: Move signal frame following exception on 68020/030

From: Finn Thain
Date: Wed May 24 2023 - 22:15:31 EST

On Mon, 22 May 2023, Geert Uytterhoeven wrote:

> Reviewed-by: Geert Uytterhoeven <geert@xxxxxxxxxxxxxx>
> i.e. will queue as a fix in the m68k for-v6.4 branch.

Thanks Geert!

> I plan to send this upstream later this week, so any additional
> testing would be appreciated.

If there is a userland program that needs all of its sigaltstack space,
and cannot accomodate a 256 byte margin, it will be hard to find that
program. Often these signal stacks are used for handling (would-be) fatal
signals that may not happen in regression testing.

If we fix the kernel and a failure eventually does show up in a userland
program, we may be able to patch that program. Looking through Debian's
codebase, which is easily searchable, I found lots of different ways to
determine the signal stack size. But it's not clear to me which programs
calculate it correctly.

Many programs take the architecture's SIGSTKSZ or MINSIGSTKSZ or
getauxval(AT_MINSIGSTKSZ) or sysconf(_SC_SIGSTKSZ), or some combination,
and then apply an arbitrary safety factor. Some add a constant or apply a
lower bound that may reflect the actual requirements of the signal
handler. Some just use page_size().