Re: Ksyms request

From: Alexander Viro (viro@math.psu.edu)
Date: Wed Jan 12 2000 - 21:08:05 EST


On Wed, 12 Jan 2000, David Grothe wrote:

> I am in the process of making Linux STREAMS compatible with the 2.3.x
> kernel. One of the functions that has to be implemented in STREAMS is
> the "clone driver". The idea is that a driver can pick its own minor
> device number from a pool so that a driver that manages a bunch of minor
> devices need only have one entry in /dev. When a user opens this /dev
> file he/she gets a unique instance of whatever the driver is managing
> (e.g., pseudo-ttys, virtual circuit, etc).

        You don't need inodes for that. If it is done on per-opener basis
- forget all stuff with minors and associate the data with struct file.
file->private is your friend.

> This would be _much_ easier to implement if the driver could call
> do_mknod() to create a new pseudo-node for the device and do_unlink() to
> later deallocate it. These two are presently not in the ksyms list.

It wouldn't. Moreover, it's blatantly bad policy - you need (a) writable
/dev (bad idea security-wise) and (b) unique name generation in said /dev.
Worse yet, you have to deal with situations when somebody grabs a
reference to such file and holds it, thus creating an easy DoS - keep
doing that and you'll be out of inodes on root.

> Would someone be so kind as to add these to ksyms?

Please, don't. Could you show me your code? Probably I can help with that
problem.
                                                        Al

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Sat Jan 15 2000 - 21:00:21 EST