Re: [PATCH 001/001] CHAR DRIVERS: a simple device to give daemons a /sys-like interface

Bob Smith
2013-08-09T22:51:39Z

Greg Kroah-Hartman wrote:
> On Wed, Aug 07, 2013 at 02:53:50PM -0700, Bob Smith wrote:
>> Agreed. But you need root permissions to install an application
>> and part of that installation can be setting up systemd files
>> that allocate resources at boot.
>
> Do you have examples of those systemd files? Last I looked, they didn't
> have mknod permissions anymore, which is a good thing.

The difference is that Linux usually detects the hardware that is
connected to it and automatically creates device nodes for it.
This is part of the boot process.
In the case of a userspace device driver, the kernel never sees
the hardware so it is up the USD to create the nodes for the hardware.

>
>> Also, some applications start as root just so they can do this kind of
>> allocation. The app can (and should) drop root privileges when it
>> can.
> You shouldn't require root for a new feature, that seems strange.

OK, but root for a new feature dealing with hardware seems OK.

>
> Also, namespaces aren't addressed at all, but that's a totally different
> issue...

No, but I hope namespace policy can be handled in userspace and not
in the proxy module itself.

>
> (snip)
>> As noted above, yes, root has to set it up and set the permissions,
>> but this is hardly unusual, is it?
>
> Yes it is, modern userspace does not create any device nodes anymore,
> please let's not regress on that point.

Yes, I suppose this can be viewed as a regression, but I don't see a
way around this right now. The problem is that only the userspace
driver sees the new hardware and so knows what device nodes to create.

Once again, thanks.

Bob Smith