All of lore.kernel.org
 help / color / mirror / Atom feed
From: Greg KH <greg@kroah.com>
To: Kay Sievers <kay.sievers@vrfy.org>
Cc: Linus Torvalds <torvalds@linux-foundation.org>,
	Ingo Molnar <mingo@elte.hu>,
	"Eric W. Biederman" <ebiederm@xmission.com>,
	linux-kernel@vger.kernel.org
Subject: Re: [bug] /etc/profile: line 30: /dev/null: Permission denied (Was: Re: [PATCH] Remove broken by design and by implementation devtmpfs maintenance disaster)
Date: Thu, 17 Sep 2009 23:02:10 -0700	[thread overview]
Message-ID: <20090918060210.GC7104@kroah.com> (raw)
In-Reply-To: <1253238637.4071.10.camel@yio.site>

On Fri, Sep 18, 2009 at 03:50:36AM +0200, Kay Sievers wrote:
> On Thu, 2009-09-17 at 17:18 -0700, Linus Torvalds wrote:
> > 
> > On Fri, 18 Sep 2009, Kay Sievers wrote:
> > > 
> > > > So I suspect /dev/null and /dev/zero should be special - just make them
> > > > have 0666 permissions. Because they really _are_ special, and no other
> > > > permissions ever make sense for them.
> > > 
> > > That's true. I guess there are a few more devices that need special
> > > permissions.
> > 
> > /dev/tty is probably the only remaining one - I don't think there should 
> > be any other devices that are so special that normal programs expect them 
> > to be there, and expect to be able to open them.
> > 
> > /dev/null (and to a lesser degree /dev/zero) really are special, and they 
> > are special not so much because they are special devices, but because they 
> > are part of the unix environment in rather deep ways. For example, mmap() 
> > on /dev/zero is deeply special, and really is about shm rather than any 
> > devices, so it's a VM thing with an odd special case.
> > 
> > And /dev/tty is special in that you'd expected to be able to open it even 
> > if you can't open the device that it points to - you may have inherited a 
> > tty from a program that _used_ to have permission to the underlying 
> > /dev/ttyxyz thing, but even if you no longer can open that device, 
> > /dev/tty still works.
> > 
> > The rest of /dev really should be rather esoteric, or it should be about 
> > real devices. So I do think that with just null, zero and tty having 0666 
> > permissions, a "normal UNIX" program is supposed to work. That should be 
> > the minimal set, but also the maximal set of devices that people should 
> > _expect_ to work.
> 
> Here is a quick hack to allow subsystems to provide a mode for their
> devices. It uses the callback that can provide custom non-default device
> names. Ingo, maybe you can give it a try?
> 
> To see how it works, it currently includes access to: null, zero, full,
> random, urandom, tty, ptmx. Also the USB /dev nodes have the same
> permissions as the USB /proc nodes always had. That's basically what
> udev does today for non-root users.

Ick, I don't think we should do something like this, it starts putting
the mode policy back into the kernel.  What's next, owner and group?  :)

I think the udev version in older Fedora releases can't handle this
kernel option, which is fine, just don't enable it.  Newer versions can
handle it, right?

thanks,

greg k-h

  reply	other threads:[~2009-09-18  6:07 UTC|newest]

Thread overview: 61+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-09-17  8:23 [PATCH] Remove broken by design and by implementation devtmpfs maintenance disaster Eric W. Biederman
2009-09-17 12:03 ` Kay Sievers
2009-09-17 13:13   ` Alan Cox
2009-09-17 16:35     ` Scott James Remnant
2009-09-17 17:47       ` Arjan van de Ven
2009-09-17 18:59         ` Scott James Remnant
2009-09-17 19:11           ` Arjan van de Ven
2009-09-18 12:57           ` Eric W. Biederman
2009-09-18 13:16   ` Eric W. Biederman
2009-09-18 13:54   ` Eric W. Biederman
2009-09-18 14:09     ` Arjan van de Ven
2009-09-18 14:11       ` Kay Sievers
2009-09-18 14:25         ` Arjan van de Ven
2009-09-18 14:32           ` Kay Sievers
2009-09-18 14:43             ` Arjan van de Ven
2009-09-18 14:58               ` Kay Sievers
2009-09-18 15:13                 ` Arjan van de Ven
2009-09-18 15:32                   ` Kay Sievers
2009-09-18 19:33                     ` Eric W. Biederman
2009-09-18 14:42       ` Eric W. Biederman
2009-09-17 12:57 ` Greg KH
2009-09-17 13:05   ` Alan Cox
2009-09-17 13:29     ` Greg KH
2009-09-17 15:43       ` Alan Cox
2009-09-18  6:03         ` Greg KH
2009-09-18  9:25           ` Alan Cox
2009-09-18 15:05             ` Greg KH
2009-09-17 17:29   ` Eric W. Biederman
2009-09-17 18:53     ` [bug] /etc/profile: line 30: /dev/null: Permission denied (Was: Re: [PATCH] Remove broken by design and by implementation devtmpfs maintenance disaster) Ingo Molnar
2009-09-17 19:18       ` Kay Sievers
2009-09-17 20:26         ` Linus Torvalds
2009-09-17 20:31           ` Ingo Molnar
2009-09-18  5:58             ` Greg KH
2009-09-25 20:49               ` Pavel Machek
2009-09-27 22:52                 ` Greg KH
2009-09-17 22:26           ` Kay Sievers
2009-09-17 22:41             ` Alan Cox
2009-09-18  0:18             ` Linus Torvalds
2009-09-18  1:50               ` Kay Sievers
2009-09-18  6:02                 ` Greg KH [this message]
2009-09-18 11:50                   ` Kay Sievers
2009-09-18 14:18                   ` Linus Torvalds
2009-09-18 15:05                     ` Greg KH
2009-09-18 15:37                       ` Kay Sievers
2009-09-18 19:35                         ` Kay Sievers
2009-09-18 19:41                           ` Linus Torvalds
2009-09-18 19:50                           ` Ingo Molnar
2009-09-20  1:43                             ` Dave Airlie
2009-09-20 15:08                               ` Greg KH
2009-09-21  2:58                                 ` Dave Airlie
     [not found]                                 ` <ac3eb2510909200912o76e0d4e4l2dcaf352fe6b4e19@mail.gmail.com>
     [not found]                                   ` <ac3eb2510909200914g1ed6a47cydc0edec6fff96ef4@mail.gmail.com>
2009-09-21  2:59                                     ` Dave Airlie
2009-10-20 20:32                                       ` Scott James Remnant
2009-09-20 17:33                               ` Ingo Molnar
2009-09-18 20:58                 ` [bug] /etc/profile: line 30: /dev/null: Permission denied Eric W. Biederman
2009-09-18 21:09                   ` Linus Torvalds
2009-09-18 21:19                     ` Kay Sievers
2009-09-18 22:06                       ` Linus Torvalds
2009-09-18 21:31                   ` Kay Sievers
2009-09-18 22:03                     ` Eric W. Biederman
2009-09-18  5:54     ` [PATCH] Remove broken by design and by implementation devtmpfs maintenance disaster Greg KH
2009-09-18 12:24       ` 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=20090918060210.GC7104@kroah.com \
    --to=greg@kroah.com \
    --cc=ebiederm@xmission.com \
    --cc=kay.sievers@vrfy.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=torvalds@linux-foundation.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.