From: "Theodore Ts'o" <tytso@mit.edu>
To: linux-ext4@vger.kernel.org, xfs@oss.sgi.com
Cc: Stefan Behrens <sbehrens@giantdisaster.de>
Subject: xfstests #62 broken on ext4
Date: Sat, 13 Aug 2011 10:38:51 -0400 [thread overview]
Message-ID: <E1QsFMR-0001iq-Vt@tytso-glaptop> (raw)
Xfstests #62 was recently enabled by commit b2b36d0a4.
However, this test is failing for ext4 because ext4 doesn't support
extended attributes on anything other than regular files and
directories. This is behavior is documented in the attr(5) man page:
Extended user attributes
Extended user attributes may be assigned to files and directories for
storing arbitrary additional information such as the mime type, charac‐
ter set or encoding of a file. The access permissions for user
attributes are defined by the file permission bits.
The file permission bits of regular files and directories are inter‐
preted differently from the file permission bits of special files and
symbolic links. For regular files and directories the file permission
bits define access to the file's contents, while for device special
files they define access to the device described by the special file.
The file permissions of symbolic links are not used in access checks.
These differences would allow users to consume filesystem resources in
a way not controllable by disk quotas for group or world writable spe‐
cial files and directories.
For this reason, extended user attributes are only allowed for regular
files and directories, and access to extended user attributes is
restricted to the owner and to users with appropriate capabilities for
directories with the sticky bit set (see the chmod(1) manual page for
an explanation of Sticky Directories).
... and it is enforced by the generic fs/xattr.c code in
xattr_permission():
/*
* In the user.* namespace, only regular files and directories can have
* extended attributes. For sticky directories, only the owner and
* privileged users can write attributes.
*/
if (!strncmp(name, XATTR_USER_PREFIX, XATTR_USER_PREFIX_LEN)) {
if (!S_ISREG(inode->i_mode) && !S_ISDIR(inode->i_mode))
return (mask & MAY_WRITE) ? -EPERM : -ENODATA;
if (S_ISDIR(inode->i_mode) && (inode->i_mode & S_ISVTX) &&
(mask & MAY_WRITE) && !inode_owner_or_capable(inode))
return -EPERM;
}
It looks like XFS is not conformant to documented behaviour and the file
system generic code. The question is how should we fix this? I can
think of a couple of different options
(1) Back out commit b2b36d0a4 and make test #62 XFS-specific again.
(2) Option #1, above, and then also create another test for file systems
with the standard/generic Linux behavior
(3) Modify test #62 so that it can support both the XFS and Linux
generic behavior.
(4) Change the generic code to match what XFS does (despite the design
rationale mentioned in the attr(5) man page).
(5) Change XFS to match the generic behavior, and then change test #62.
What do people think?
- Ted
--
To unsubscribe from this list: send the line "unsubscribe linux-ext4" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
next reply other threads:[~2011-08-13 14:38 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-08-13 14:38 Theodore Ts'o [this message]
2011-08-13 15:57 ` xfstests #62 broken on ext4 Stefan Behrens
2011-08-13 20:14 ` Christoph Hellwig
2011-08-14 0:44 ` Ted Ts'o
2011-08-14 16:09 ` Christoph Hellwig
2011-08-19 14:46 ` Eric Sandeen
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=E1QsFMR-0001iq-Vt@tytso-glaptop \
--to=tytso@mit.edu \
--cc=linux-ext4@vger.kernel.org \
--cc=sbehrens@giantdisaster.de \
--cc=xfs@oss.sgi.com \
/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