Re: [PATCH] ioctl entries for joystick in compat_ioctl.h

From: Pavel Machek
Date: Fri Sep 12 2003 - 16:16:03 EST


Hi!

> > > I wanted to use a joystick on my sparc64 workstation, and discovered that the
> > > joystick driver uses simple ioclt that are safe to pass from 32bit user space
> > > to 64bit kernel space. My patch adds the necessary entries in compat_ioctl.h.
> > >
> > > There is only one missing ioctl in the patch. The ioctl is defined like this:
> > > #define JSIOCGNAME(len) _IOC(_IOC_READ, 'j', 0x13, len)
> > > so the command does not have a fixed value. I dont know how to handle this one,
> > > but it is only used to get the joystick name, all the applications I tried work
> > > well even if this ioctl fails.
> >
> > Well, whoever invented that JSIOCGNAME should be shot. That is not
> > single ioctl, its 2^14 of them!
>
> Well, who could ever have known that this will be a problem in 1998?
> It's not the only ioctl done this way.

So it was you? :-)

I believe ultrasparcs were around in '98. Anyway, what are other
ioctls doing this? They look pretty problematic from compat_ioctl
perspective.

We could do better by pushing compat handler down to the drivers for
ugly cases like this...
Pavel
--
When do you have a heart between your knees?
[Johanka's followup: and *two* hearts?]
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/