On Thu, Jun 24, 2004 at 04:43:07PM -0700, Jean Tourrilhes wrote:
> Hi all,
>
> (Sorry for the spam)
>
> The Wireless Extensions use a bunch of driver specific
> ioctl. Jeff told me that those can't be safe when running a 32 bit
> userspace on a 64 bit kernel. So, I did a patch...
> Patch is for kernel 2.6.5.
>
> Treat this patch as a proof of concept. I don't have any 64
> bit machine, so no way to compile it (without talking of actually
> testing it). But this is where I hope you guys will help me ;-)
You missed what I was trying to communicate :(
It is a logical contradiction to create a generic interface for
driver-private ioctls. You wind up re-inventing Sun XDR.
> + /* Get the description of the IOCTL */
> + for(i = 0; i < dev->wireless_handlers->num_private_args; i++)
> + if(cmd == dev->wireless_handlers->private_args[i].cmd) {
> + descr = &(dev->wireless_handlers->private_args[i]);
> + break;
This is essentially runtime definition of structures types.
We want to go in the opposite direction: compile and verify as much
code as possible at compile time. Strong, compile-time type checking.
Jeff
|