mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Kay Sievers <kay.sievers@vrfy.org>
To: Brian Swetland <swetland@google.com>
Cc: Greg KH <greg@kroah.com>,
	Andrew Morton <akpm@linux-foundation.org>,
	linux-kernel <linux-kernel@vger.kernel.org>,
	Jan Blunck <jblunck@suse.de>
Subject: Re: [PATCH] driver-core: devtmpfs - driver core maintained /dev tmpfs
Date: Sat, 2 May 2009 15:30:49 +0200	[thread overview]
Message-ID: <ac3eb2510905020630h1261958ey8dca74e3b1cbaa63@mail.gmail.com> (raw)
In-Reply-To: <a55d774e0905012142p7acd1086kc5a10d834b021eaa@mail.gmail.com>

On Sat, May 2, 2009 at 06:42, Brian Swetland <swetland@google.com> wrote:

>>> In our world we use groups to provide access to specific classes of
>>> hardware resources (audio, video, display, dsp, etc) and processes
>>> that have the appropriate permissions are arranged to run with
>>> necessary additional groups for the hardware they need to access.
>>
>> These group numbers are always static on your system, and don't get
>> changed while the system is running? Like you always assign gid X to
>> all sound devices? Or do you need to manage them dynamically?
>
> The gids for device access are static, part of the platform
> definition.

This definition does mainly assign a specific gid to every device of a
specific subsystem, right? Like you have all sound devices use one
gid, all video devices use another one, ...  Very similar what udev
does on every system with the:
  SUBSYSTEM=="...", GROUP="..."
matches, right?

> I could imagine a model where the board file for a target
> defined the ownership for devices or that was loaded in from userspace
> at boot (just a table of path-match-string, uid, gid, perms).  Not
> sure if that'd be considered too ugly, but it would certainly solve
> the problem in a straightforward way.

Hmm, at the point we would need it, there is no userspace to load it,
or a file to read.

> Early on the "device ownership
> policy" is installed and then userspace can leave everything to the
> kernel.

It would need to be right in the kernel, linked into the driver core.
Some "module" could do that, and hook into the processing, when a
device is registered.

> The uids for applications are dynamic, assigned on app install (every
> app gets its own uid).
>
>> Do your device nodes permissions/ownership ever change on the running
>> system after the device is alive?
>
> We never change device node permissions or ownership at runtime.  I
> could see situations in which that would be useful, but it's not
> something that is currently used by the platform.

That would in theory make it possible for your system to put the gid
information in a custom kernel "module" and link it to the driver
core. Usual systems, like the distros do, can not do that, they have a
far more complex policy and completely depend on meaningful symlinks
to the device nodes - but udev solves that problem already, and will
continue to do that.
For very customized systems like yours, maybe we can make it possible
to link-in custom code. I can definitely see the advantage over the
weird hacks you need in your userspace code, just to bring the system
up. Let's just wait, where this discussion ends up with, and if
somebody finds a fundamental problem with devtmpfs approach, otherwise
I'll take look what we can do.

We have a well defined common device naming today, and nobody
implements any custom "naming scheme" like the misguided devfs
hierarchy with default names like:
/dev/ide/host0/bus0/target0/lun0/part1, or /dev/tty/0, or
/dev/cdroms/0 anymore.
We all use the default kernel names, and udev just follows the kernel
given name already for almost all devices. We have a few exceptions in
udev rules left, but there is no good reason not to add these
exceptions as a few strings per subsystem to the kernel itself, and
have the kernel create the default nodes, if it solves a real problem.

Thanks,
Kay

  reply	other threads:[~2009-05-02 13:31 UTC|newest]

Thread overview: 79+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-04-30 13:23 Kay Sievers
2009-05-01  5:29 ` Andrew Morton
2009-05-01  6:17   ` Greg KH
2009-05-01  6:43     ` Andrew Morton
2009-05-01  6:55       ` Greg KH
2009-05-01  7:03         ` Andrew Morton
2009-05-01 10:52           ` Kay Sievers
2009-05-01 11:38             ` Michael Tokarev
2009-05-01 11:44               ` Kay Sievers
2009-05-01 11:03         ` Alan Cox
2009-05-01 11:11           ` Kay Sievers
2009-05-01 13:18             ` Alan Cox
2009-05-01 13:24               ` Kay Sievers
2009-05-02  7:19                 ` Christoph Hellwig
2009-05-02 13:46                   ` Kay Sievers
2009-05-02 15:18                     ` Andy Lutomirski
2009-05-02 15:35                       ` Kay Sievers
2009-05-02 18:20                 ` Michael Riepe
2009-05-02 19:55                   ` Alan Jenkins
2009-05-02 21:47                     ` Kay Sievers
2009-05-04 16:20                       ` Lars Marowsky-Bree
2009-05-04 16:53                         ` Kay Sievers
2009-05-04 17:54                           ` Michael Riepe
2009-05-04 18:13                             ` Kay Sievers
2009-05-04 18:55                               ` Michael Riepe
2009-05-04 19:13                                 ` Kay Sievers
2009-05-04 19:30                                 ` Greg KH
2009-05-02  1:24         ` Brian Swetland
2009-05-02  1:48           ` Kay Sievers
2009-05-02  2:02             ` Brian Swetland
2009-05-02  2:28               ` Kay Sievers
2009-05-02  4:42                 ` Brian Swetland
2009-05-02 13:30                   ` Kay Sievers [this message]
2009-05-01 11:01     ` Alan Cox
2009-05-01 11:02       ` Kay Sievers
2009-05-01 11:16   ` Kay Sievers
2009-05-01 19:26     ` Andrew Morton
2009-05-01 21:59       ` Kay Sievers
2009-05-01 22:21         ` Andrew Morton
2009-05-01  6:57 ` Chris Wedgwood
2009-05-01 14:01   ` Greg KH
2009-05-01 15:43     ` Alan Jenkins
2009-05-01 16:04       ` Greg KH
2009-05-01 21:13         ` Alan Jenkins
2009-05-01 15:53     ` Chris Wedgwood
2009-05-01 16:09       ` Greg KH
2009-05-01 16:17         ` Chris Wedgwood
2009-05-01 10:19 ` Alan Jenkins
2009-05-01 11:13   ` Kay Sievers
2009-05-01 12:38     ` Alan Jenkins
2009-05-01 13:12       ` Alan Cox
2009-05-02 15:03         ` Kyle Moffett
2009-05-01 14:55       ` Kay Sievers
2009-05-01 11:41 ` Hugh Dickins
2009-05-01 11:59   ` Kay Sievers
2009-05-02  7:16 ` Christoph Hellwig
2009-05-02 11:34   ` Kay Sievers
2009-05-02 20:22     ` Alan Jenkins
2009-05-02 21:39       ` Kay Sievers
2009-05-02 22:04         ` Alan Jenkins
2009-05-03  7:29           ` Michael Tokarev
2009-05-02 21:41       ` Alan Jenkins
2009-05-02 21:54         ` Greg KH
2009-05-02 21:59         ` Kay Sievers
2009-05-02 16:59   ` Jeff Garzik
2009-05-02 17:57     ` Kay Sievers
2009-05-06 12:56 ` Kay Sievers
2009-05-07  1:41 ` Arjan van de Ven
2009-05-07  2:08   ` Kay Sievers
2009-05-07  2:25     ` Arjan van de Ven
2009-05-07  2:40       ` Kay Sievers
2009-05-14  9:28     ` Pavel Machek
2009-05-07  8:17 ` Eric W. Biederman
2009-05-07  9:28   ` Kay Sievers
2009-05-07 14:43     ` Theodore Tso
2009-05-07 15:13       ` Kay Sievers
2009-05-10  0:29     ` Eric W. Biederman
2009-05-10  0:56       ` Kay Sievers
2009-05-10  2:11         ` Eric W. Biederman

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ac3eb2510905020630h1261958ey8dca74e3b1cbaa63@mail.gmail.com \
    --to=kay.sievers@vrfy.org \
    --cc=akpm@linux-foundation.org \
    --cc=greg@kroah.com \
    --cc=jblunck@suse.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=swetland@google.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®