Subject: Re: siginfo changes Q
To: None <port-arm@netbsd.org>
From: Christos Zoulas <christos@zoulas.com>
List: port-arm
Date: 10/18/2003 17:46:36
In article <20031018163315.GE21828@canolog.ninthwonder.com>,
Allen Briggs <briggs@wasabisystems.com> wrote:
>There seems to be an inconsistency in the siginfo changes for arm.
>The C library uses a 'version' of 0, 1, or 2, depending on the path
>into the signal code. So a running -current kernel could see any
>of those versions coming in through sigaction(). The kernel checks
>the version number, calling sendsig_sigcontext() if the version is
>< 2, otherwise calling sendsig_siginfo().
This is not what it does. To quote the code:
/*
* Trampoline ABI version 0 is reserved for the legacy
* kernel-provided on-stack trampoline. Conversely, if we are
* using a non-0 ABI version, we must have a trampoline. Only
* validate the vers if a new sigaction was supplied. Emulations
* use legacy kernel trampolines with version 0, alternatively
* check for that too.
*/
if ((vers != 0 && tramp == NULL) ||
#ifdef SIGTRAMP_VALID
(nsa != NULL &&
((vers == 0) ?
(p->p_emul->e_sigcode == NULL) :
!SIGTRAMP_VALID(vers))) ||
#endif
(vers == 0 && tramp != NULL))
return (EINVAL);
>This seems OK, except
>that it does that check only if COMPAT_16 is defined. And it only
>includes the sendsig_sigcontext if COMPAT_13 or COMPAT_16 is defined.
So it will never proceed to call sendsig_sigcontext if COMPAT_16 is not
defined.
The problem is that m68k does not defined SIGTRAMP_VALID, and still
has the old code get_have_sigreturn() stuff.
sys/arch/m68k/include/signal.h
and
lib/libc/arch/m68k/sys/__sigaction14_sigtramp.c
need to be updated so that the code works like in the x86 case.
christos