* 2.4.15-final drivers/net/bonding.c includes user space headers
@ 2001-11-23 6:31 Keith Owens
2001-11-25 21:49 ` H. Peter Anvin
2001-11-26 17:55 ` Thomas Davis
0 siblings, 2 replies; 9+ messages in thread
From: Keith Owens @ 2001-11-23 6:31 UTC (permalink / raw)
To: linux-kernel; +Cc: Thomas Davis
2.4.15-final/drivers/net/bonding.c:188: #include <limits.h>
Kernel code must not include use space headers. I thought this had
been fixed. It will not compile in 2.5.
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: 2.4.15-final drivers/net/bonding.c includes user space headers
2001-11-23 6:31 2.4.15-final drivers/net/bonding.c includes user space headers Keith Owens
@ 2001-11-25 21:49 ` H. Peter Anvin
2001-11-26 2:06 ` Keith Owens
2001-11-26 5:02 ` David S. Miller
2001-11-26 17:55 ` Thomas Davis
1 sibling, 2 replies; 9+ messages in thread
From: H. Peter Anvin @ 2001-11-25 21:49 UTC (permalink / raw)
To: linux-kernel
Followup to: <18133.1006497103@kao2.melbourne.sgi.com>
By author: Keith Owens <kaos@ocs.com.au>
In newsgroup: linux.dev.kernel
>
> 2.4.15-final/drivers/net/bonding.c:188: #include <limits.h>
>
> Kernel code must not include use space headers. I thought this had
> been fixed. It will not compile in 2.5.
>
<limits.h> is one of the compiler-provided headers, i.e. from
/usr/lib/gcc-lib/*/*/include -- if your kbuild harness don't
allow those headers to be included, it's broken.
-hpa
--
<hpa@transmeta.com> at work, <hpa@zytor.com> in private!
"Unix gives you enough rope to shoot yourself in the foot."
http://www.zytor.com/~hpa/puzzle.txt <amsp@zytor.com>
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: 2.4.15-final drivers/net/bonding.c includes user space headers
2001-11-25 21:49 ` H. Peter Anvin
@ 2001-11-26 2:06 ` Keith Owens
2001-11-26 2:09 ` H. Peter Anvin
2001-11-26 5:02 ` David S. Miller
1 sibling, 1 reply; 9+ messages in thread
From: Keith Owens @ 2001-11-26 2:06 UTC (permalink / raw)
To: H. Peter Anvin; +Cc: linux-kernel
On 25 Nov 2001 13:49:33 -0800,
"H. Peter Anvin" <hpa@zytor.com> wrote:
>By author: Keith Owens <kaos@ocs.com.au>
>>
>> 2.4.15-final/drivers/net/bonding.c:188: #include <limits.h>
>>
>> Kernel code must not include use space headers. I thought this had
>> been fixed. It will not compile in 2.5.
>
><limits.h> is one of the compiler-provided headers, i.e. from
>/usr/lib/gcc-lib/*/*/include -- if your kbuild harness don't
>allow those headers to be included, it's broken.
kbuild 2.5 does
'-nostdinc -I/usr/lib/gcc-lib/... gcc version ../include/'
so it allows includes from the compiler headers. The problem is:
bonding.c includes limits.h, picked up from gcc, OK.
limits.h includes syslimits.h from gcc, OK.
syslimits.h tries to include_next <limits.h> to get the user space
limits, not OK.
Any kernel code that includes limits.h or syslimits.h is polluted by
user space headers. net/bonding.c does not even need limits.h.
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: 2.4.15-final drivers/net/bonding.c includes user space headers
2001-11-26 2:06 ` Keith Owens
@ 2001-11-26 2:09 ` H. Peter Anvin
2001-11-26 2:19 ` Keith Owens
0 siblings, 1 reply; 9+ messages in thread
From: H. Peter Anvin @ 2001-11-26 2:09 UTC (permalink / raw)
To: Keith Owens; +Cc: linux-kernel
Keith Owens wrote:
>
> kbuild 2.5 does
> '-nostdinc -I/usr/lib/gcc-lib/... gcc version ../include/'
> so it allows includes from the compiler headers. The problem is:
>
> bonding.c includes limits.h, picked up from gcc, OK.
> limits.h includes syslimits.h from gcc, OK.
> syslimits.h tries to include_next <limits.h> to get the user space
> limits, not OK.
>
> Any kernel code that includes limits.h or syslimits.h is polluted by
> user space headers. net/bonding.c does not even need limits.h.
>
How UTTERLY braindamaged... I guess we could provide a (dummy?)
<limits.h> for the kernel environment. I would definitely like to see
the standard compiler-related headers like <stdint.h> as well...
-hpa
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: 2.4.15-final drivers/net/bonding.c includes user space headers
2001-11-26 2:09 ` H. Peter Anvin
@ 2001-11-26 2:19 ` Keith Owens
2001-11-26 2:22 ` H. Peter Anvin
0 siblings, 1 reply; 9+ messages in thread
From: Keith Owens @ 2001-11-26 2:19 UTC (permalink / raw)
To: H. Peter Anvin; +Cc: linux-kernel
On Sun, 25 Nov 2001 18:09:05 -0800,
"H. Peter Anvin" <hpa@zytor.com> wrote:
>Keith Owens wrote:
>> bonding.c includes limits.h, picked up from gcc, OK.
>> limits.h includes syslimits.h from gcc, OK.
>> syslimits.h tries to include_next <limits.h> to get the user space
>> limits, not OK.
>>
>> Any kernel code that includes limits.h or syslimits.h is polluted by
>> user space headers. net/bonding.c does not even need limits.h.
>
>How UTTERLY braindamaged... I guess we could provide a (dummy?)
><limits.h> for the kernel environment. I would definitely like to see
>the standard compiler-related headers like <stdint.h> as well...
We already have include/linux/limits.h that is included by filesystem
code. If anybody needs additional #defines, they can go in our version
of limits.h instead of trying to use the gcc version.
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: 2.4.15-final drivers/net/bonding.c includes user space headers
2001-11-26 2:19 ` Keith Owens
@ 2001-11-26 2:22 ` H. Peter Anvin
0 siblings, 0 replies; 9+ messages in thread
From: H. Peter Anvin @ 2001-11-26 2:22 UTC (permalink / raw)
To: Keith Owens; +Cc: linux-kernel
Keith Owens wrote:
>
> We already have include/linux/limits.h that is included by filesystem
> code. If anybody needs additional #defines, they can go in our version
> of limits.h instead of trying to use the gcc version.
>
I guess. I don't like the idea of not using the compiler-provided
headers, since it seems to me to make it harder to deal properly with
gcc changes, though...
-hpa
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: 2.4.15-final drivers/net/bonding.c includes user space headers
2001-11-25 21:49 ` H. Peter Anvin
2001-11-26 2:06 ` Keith Owens
@ 2001-11-26 5:02 ` David S. Miller
1 sibling, 0 replies; 9+ messages in thread
From: David S. Miller @ 2001-11-26 5:02 UTC (permalink / raw)
To: hpa; +Cc: linux-kernel
From: "H. Peter Anvin" <hpa@zytor.com>
Date: 25 Nov 2001 13:49:33 -0800
<limits.h> is one of the compiler-provided headers, i.e. from
/usr/lib/gcc-lib/*/*/include -- if your kbuild harness don't
allow those headers to be included, it's broken.
Perhaps, but in this case (the bonding driver) the include was
totally unnecessary.
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: 2.4.15-final drivers/net/bonding.c includes user space headers
2001-11-23 6:31 2.4.15-final drivers/net/bonding.c includes user space headers Keith Owens
2001-11-25 21:49 ` H. Peter Anvin
@ 2001-11-26 17:55 ` Thomas Davis
2001-11-26 18:57 ` David S. Miller
1 sibling, 1 reply; 9+ messages in thread
From: Thomas Davis @ 2001-11-26 17:55 UTC (permalink / raw)
To: Keith Owens; +Cc: linux-kernel
Keith Owens wrote:
>
> 2.4.15-final/drivers/net/bonding.c:188: #include <limits.h>
>
> Kernel code must not include use space headers. I thought this had
> been fixed. It will not compile in 2.5.
>
I should probably also point out that I'm not the maintainer/creator of
that version that did this too..
The Lab hasn't said yet from the DOE's point of view it's ok to work on
GPL to me, as part of my job..
--
------------------------+--------------------------------------------------
Thomas Davis | ASG Cluster guy
tadavis@lbl.gov |
(510) 486-4524 | "80 nodes and chugging Captain!"
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: 2.4.15-final drivers/net/bonding.c includes user space headers
2001-11-26 17:55 ` Thomas Davis
@ 2001-11-26 18:57 ` David S. Miller
0 siblings, 0 replies; 9+ messages in thread
From: David S. Miller @ 2001-11-26 18:57 UTC (permalink / raw)
To: kaos; +Cc: linux-kernel
Keith Owens wrote:
>
> 2.4.15-final/drivers/net/bonding.c:188: #include <limits.h>
>
> Kernel code must not include use space headers. I thought this had
> been fixed. It will not compile in 2.5.
>
Keith I fully agree with you. I sent the fix to Linus probably 4 times
but he simply was not accepting any non-OOPS fixing patches.
It's in my queue and will go to Marcelo today.
Franks a lot,
David S. Miller
davem@redhat.com
^ permalink raw reply [flat|nested] 9+ messages in thread
end of thread, other threads:[~2001-11-26 19:00 UTC | newest]
Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2001-11-23 6:31 2.4.15-final drivers/net/bonding.c includes user space headers Keith Owens
2001-11-25 21:49 ` H. Peter Anvin
2001-11-26 2:06 ` Keith Owens
2001-11-26 2:09 ` H. Peter Anvin
2001-11-26 2:19 ` Keith Owens
2001-11-26 2:22 ` H. Peter Anvin
2001-11-26 5:02 ` David S. Miller
2001-11-26 17:55 ` Thomas Davis
2001-11-26 18:57 ` David S. Miller
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox