possible issue of sigcontext alignment on user stack

"Toru Nishimura" <[email protected]> Sat, 9 Nov 2002 21:15:44 +0900
Newsgroups gmane.os.netbsd.ports.mips
Message-ID <001c01c287e9$bb082c80$0d00a8c0@paq5>
Hi, guys.

I think there is a possible structure alignment issue around
sigcontext store built on user stack

In sendsig()::sig_machdep.c, the pointer value "struct
sigcontext *scp"  made from cast is wind up "scp--" to
have sigcontext structure storage.  Then, structure alignment
would matter in the case of 64bit register_t.

    scp--;

I guess the above should be like as;

    scp = (struct sigcontext *)(((unsigned long)(scp - 1)) &~ ALIGNBYTES);

Your thoughts?  Donno what the most sane cast should be for LP64 case.

Toru Nishimura/ALKYL Technology