All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jeff Garzik <jeff@garzik.org>
To: "H. Peter Anvin" <hpa@zytor.com>
Cc: Miklos Szeredi <miklos@szeredi.hu>,
	jeremy@goop.org, jengelh@computergmbh.de, viro@ftp.linux.org.uk,
	nmiell@comcast.net, linux-fsdevel@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: *at syscalls for xattrs?
Date: Mon, 16 Jul 2007 16:03:24 -0400	[thread overview]
Message-ID: <469BCF0C.6070109@garzik.org> (raw)
In-Reply-To: <469BB190.1080300@zytor.com>

H. Peter Anvin wrote:
> Jeff Garzik wrote:
>>> What the *at() interfaces really do is fix/paper over a longstanding
>>> wart in Unix: the cwd really should have been a standard file descriptor
>>> (like stdin/stdout/stderr) instead of a magic piece of state maintained
>>> in kernel space.
>> It's more than a wart, IMO.  *at() allows one to close races (with
>> potential security implications) that are otherwise impossible to close,
>> in directory traversal.
>>
>> *at() permits a userspace program to hold proper references to all
>> objects during a directory traversal, with all that implies.
>>
> 
> Well, as Jeremy pointed out, in the absence of threads you can do the
> same thing with fchdir(), however, that's much more of a hack.

My posixutils project (coreutils replacement) used fchdir(2), but that 
still doesn't get you 100% race-free.  It gets you close, yes.

	Jeff




  reply	other threads:[~2007-07-16 20:03 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-07-15 19:46 *at syscalls for xattrs? Jan Engelhardt
2007-07-15 20:53 ` Al Viro
2007-07-15 21:13   ` Nicholas Miell
2007-07-15 22:23     ` Al Viro
2007-07-15 23:09       ` H. Peter Anvin
2007-07-16  7:56       ` Jan Engelhardt
2007-07-16  8:04         ` Al Viro
2007-07-16  8:30         ` Jeremy Fitzhardinge
2007-07-16  9:05           ` Miklos Szeredi
2007-07-16  9:33             ` H. Peter Anvin
2007-07-16  9:47               ` Jeff Garzik
2007-07-16 17:57                 ` H. Peter Anvin
2007-07-16 20:03                   ` Jeff Garzik [this message]
2007-07-16 20:40                     ` H. Peter Anvin
2007-07-16  9:12           ` Andreas Schwab
2007-07-16  9:12             ` Andreas Schwab

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=469BCF0C.6070109@garzik.org \
    --to=jeff@garzik.org \
    --cc=hpa@zytor.com \
    --cc=jengelh@computergmbh.de \
    --cc=jeremy@goop.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=miklos@szeredi.hu \
    --cc=nmiell@comcast.net \
    --cc=viro@ftp.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 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.