lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20130314225940.GQ21522@ZenIV.linux.org.uk>
Date:	Thu, 14 Mar 2013 22:59:40 +0000
From:	Al Viro <viro@...IV.linux.org.uk>
To:	Miklos Szeredi <miklos@...redi.hu>
Cc:	Linus Torvalds <torvalds@...ux-foundation.org>,
	linux-fsdevel <linux-fsdevel@...r.kernel.org>,
	Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
	Christoph Hellwig <hch@...radead.org>,
	Andrew Morton <akpm@...ux-foundation.org>,
	Robo Bot <apw@...onical.com>, Felix Fietkau <nbd@...nwrt.org>,
	Neil Brown <neilb@...e.de>,
	Jordi Pujol <jordipujolp@...il.com>, ezk@....cs.sunysb.edu,
	David Howells <dhowells@...hat.com>,
	Sedat Dilek <sedat.dilek@...glemail.com>,
	"J. R. Okajima" <hooanon05@...oo.co.jp>
Subject: Re: [PATCH 00/13] overlay filesystem: request for inclusion (v16)

On Thu, Mar 14, 2013 at 11:37:50AM +0100, Miklos Szeredi wrote:

> > As for whiteouts... I think we ought to pull these bits of unionmoun
> > queue into the common stem and add the missing filesystems to them;
> > ext* and ufs are trivial (keep in mind that FFS derivatives, including
> > ext*, have d_type in directory entry and type 14 (DT_WHT) is there
> > precisely for that purpose).  btrfs also has "dir_type" thing - 8bit
> > field...
> 
> What about userspace interfaces?  Are we allowed to extend d_type and
> st_mode without breaking things?

Huh?
	* from st_mode point of view, it's not going to conflict with
anything; FFS "entry type" matches bits 12..15 of mode_t, and the value
picked by whoever had first implemented whiteouts had been chosen so
that it would not clash with any existing values.  We have
#define S_IFMT  00170000
#define S_IFSOCK 0140000
#define S_IFLNK  0120000
#define S_IFREG  0100000
#define S_IFBLK  0060000
#define S_IFDIR  0040000
#define S_IFCHR  0020000
#define S_IFIFO  0010000
and this sucker would've been 0160000; new filesystem object types are not
frequently introduced, to put it mildly, so I wouldn't expect clashes.
Especially since any such clash would hit Solaris and *BSD (including
MacOS X) as well - all of them use that value for whiteouts.
	* for practically all syscalls these guys are treated as file not
being there; e.g. mkdir() on such name results in whiteout silently
replaced with references to newly created subdirectory, etc.
	* BSDs have one major exposure of those guys to userland - their
getdents(2) shows whiteouts (with d_type equal to DT_WHT and d_fileno - to 1).
Other than that (and we obviously do _not_ want that as default behaviour;
maybe a new O_<something> to produce that), there's practically nothing -
undelete(2) removes a whiteout in attempt to expose the object masked by
it, mknod(2) with S_IFWHT as type does create one.  That's it.

IOW, I don't see how we'd get any kind of userland problems with those.  And
this is not a new API - a bunch of BSD-derived Unices starting with, IIRC,
SunOS 3 and 4.3BSD, as well as their bastard progeny (Solaris, MacOS X)
had that since mid-80s...
--
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

Powered by Openwall GNU/*/Linux Powered by OpenVZ