public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: Bob Smith <bsmith@linuxtoys.org>
Cc: Arnd Bergmann <arnd@arndb.de>, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 001/001] CHAR DRIVERS: a simple device to give daemons a /sys-like interface
Date: Fri, 9 Aug 2013 16:04:24 -0700	[thread overview]
Message-ID: <20130809230424.GB23418@kroah.com> (raw)
In-Reply-To: <5205727B.7090807@linuxtoys.org>

On Fri, Aug 09, 2013 at 03:51:39PM -0700, Bob Smith wrote:
> 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.

Again, this isn't about hardware, it's about an ipc that you are
creating for user to user communication.  For this to require root
access isn't acceptable.

> >>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.

But you are NOT dealing with hardware here (well, your specific
implementation just happens to do so, but the driver sure doesn't.)

Also, root for hardware is not ok, otherwise how would you as a user be
able to talk to your serial port, or filesystem.

> >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.

How would that work out?

> > (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.

Again, there is no "hardware" in your driver, that just happens to be
how you are using this IPC.  I could be using "hardware" for a daemon
that talks over a named pipe, but that doesn't mean anything to the
kernel code, right?

thanks,

greg k-h

  reply	other threads:[~2013-08-09 23:05 UTC|newest]

Thread overview: 36+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <51FC5478.40500@linuxtoys.org>
2013-08-03  1:19 ` [PATCH 001/001] CHAR DRIVERS: a simple device to give daemons a /sys-like interface Bob Smith
2013-08-03  1:56   ` Joe Perches
2013-08-03  2:35   ` Greg Kroah-Hartman
2013-08-03 18:12     ` Bob Smith
2013-08-03 22:38   ` Greg Kroah-Hartman
2013-08-04 21:54     ` Bob Smith
2013-08-04 23:19       ` Greg Kroah-Hartman
2013-08-05 23:46         ` Bob Smith
2013-08-06  9:46           ` Greg Kroah-Hartman
2013-08-07 19:02             ` Bob Smith
2013-08-07 19:27               ` Greg Kroah-Hartman
2013-08-07 19:39                 ` Bob Smith
2013-08-07 19:51                   ` Greg Kroah-Hartman
2013-08-07 19:54                   ` Greg Kroah-Hartman
2013-08-07 21:04                     ` Bob Smith
2013-08-07 21:33                       ` Greg Kroah-Hartman
2013-08-08 21:23                         ` Bob Smith
2013-08-09 21:52                           ` Greg Kroah-Hartman
2013-08-09 22:20                             ` Bob Smith
2013-08-09 22:14                         ` Bob Smith
2013-08-09 23:01                           ` Greg Kroah-Hartman
2013-08-09 23:35                             ` Bob Smith
2013-08-09 23:46                               ` Greg Kroah-Hartman
2013-08-10 20:08                             ` Bob Smith
2013-08-10 20:29                               ` richard -rw- weinberger
2013-08-10 20:49                                 ` Bob Smith
2013-08-10 21:43                               ` Arnd Bergmann
2013-08-10 22:07                                 ` Bob Smith
2013-08-13 20:15                                   ` Arnd Bergmann
2013-08-07 21:28                     ` Bob Smith
2013-08-07 21:40                       ` Greg Kroah-Hartman
2013-08-07 21:53                         ` Bob Smith
2013-08-09 21:54                           ` Greg Kroah-Hartman
2013-08-09 22:51                             ` Bob Smith
2013-08-09 23:04                               ` Greg Kroah-Hartman [this message]
2013-08-07 21:38             ` Bob Smith

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=20130809230424.GB23418@kroah.com \
    --to=gregkh@linuxfoundation.org \
    --cc=arnd@arndb.de \
    --cc=bsmith@linuxtoys.org \
    --cc=linux-kernel@vger.kernel.org \
    /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