From: Pavel Machek <pavel@ucw.cz>
To: "Eric W. Biederman" <ebiederm@xmission.com>
Cc: Miklos Szeredi <miklos@szeredi.hu>,
alan@lxorguk.ukuu.org.uk, akpm@linux-foundation.org,
viro@ZenIV.linux.org.uk, dhowells@redhat.com, hch@infradead.org,
adilger@sun.com, mtk.manpages@gmail.com,
torvalds@linux-foundation.org, drepper@gmail.com,
jamie@shareable.org, linux-fsdevel@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2 resend] vfs: new O_NODE open flag
Date: Sun, 8 Nov 2009 18:01:57 +0100 [thread overview]
Message-ID: <20091108170157.GA1389@ucw.cz> (raw)
In-Reply-To: <m1y6mipnc4.fsf@fess.ebiederm.org>
Hi!
> > The only really weird case Alan spotted is device nodes, where the
> > actual device registered to a major/minor pair changes over time,
> > possibly allowing a re-open to access a device it otherwise was not
> > meant to. BTW if the device number reuse happens really quickly, this
> > could even be a race for a plain open. Real solution might actually
> > be in udev: when deregistering a device, change mode bits to all-zero
> > before removing the device node.
>
> Devices nodes specifically were the case I was thinking of.
>
> Changing the mode bits to all-zero at the final unlink would be a lot
> more reliable and certain in the kernel.
Does it really close the race completely?
udev sets 660
open does permission checks
device disappears
chmod 000
new device appears
udev chmods 600
open returns new device
?
Pavel
--
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
next prev parent reply other threads:[~2009-11-08 17:02 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-11-05 11:23 [PATCH v2 resend] vfs: new O_NODE open flag Miklos Szeredi
2009-11-05 13:15 ` Alan Cox
2009-11-05 14:27 ` Miklos Szeredi
2009-11-05 14:50 ` Alan Cox
2009-11-05 15:24 ` Miklos Szeredi
2009-11-05 15:56 ` Alan Cox
2009-11-05 16:52 ` Miklos Szeredi
2009-11-05 18:25 ` Alan Cox
2009-11-06 11:10 ` Miklos Szeredi
2009-11-06 1:40 ` Jamie Lokier
2009-11-06 11:31 ` Miklos Szeredi
2009-11-06 14:17 ` Pavel Machek
2009-11-06 20:55 ` Eric W. Biederman
2009-11-07 7:49 ` Miklos Szeredi
2009-11-07 11:09 ` Eric W. Biederman
2009-11-07 11:31 ` Miklos Szeredi
2009-11-07 11:48 ` Eric W. Biederman
2009-11-08 17:01 ` Pavel Machek [this message]
2009-11-16 11:50 ` Miklos Szeredi
2009-11-07 17:58 ` Pavel Machek
2009-11-09 8:58 ` 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=20091108170157.GA1389@ucw.cz \
--to=pavel@ucw.cz \
--cc=adilger@sun.com \
--cc=akpm@linux-foundation.org \
--cc=alan@lxorguk.ukuu.org.uk \
--cc=dhowells@redhat.com \
--cc=drepper@gmail.com \
--cc=ebiederm@xmission.com \
--cc=hch@infradead.org \
--cc=jamie@shareable.org \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=miklos@szeredi.hu \
--cc=mtk.manpages@gmail.com \
--cc=torvalds@linux-foundation.org \
--cc=viro@ZenIV.linux.org.uk \
/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;
as well as URLs for NNTP newsgroup(s).