netdev
[Top] [All Lists]

RE: ioctl call for network device

To: "Hen, Shmulik" <shmulik.hen@xxxxxxxxx>
Subject: RE: ioctl call for network device
From: "Richard B. Johnson" <root@xxxxxxxxxxxxxxxxxx>
Date: Tue, 8 May 2001 08:02:51 -0400 (EDT)
Cc: "'LKML'" <linux-kernel@xxxxxxxxxxxxxxx>, "'LNML'" <linux-net@xxxxxxxxxxxxxxx>, "'netdev@xxxxxxxxxxx'" <netdev@xxxxxxxxxxx>
In-reply-to: <07E6E3B8C072D211AC4100A0C9C5758302B27218@hasmsx52.iil.intel.com>
Reply-to: root@xxxxxxxxxxxxxxxxxx
Sender: owner-netdev@xxxxxxxxxxx
On Tue, 8 May 2001, Hen, Shmulik wrote:

> > struct ifreq has a member called ifr_data. It is a pointer. You can
> > put a pointer to any of your data, including the most complex structure
> > you might envision, in that area. This allows you to pass anything
> > to and from your module. This pointer can be properly dereferenced
> > in kernel space but you should use copy_to/from_user and friends so a
> > user-space coding bug won't panic the kernel.
> 
> How about a linked list ?
> Will the driver be able to follow the list where each node was dynamically
> allocated by the application ?
> Is there a size limit on the buffer ifr_data points to ? (AFAIK, Windows
> NDIS drivers limit to 1 page buffer =4096 bytes).
> 
> 
>       Thanks,
> 
>       Shmulik Hen      
>       Linux Advanced Networking Services
>       Intel Network Communications Group

Again; This is a pointer. Your driver can dereference any valid pointer.
You can't do this while holding a lock that will prevent page faults.
Other than this, there are no problems.


Cheers,
Dick Johnson

Penguin : Linux version 2.4.1 on an i686 machine (799.53 BogoMips).

"Memory is like gasoline. You use it up when you are running. Of
course you get it all back when you reboot..."; Actual explanation
obtained from the Micro$oft help desk.



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