netdev
[Top] [All Lists]

Re: [PATCH 2.6.X] 32->64 bit conversion for wireless private ioctl

To: jt@xxxxxxxxxx
Subject: Re: [PATCH 2.6.X] 32->64 bit conversion for wireless private ioctl
From: Jeff Garzik <jgarzik@xxxxxxxxx>
Date: Thu, 24 Jun 2004 20:15:57 -0400
Cc: "David S. Miller" <davem@xxxxxxxxxx>, Andi Kleen <ak@xxxxxxx>, Pavel Machek <pavel@xxxxxxx>, netdev@xxxxxxxxxxx
In-reply-to: <20040624234307.GA5514@xxxxxxxxxxxxxxxxxx>
References: <20040624234307.GA5514@xxxxxxxxxxxxxxxxxx>
Sender: netdev-bounce@xxxxxxxxxxx
User-agent: Mutt/1.4.1i
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




<Prev in Thread] Current Thread [Next in Thread>