On Sun, Jan 16, 2022 at 11:58 PM Warner Losh <imp@bsdimp.com> wrote:
> +    if (!lock_user_struct(VERIFY_WRITE, frame, frame_addr, 0)) {
> +        goto give_sigsegv;

FreeBSD for Arm (haven't checked other BSDs or other archs)
gives a SIGILL for the "can't write signal frame to stack"
case, I think:
https://github.com/freebsd/freebsd-src/blob/main/sys/arm/arm/exec_machdep.c#L316
I don't understand why they picked SIGILL, SIGSEGV seems much more
logical to me, but we should follow the kernel behaviour.

This is a good thing to find. I'm going to have to study all the architectures, but
the first 5 I looked at all returned SIGILL, so this code has to change to reflect
that...

Sorry to follow up my own message, but  this dates to 4.1BSD (4BSD sent a SIGKILL),
but it's not present in V7, 32V or 3BSD.

So it's very old-school BSD behavior, dating from 1981 :)

Warner