[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <469BB190.1080300@zytor.com>
Date: Mon, 16 Jul 2007 10:57:36 -0700
From: "H. Peter Anvin" <hpa@...or.com>
To: Jeff Garzik <jeff@...zik.org>
CC: Miklos Szeredi <miklos@...redi.hu>, jeremy@...p.org,
jengelh@...putergmbh.de, viro@....linux.org.uk, nmiell@...cast.net,
linux-fsdevel@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: *at syscalls for xattrs?
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.
-hpa
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists