linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* siginfo pad problem.
@ 2003-07-21 14:23 Kurt Roeckx
  2003-07-21 16:24 ` Stephen Rothwell
  0 siblings, 1 reply; 7+ messages in thread
From: Kurt Roeckx @ 2003-07-21 14:23 UTC (permalink / raw)
  To: linux-kernel

It seems the _timer part of siginfo is a little bit broken.

It has:
                        char _pad[sizeof( __ARCH_SI_UID_T) - sizeof(int)];

Where __ARCH_SI_UID_T can be a short.

I have no idea if on any arch it can be bigger than an int.


Kurt


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: siginfo pad problem.
  2003-07-21 14:23 siginfo pad problem Kurt Roeckx
@ 2003-07-21 16:24 ` Stephen Rothwell
  2003-07-21 18:00   ` Kurt Roeckx
  0 siblings, 1 reply; 7+ messages in thread
From: Stephen Rothwell @ 2003-07-21 16:24 UTC (permalink / raw)
  To: Kurt Roeckx; +Cc: linux-kernel

On Mon, 21 Jul 2003 16:23:00 +0200 Kurt Roeckx <Q@ping.be> wrote:
>
> It seems the _timer part of siginfo is a little bit broken.
> 
> It has:
>                         char _pad[sizeof( __ARCH_SI_UID_T) - sizeof(int)];
> 
> Where __ARCH_SI_UID_T can be a short.

Except __ARCH_SI_UID_T is defined to be uid_t everywhere except sparc
where it is "unsigned int".  In include/linux/types.h, uid_t is typdef'ed
to be __kernel_uid32_t (in the kernel), so __ARCH_SI_UID_T is always (at
least) 32 bits.

I was worried about that the first time I saw it as well.

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

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: siginfo pad problem.
  2003-07-21 16:24 ` Stephen Rothwell
@ 2003-07-21 18:00   ` Kurt Roeckx
  2003-07-21 23:51     ` Stephen Rothwell
  0 siblings, 1 reply; 7+ messages in thread
From: Kurt Roeckx @ 2003-07-21 18:00 UTC (permalink / raw)
  To: Stephen Rothwell; +Cc: linux-kernel

On Tue, Jul 22, 2003 at 02:24:24AM +1000, Stephen Rothwell wrote:
> On Mon, 21 Jul 2003 16:23:00 +0200 Kurt Roeckx <Q@ping.be> wrote:
> >
> > It seems the _timer part of siginfo is a little bit broken.
> > 
> > It has:
> >                         char _pad[sizeof( __ARCH_SI_UID_T) - sizeof(int)];
> > 
> > Where __ARCH_SI_UID_T can be a short.
> 
> Except __ARCH_SI_UID_T is defined to be uid_t everywhere except sparc
> where it is "unsigned int".  In include/linux/types.h, uid_t is typdef'ed
> to be __kernel_uid32_t (in the kernel), so __ARCH_SI_UID_T is always (at
> least) 32 bits.

linux/types.h has:
#ifdef __KERNEL__
typedef __kernel_uid32_t        uid_t;
#else
typedef __kernel_uid_t          uid_t;
#endif /* __KERNEL__ */

And __kernel_uid_t is an "unsigned short"


Kurt


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: siginfo pad problem.
  2003-07-21 18:00   ` Kurt Roeckx
@ 2003-07-21 23:51     ` Stephen Rothwell
  2003-07-22 17:06       ` Kurt Roeckx
  2003-07-22 17:19       ` Jakub Jelinek
  0 siblings, 2 replies; 7+ messages in thread
From: Stephen Rothwell @ 2003-07-21 23:51 UTC (permalink / raw)
  To: Kurt Roeckx; +Cc: linux-kernel

Hi Kurt,

On Mon, 21 Jul 2003 20:00:32 +0200 Kurt Roeckx <Q@ping.be> wrote:
>
> linux/types.h has:
> #ifdef __KERNEL__
> typedef __kernel_uid32_t        uid_t;
> #else
> typedef __kernel_uid_t          uid_t;
> #endif /* __KERNEL__ */
> 
> And __kernel_uid_t is an "unsigned short"

Anywhere this should be used (i.e. only in the kernel), uid_t will be
__kernel_uid32_t.  The change to this part of the siginfo_t structure has
not yet propogated to the glibc headers and when it does, it is up to the
glibc maintainers to make sure it matches what is used inside the kernel.

My extrapolation of your point leads me to ask why we even bother
with __KERNEL__ in the kernel's header files anymore since we keep
telling people that user mode programs should not use the kernel's
header files.

You are right that if a user mode program include the kernel's siginfo.h
(without defining __KERNEL__) it will not compile (on those architectures
where __kernel_uid_t is "unsigned short") but the answer I keep seeing
from this list is "Don't do that".

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

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: siginfo pad problem.
  2003-07-21 23:51     ` Stephen Rothwell
@ 2003-07-22 17:06       ` Kurt Roeckx
  2003-07-22 17:14         ` Jamie Lokier
  2003-07-22 17:19       ` Jakub Jelinek
  1 sibling, 1 reply; 7+ messages in thread
From: Kurt Roeckx @ 2003-07-22 17:06 UTC (permalink / raw)
  To: Stephen Rothwell; +Cc: linux-kernel

On Tue, Jul 22, 2003 at 09:51:05AM +1000, Stephen Rothwell wrote:
> Hi Kurt,
> 
> On Mon, 21 Jul 2003 20:00:32 +0200 Kurt Roeckx <Q@ping.be> wrote:
> >
> > linux/types.h has:
> > #ifdef __KERNEL__
> > typedef __kernel_uid32_t        uid_t;
> > #else
> > typedef __kernel_uid_t          uid_t;
> > #endif /* __KERNEL__ */
> > 
> > And __kernel_uid_t is an "unsigned short"
> 
> Anywhere this should be used (i.e. only in the kernel), uid_t will be
> __kernel_uid32_t.  The change to this part of the siginfo_t structure has
> not yet propogated to the glibc headers and when it does, it is up to the
> glibc maintainers to make sure it matches what is used inside the kernel.

I'm still using libc5, and plan to do so for as long as I can.


Kurt


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: siginfo pad problem.
  2003-07-22 17:06       ` Kurt Roeckx
@ 2003-07-22 17:14         ` Jamie Lokier
  0 siblings, 0 replies; 7+ messages in thread
From: Jamie Lokier @ 2003-07-22 17:14 UTC (permalink / raw)
  To: Kurt Roeckx; +Cc: Stephen Rothwell, linux-kernel

Kurt Roeckx wrote:
> I'm still using libc5, and plan to do so for as long as I can.

That's fine.  Just install 2.4 kernel headers in /usr/include/linux
and /usr/include/asm.

-- Jamie


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: siginfo pad problem.
  2003-07-21 23:51     ` Stephen Rothwell
  2003-07-22 17:06       ` Kurt Roeckx
@ 2003-07-22 17:19       ` Jakub Jelinek
  1 sibling, 0 replies; 7+ messages in thread
From: Jakub Jelinek @ 2003-07-22 17:19 UTC (permalink / raw)
  To: Stephen Rothwell; +Cc: Kurt Roeckx, linux-kernel

On Tue, Jul 22, 2003 at 09:51:05AM +1000, Stephen Rothwell wrote:
> Anywhere this should be used (i.e. only in the kernel), uid_t will be
> __kernel_uid32_t.  The change to this part of the siginfo_t structure has
> not yet propogated to the glibc headers and when it does, it is up to the
> glibc maintainers to make sure it matches what is used inside the kernel.

??
glibc uses <bits/siginfo.h>, in which it uses __uid_t for si_uid fields.
__uid_t is uint32_t on all arches.

	Jakub

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2003-07-22 17:06 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-07-21 14:23 siginfo pad problem Kurt Roeckx
2003-07-21 16:24 ` Stephen Rothwell
2003-07-21 18:00   ` Kurt Roeckx
2003-07-21 23:51     ` Stephen Rothwell
2003-07-22 17:06       ` Kurt Roeckx
2003-07-22 17:14         ` Jamie Lokier
2003-07-22 17:19       ` Jakub Jelinek

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).