Re: sizeof (siginfo_t) problem

From: Stephen Rothwell (sfr@canb.auug.org.au)
Date: Sun Jul 20 2003 - 19:08:19 EST


Hi Anton,

On Sun, 20 Jul 2003 04:32:54 +1000 Anton Blanchard <anton@samba.org> wrote:
>
> Hi Stephen,
>
> > I am not sure if the s390 fix is correct (since s390x has been merged) or
> > if x86_64 needs this (as I cannot remember the alignment needs of the
> > x86_64 compiler - though I suspect it is needed).
>
> I didnt follow this thread very carefully :) Is ppc64 broken?

It is broken subtly (but noone would probably notice :-)). It is OK
on the structure size, but copy_siginfo will copy sizeof(int) bytes less
than necessary sometimes (particularly in the case of a SIGCHILD).

You need the following patch (against 2.6.0-test1-bk2 but should apply
to just about anything).

-- 
Cheers,
Stephen Rothwell                    sfr@canb.auug.org.au
http://www.canb.auug.org.au/~sfr/

diff -ruN 2.6.0-test1-bk2/include/asm-ppc64/siginfo.h 2.6.0-test1-bk2-sfr.1/include/asm-ppc64/siginfo.h --- 2.6.0-test1-bk2/include/asm-ppc64/siginfo.h 2002-11-05 17:00:34.000000000 +1100 +++ 2.6.0-test1-bk2-sfr.1/include/asm-ppc64/siginfo.h 2003-07-21 09:59:04.000000000 +1000 @@ -8,8 +8,8 @@ * 2 of the License, or (at your option) any later version. */ -#define SI_PAD_SIZE ((SI_MAX_SIZE/sizeof(int)) - 4) -#define SI_PAD_SIZE32 ((SI_MAX_SIZE/sizeof(int)) - 3) +#define __ARCH_SI_PREAMBLE_SIZE (4 * sizeof(int)) +#define SI_PAD_SIZE32 ((SI_MAX_SIZE/sizeof(int)) - 3) #include <asm-generic/siginfo.h> - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Wed Jul 23 2003 - 22:00:41 EST