X-Spam-Checker-Version: SpamAssassin 3.4.0-r929098 (2010-03-30) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-1.8 required=5.0 tests=BAYES_00,J_CHICKENPOX_12 autolearn=no version=3.4.0-r929098 Received: from cuda.sgi.com (cuda1.sgi.com [192.48.157.11]) by oss.sgi.com (8.14.3/8.14.3/SuSE Linux 0.8) with ESMTP id o989P2dn019123 for ; Fri, 8 Oct 2010 04:25:02 -0500 X-ASG-Debug-ID: 1286530799-632702590000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from mx01.instandbesetzt.net (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 8BBBFED92BE for ; Fri, 8 Oct 2010 02:39:59 -0700 (PDT) Received: from mx01.instandbesetzt.net (cache.dhh-3.de [62.89.186.8]) by cuda.sgi.com with ESMTP id Jxp3wbEygTGw9D63 for ; Fri, 08 Oct 2010 02:39:59 -0700 (PDT) Received: (qmail 11641 invoked from network); 8 Oct 2010 09:26:03 -0000 Received: from unknown (HELO localhost) (aw@141.76.6.230) by mx01.instandbesetzt.net with ESMTPA; 8 Oct 2010 09:26:03 -0000 Date: Fri, 8 Oct 2010 11:26:01 +0200 From: Andreas Wiese To: Dave Chinner Cc: Linux Kernel Mailing List , Ciaran McCreesh , xfs@oss.sgi.com X-ASG-Orig-Subj: Re: fallocate() on XFS clobbers S*ID-bits Subject: Re: fallocate() on XFS clobbers S*ID-bits Message-ID: <20101008092600.GA12718@incendiary.meterriblecrew.net> References: <20101007183418.GC5621@incendiary.meterriblecrew.net> <20101007232451.GO4681@dastard> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20101007232451.GO4681@dastard> X-GPG-Key-ID: 0x08709798 (2048/4096bit RSA/RSA) X-GPG-Fingerprint: F8F1 7E3C 2C24 5189 FC21 61E9 1F99 AEB4 0870 9798 X-Jabber-ID: aw@instandbesetzt.net (w/ GPG) X-Home: https://www.instandbesetzt.net/ User-Agent: Mutt/1.5.21 (2010-09-15) X-Barracuda-Connect: cache.dhh-3.de[62.89.186.8] X-Barracuda-Start-Time: 1286530801 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -2.02 X-Barracuda-Spam-Status: No, SCORE=-2.02 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests= X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.2.43070 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on oss.sgi.com X-Virus-Status: Clean Dave Chinner wrote: > [ added xfs list on cc ] > Thanks. ;) > On Thu, Oct 07, 2010 at 08:34:19PM +0200, Andreas Wiese wrote: > > Hello. > > > > I (with support from Cc'ed Ciaran) just noticed some odd behaviour with > > fallocate() on XFS. After open()ing some file and setting it S*ID via > > fchmod(), S*ID bits vanish after calling fallocate() — as supposed to > > for non-root users, but it also happens for root. > > > > Is this intended behaviour or did we spot a bug here? > > > > At least on ext2 it works as expected, thus I guess it's the latter one. > > ext2 does not support the fallocate syscall. How does ext4 behave? > Oh, crap. I first tested on tmpfs (which doesn't support fallocate, too) and had a » && errno != ENOTSUP« to avoid bailing out but forgot to warn. :/ But I did now and ext4 does _not_ touch the permissions any further. > > I'm running v2.6.35.7 vanilla-kernel, but diffing fs/xfs to master > > doesn't seem to address this issue. > > XFS has always cleared SUID/SGID bits when doing preallocation (via > XFS_IOC_RESVSP). Given that that XFS ioctl formed the model for > fallocate, I'd argue that the XFS behaviour is the on that should be > followed. > If that's consense, we at least found a bug in ext4… > It'd be a bit silly for two different preallocation interfaces to > have different behaviour w.r.t. SUID bits, but it's not clear to me > which behaviour is correct. I'm happy to defer to whoever can say > what the behaviour is supposed to be here... > I would appreciate that, too. And while on it… just tested BTRFS, which behaves like ext4 (not altering permissions). CIFS and OCFS are not testable here due to lack of according servers. [snip…] HAND & LG -- aw np: Johnossi (Johnossi) — 08. Happiness a La Mode