linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] 2.6.0-test9 ioctl compile warnings in userspace
@ 2003-11-12 16:37 Johannes Stezenbach
  2003-12-02 11:43 ` Sven Luther
  0 siblings, 1 reply; 7+ messages in thread
From: Johannes Stezenbach @ 2003-11-12 16:37 UTC (permalink / raw)
  To: Linus Torvalds; +Cc: linux-kernel

Hi,

the patch below fixes

  warning: signed and unsigned type in conditional expression

when compiling userspace programs with a glibc built against
2.6 kernel headers.

This is a better version of my previous patch which aims
to fix all affected architectures.

Johannes


diff -rN -u4 linux-2.6.0-test9-bk17.orig/include/asm-i386/ioctl.h linux-2.6.0-test9-bk17/include/asm-i386/ioctl.h
--- linux-2.6.0-test9-bk17.orig/include/asm-i386/ioctl.h	2003-11-12 16:49:14.000000000 +0100
+++ linux-2.6.0-test9-bk17/include/asm-i386/ioctl.h	2003-11-12 16:51:38.000000000 +0100
@@ -52,9 +52,9 @@
 	 ((nr)   << _IOC_NRSHIFT) | \
 	 ((size) << _IOC_SIZESHIFT))
 
 /* provoke compile error for invalid uses of size argument */
-extern int __invalid_size_argument_for_IOC;
+extern unsigned int __invalid_size_argument_for_IOC;
 #define _IOC_TYPECHECK(t) \
 	((sizeof(t) == sizeof(t[1]) && \
 	  sizeof(t) < (1 << _IOC_SIZEBITS)) ? \
 	  sizeof(t) : __invalid_size_argument_for_IOC)
diff -rN -u4 linux-2.6.0-test9-bk17.orig/include/asm-parisc/ioctl.h linux-2.6.0-test9-bk17/include/asm-parisc/ioctl.h
--- linux-2.6.0-test9-bk17.orig/include/asm-parisc/ioctl.h	2003-11-12 16:49:14.000000000 +0100
+++ linux-2.6.0-test9-bk17/include/asm-parisc/ioctl.h	2003-11-12 16:51:24.000000000 +0100
@@ -44,9 +44,9 @@
 	 ((nr)   << _IOC_NRSHIFT) | \
 	 ((size) << _IOC_SIZESHIFT))
 
 /* provoke compile error for invalid uses of size argument */
-extern int __invalid_size_argument_for_IOC;
+extern unsigned int __invalid_size_argument_for_IOC;
 #define _IOC_TYPECHECK(t) \
 	((sizeof(t) == sizeof(t[1]) && \
 	  sizeof(t) < (1 << _IOC_SIZEBITS)) ? \
 	  sizeof(t) : __invalid_size_argument_for_IOC)
diff -rN -u4 linux-2.6.0-test9-bk17.orig/include/asm-ppc/ioctl.h linux-2.6.0-test9-bk17/include/asm-ppc/ioctl.h
--- linux-2.6.0-test9-bk17.orig/include/asm-ppc/ioctl.h	2003-11-12 16:49:14.000000000 +0100
+++ linux-2.6.0-test9-bk17/include/asm-ppc/ioctl.h	2003-11-12 16:51:34.000000000 +0100
@@ -37,9 +37,9 @@
 	 ((nr)   << _IOC_NRSHIFT) | \
 	 ((size) << _IOC_SIZESHIFT))
 
 /* provoke compile error for invalid uses of size argument */
-extern int __invalid_size_argument_for_IOC;
+extern unsigned int __invalid_size_argument_for_IOC;
 #define _IOC_TYPECHECK(t) \
 	((sizeof(t) == sizeof(t[1]) && \
 	  sizeof(t) < (1 << _IOC_SIZEBITS)) ? \
 	  sizeof(t) : __invalid_size_argument_for_IOC)
diff -rN -u4 linux-2.6.0-test9-bk17.orig/include/asm-ppc64/ioctl.h linux-2.6.0-test9-bk17/include/asm-ppc64/ioctl.h
--- linux-2.6.0-test9-bk17.orig/include/asm-ppc64/ioctl.h	2003-11-12 16:49:14.000000000 +0100
+++ linux-2.6.0-test9-bk17/include/asm-ppc64/ioctl.h	2003-11-12 16:51:28.000000000 +0100
@@ -42,9 +42,9 @@
 	 ((nr)   << _IOC_NRSHIFT) | \
 	 ((size) << _IOC_SIZESHIFT))
 
 /* provoke compile error for invalid uses of size argument */
-extern int __invalid_size_argument_for_IOC;
+extern unsigned int __invalid_size_argument_for_IOC;
 #define _IOC_TYPECHECK(t) \
        ((sizeof(t) == sizeof(t[1]) && \
          sizeof(t) < (1 << _IOC_SIZEBITS)) ? \
          sizeof(t) : __invalid_size_argument_for_IOC)

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

* Re: [PATCH] 2.6.0-test9 ioctl compile warnings in userspace
  2003-11-12 16:37 [PATCH] 2.6.0-test9 ioctl compile warnings in userspace Johannes Stezenbach
@ 2003-12-02 11:43 ` Sven Luther
  2003-12-03 12:56   ` Jörn Engel
  0 siblings, 1 reply; 7+ messages in thread
From: Sven Luther @ 2003-12-02 11:43 UTC (permalink / raw)
  To: Johannes Stezenbach, Linus Torvalds, linux-kernel

On Wed, Nov 12, 2003 at 05:37:50PM +0100, Johannes Stezenbach wrote:
> Hi,
> 
> the patch below fixes
> 
>   warning: signed and unsigned type in conditional expression
> 
> when compiling userspace programs with a glibc built against
> 2.6 kernel headers.
> 
> This is a better version of my previous patch which aims
> to fix all affected architectures.

I am curious about this. 

This patch has been proposed since almost a month or more now, and
clearly nobody seems to care about this, since it didn't make it in the
2.6.0-test11 tarball (don't know about more recent bk trees though) nor
do the debian glibc maintainer judge the issue important enough to act
on it (despite it breaking buildage of other packages).

So, is there a reason why not to solve this problem this way, or a
particular reason why __invalid_size_argument_for_IOC is still int and
not unsigned int ?

Friendly,

Sven Luther

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

* Re: [PATCH] 2.6.0-test9 ioctl compile warnings in userspace
  2003-12-02 11:43 ` Sven Luther
@ 2003-12-03 12:56   ` Jörn Engel
  2003-12-03 13:06     ` Sven Luther
  0 siblings, 1 reply; 7+ messages in thread
From: Jörn Engel @ 2003-12-03 12:56 UTC (permalink / raw)
  To: Sven Luther; +Cc: Johannes Stezenbach, linux-kernel

On Tue, 2 December 2003 12:43:50 +0100, Sven Luther wrote:
> On Wed, Nov 12, 2003 at 05:37:50PM +0100, Johannes Stezenbach wrote:
> > Hi,
> > 
> > the patch below fixes
> > 
> >   warning: signed and unsigned type in conditional expression
> > 
> > when compiling userspace programs with a glibc built against
> > 2.6 kernel headers.
> > 
> > This is a better version of my previous patch which aims
> > to fix all affected architectures.
> 
> I am curious about this. 
> 
> This patch has been proposed since almost a month or more now, and
> clearly nobody seems to care about this, since it didn't make it in the
> 2.6.0-test11 tarball (don't know about more recent bk trees though) nor
> do the debian glibc maintainer judge the issue important enough to act
> on it (despite it breaking buildage of other packages).
> 
> So, is there a reason why not to solve this problem this way, or a
> particular reason why __invalid_size_argument_for_IOC is still int and
> not unsigned int ?

It doesn't clearly fix a bug, afaics.  Also, most kernel hackers don't
care too much about the signed/unsigned warnings, as they are 99%
noise.

Resend the patch after 2.6.0 has been released, I don't see any change
for it to go in before.

Jörn

-- 
People will accept your ideas much more readily if you tell them
that Benjamin Franklin said it first.
-- unknown

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

* Re: [PATCH] 2.6.0-test9 ioctl compile warnings in userspace
  2003-12-03 12:56   ` Jörn Engel
@ 2003-12-03 13:06     ` Sven Luther
  2003-12-03 13:33       ` Jörn Engel
  0 siblings, 1 reply; 7+ messages in thread
From: Sven Luther @ 2003-12-03 13:06 UTC (permalink / raw)
  To: Jörn Engel; +Cc: Sven Luther, Johannes Stezenbach, linux-kernel

On Wed, Dec 03, 2003 at 01:56:48PM +0100, Jörn Engel wrote:
> On Tue, 2 December 2003 12:43:50 +0100, Sven Luther wrote:
> > On Wed, Nov 12, 2003 at 05:37:50PM +0100, Johannes Stezenbach wrote:
> > > Hi,
> > > 
> > > the patch below fixes
> > > 
> > >   warning: signed and unsigned type in conditional expression
> > > 
> > > when compiling userspace programs with a glibc built against
> > > 2.6 kernel headers.
> > > 
> > > This is a better version of my previous patch which aims
> > > to fix all affected architectures.
> > 
> > I am curious about this. 
> > 
> > This patch has been proposed since almost a month or more now, and
> > clearly nobody seems to care about this, since it didn't make it in the
> > 2.6.0-test11 tarball (don't know about more recent bk trees though) nor
> > do the debian glibc maintainer judge the issue important enough to act
> > on it (despite it breaking buildage of other packages).
> > 
> > So, is there a reason why not to solve this problem this way, or a
> > particular reason why __invalid_size_argument_for_IOC is still int and
> > not unsigned int ?
> 
> It doesn't clearly fix a bug, afaics.  Also, most kernel hackers don't
> care too much about the signed/unsigned warnings, as they are 99%
> noise.

Well, the main problem is that since the 2.6.0 kernel headers are used
by glibc on debian (and maybe others) it makes building userland
packages about this difficult. I was asking to know if there was
something inherently bad about implementing this in the userland kernel
headers provided by the glibc, as the glibc debian maintainers have not
been responsive about this, but i know since that a fixed package will
be provided once the situation resulting from the intrusion is cleared.

> Resend the patch after 2.6.0 has been released, I don't see any change
> for it to go in before.

But also no particular reason not to use it, right ?

Thanks for your reply.

Friendly,

Sven Luther

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

* Re: [PATCH] 2.6.0-test9 ioctl compile warnings in userspace
  2003-12-03 13:06     ` Sven Luther
@ 2003-12-03 13:33       ` Jörn Engel
  2003-12-03 14:09         ` Sven Luther
  0 siblings, 1 reply; 7+ messages in thread
From: Jörn Engel @ 2003-12-03 13:33 UTC (permalink / raw)
  To: Sven Luther; +Cc: Johannes Stezenbach, linux-kernel

On Wed, 3 December 2003 14:06:03 +0100, Sven Luther wrote:
> On Wed, Dec 03, 2003 at 01:56:48PM +0100, Jörn Engel wrote:
> > 
> > It doesn't clearly fix a bug, afaics.  Also, most kernel hackers don't
> > care too much about the signed/unsigned warnings, as they are 99%
> > noise.
> 
> Well, the main problem is that since the 2.6.0 kernel headers are used
> by glibc on debian (and maybe others) it makes building userland
> packages about this difficult. I was asking to know if there was
> something inherently bad about implementing this in the userland kernel
> headers provided by the glibc, as the glibc debian maintainers have not
> been responsive about this, but i know since that a fixed package will
> be provided once the situation resulting from the intrusion is cleared.

The current status for userland kernel headers is "the kernel doesn't
care".  Let the glibc folks and whoever else gather the information
from the kernel headers and create derived, but different, userland
headers.

So unless you change this paradigm, your point is void, sorry.

> > Resend the patch after 2.6.0 has been released, I don't see any change
> > for it to go in before.
> 
> But also no particular reason not to use it, right ?

Stability, stability, stability - are three reasons enough? ;)

Linus wants to have very few patches these days and all of them have
to fix a real bug.  Please don't question him doing so, just remember
the 2.4 days with slashdot stories like "kernel of pain".

Jörn

-- 
Fools ignore complexity.  Pragmatists suffer it.
Some can avoid it.  Geniuses remove it.
-- Perlis's Programming Proverb #58, SIGPLAN Notices, Sept.  1982

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

* Re: [PATCH] 2.6.0-test9 ioctl compile warnings in userspace
  2003-12-03 13:33       ` Jörn Engel
@ 2003-12-03 14:09         ` Sven Luther
  2003-12-03 14:34           ` Jörn Engel
  0 siblings, 1 reply; 7+ messages in thread
From: Sven Luther @ 2003-12-03 14:09 UTC (permalink / raw)
  To: Jörn Engel; +Cc: Sven Luther, Johannes Stezenbach, linux-kernel

On Wed, Dec 03, 2003 at 02:33:18PM +0100, Jörn Engel wrote:
> On Wed, 3 December 2003 14:06:03 +0100, Sven Luther wrote:
> > On Wed, Dec 03, 2003 at 01:56:48PM +0100, Jörn Engel wrote:
> > > 
> > > It doesn't clearly fix a bug, afaics.  Also, most kernel hackers don't
> > > care too much about the signed/unsigned warnings, as they are 99%
> > > noise.
> > 
> > Well, the main problem is that since the 2.6.0 kernel headers are used
> > by glibc on debian (and maybe others) it makes building userland
> > packages about this difficult. I was asking to know if there was
> > something inherently bad about implementing this in the userland kernel
> > headers provided by the glibc, as the glibc debian maintainers have not
> > been responsive about this, but i know since that a fixed package will
> > be provided once the situation resulting from the intrusion is cleared.
> 
> The current status for userland kernel headers is "the kernel doesn't
> care".  Let the glibc folks and whoever else gather the information
> from the kernel headers and create derived, but different, userland
> headers.

Ok, i understand.

> So unless you change this paradigm, your point is void, sorry.

Well, i just wanted to get some information about this patch. It has
been posted here already in september if i am not wrong, and there were
various comments, but nothing conclusive in a way or the other, so i was
wondering if it was a good way to solve this or not.

> > > Resend the patch after 2.6.0 has been released, I don't see any change
> > > for it to go in before.
> > 
> > But also no particular reason not to use it, right ?
> 
> Stability, stability, stability - are three reasons enough? ;)
> 
> Linus wants to have very few patches these days and all of them have
> to fix a real bug.  Please don't question him doing so, just remember
> the 2.4 days with slashdot stories like "kernel of pain".

I never dreamed about it. I was just curious about the vailidy of the
patch per se, not really its inclusion into the main trees or not.

Anyway, thanks for the information you provided, things are clearer for
me now.

Friendly,

Sven Luther

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

* Re: [PATCH] 2.6.0-test9 ioctl compile warnings in userspace
  2003-12-03 14:09         ` Sven Luther
@ 2003-12-03 14:34           ` Jörn Engel
  0 siblings, 0 replies; 7+ messages in thread
From: Jörn Engel @ 2003-12-03 14:34 UTC (permalink / raw)
  To: Sven Luther; +Cc: Johannes Stezenbach, linux-kernel

On Wed, 3 December 2003 15:09:18 +0100, Sven Luther wrote:
> 
> Well, i just wanted to get some information about this patch. It has
> been posted here already in september if i am not wrong, and there were
> various comments, but nothing conclusive in a way or the other, so i was
> wondering if it was a good way to solve this or not.

Missed the September discussion, but the patch looks good, so it
should get included someday.  Just not now. :)

Jörn

-- 
This above all: to thine own self be true.
-- Shakespeare

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

end of thread, other threads:[~2003-12-03 14:34 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-11-12 16:37 [PATCH] 2.6.0-test9 ioctl compile warnings in userspace Johannes Stezenbach
2003-12-02 11:43 ` Sven Luther
2003-12-03 12:56   ` Jörn Engel
2003-12-03 13:06     ` Sven Luther
2003-12-03 13:33       ` Jörn Engel
2003-12-03 14:09         ` Sven Luther
2003-12-03 14:34           ` Jörn Engel

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).