mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Alan Cox <alan@lxorguk.ukuu.org.uk>
To: Miklos Szeredi <miklos@szeredi.hu>
Cc: miklos@szeredi.hu, luto@mit.edu, akpm@linux-foundation.org,
	linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v3] vfs: new O_NODE open flag
Date: Mon, 7 Dec 2009 14:46:23 +0000	[thread overview]
Message-ID: <20091207144623.692fbc1e@lxorguk.ukuu.org.uk> (raw)
In-Reply-To: <E1NHeXH-0003Lb-3q@pomaz-ex.szeredi.hu>

> > First obvious attack: get an O_NODE handle to a device you have assigned
> > to your ownership
> > 
> > 	while(1)
> > 		fchmod(fd, 0666);
> > 
> > wait for device to unload, reload and be intended for another user
> > Race udev to a real open. You have a similar problem with vhangup() and
> > ttys.
> 
> If this was a udev device, the same attack is possible with a hard
> link to the device.  Except the attacker simply does link() instad of
> open(O_NODE) and chmod() instead of fchmod().

If your distribution does not use a separate tmpfs for devices then yes -
but that's old news - and also needs revoke() to fix. It's a requirement
of udev as it stands that it runs on its own file system and I would hope
that all distributions using udev get this right. With O_NODE I don't
need to make the hardlink and all the "same as a hardlink" justifications
come crashing down.

This always comes back to the same thing - you need revoke() on device
files. The general case revoke is much more questionable (and indeed
almost every Unixen with revoke does not support revoke of files)

So we are back where we started - a prerequisite for O_NODE is revoke()
at least for device files and possibly for O_NODE opens on normal files.
O_NODE isn't per-se the problem, the problem is the lack of revoke() - it
just gets caught up in the fallout along with many other things including
all sorts of stuff the GUI folks want to do but cannot currently provide.

Alan

  reply	other threads:[~2009-12-07 14:45 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-12-02 16:16 Miklos Szeredi
2009-12-02 19:15 ` Alan Cox
2009-12-02 20:13   ` Miklos Szeredi
2009-12-02 20:48     ` Alan Cox
2009-12-03  5:46       ` Miklos Szeredi
2009-12-05 14:42         ` Andy Lutomirski
2009-12-05 19:40           ` Miklos Szeredi
2009-12-05 20:28             ` Alan Cox
2009-12-05 20:35               ` Miklos Szeredi
2009-12-05 23:13                 ` Alan Cox
2009-12-07  6:08                   ` Miklos Szeredi
2009-12-07 12:23                     ` Alan Cox
2009-12-07 12:41                       ` Miklos Szeredi
2009-12-07 12:47                         ` Miklos Szeredi
2009-12-07 13:03                           ` Alan Cox
2009-12-07 13:08                             ` Miklos Szeredi
2009-12-07 13:15                               ` Alan Cox
2009-12-07 13:16                                 ` Miklos Szeredi
2009-12-07 14:13                                   ` Alan Cox
2009-12-07 14:25                                     ` Miklos Szeredi
2009-12-07 14:46                                       ` Alan Cox [this message]
2009-12-07 15:11                                         ` Miklos Szeredi
2009-12-07 17:40                                           ` Alan Cox
2009-12-07 15:03                                     ` Andrew Lutomirski
2009-12-07 15:50                                       ` Miklos Szeredi
2009-12-07 17:16                                       ` Alan Cox
2009-12-10  7:39                         ` Pavel Machek
2009-12-06  8:46 ` Pavel Machek

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=20091207144623.692fbc1e@lxorguk.ukuu.org.uk \
    --to=alan@lxorguk.ukuu.org.uk \
    --cc=akpm@linux-foundation.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=luto@mit.edu \
    --cc=miklos@szeredi.hu \
    /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®