From mboxrd@z Thu Jan 1 00:00:00 1970 From: Oliver Neukum Date: Sat, 12 Oct 2002 07:49:36 +0000 Subject: hotplug and granting permissions Message-Id: List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: linux-hotplug@vger.kernel.org Am Samstag, 12. Oktober 2002 07:55 schrieb Greg KH: > On Sat, Oct 12, 2002 at 12:21:29AM +0200, Oliver Neukum wrote: > > Am Freitag, 11. Oktober 2002 23:43 schrieb Alan Cox: > > > On Fri, 2002-10-11 at 21:30, Oliver Neukum wrote: > > > > That is not true. Hotplugging changes it. By assigning new devices > > > > to existing device nodes, the kernel _does_ hand out permissions. > > > > > > Only if you got the design wrong. The kernel should pass hotplug the > > > info to create the device nodes. > > > > Then you need a very large number of device numbers. > > What? No you don't. But who cares, I'll get random device number > generation into the kernel eventually... This won't help. You need a counter. As Alan has pointed out to us lesser mortals, the problem is reuse. Therefore you need several times the maximum number of devices on a bus to make this scheme work. Under these circumstances (20 bit minors) it's indeed the easiest solution. IMHO quick and dirty, but this is a matter of personal taste. If you use random generation you'd have to keep a record of previously used numbers. > And this is off topic for this thread :) Yes. And for this list. Therefore I changed topic and list. > > > If you are dealing with a device where a node might be reused, yes you > > > might want to store a generation count and return -EIO if the handle > > > has a mismatched generation count. > > > > That you can only do if you have a handle. In which case the problem > > is easy. But open() takes only a name. You cannot sanely put a generation > > count into that. > > IMHO if you reuse device nodes, you have to reset permissions on them > > in kernel space. > > Nope, not going to happen. But I'll save this discussion for later, > whenever we get enough code into the kernel to be worrying about this. We have code in the kernel that causes this. And it's bad to add stuff before we know how to make it work properly. Regards Oliver ------------------------------------------------------- This sf.net email is sponsored by:ThinkGeek Welcome to geek heaven. http://thinkgeek.com/sf _______________________________________________ Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net Linux-hotplug-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel