From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andreas Gruenbacher Subject: Re: JFS extended attributes and ACLs - New Patches Date: Thu, 12 Sep 2002 17:13:56 +0200 Sender: linux-fsdevel-owner@vger.kernel.org Message-ID: <200209121713.44897.agruen@suse.de> References: Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7BIT Cc: acl-devel@bestbits.at, linux-fsdevel@vger.kernel.org Return-path: To: Luka Renko , Dave Kleikamp In-Reply-To: List-Id: linux-fsdevel.vger.kernel.org On Tuesday 10 September 2002 09:40, Luka Renko wrote: > On Monday 09 September 2002 10:02, Andreas Gruenbacher wrote: > > Extended user attributes should be allowed only for regular files and > > for directories with the sticky bet cleared. Rationale: See the > > attr(5) manual page. > > Hmm. If different policies are to be applied to the different > namespaces, I think it would be a good thing to move that > policy to the > vfs layer, rather than have each filesystem redundantly enforce these > policies. > > If the VFS is requesting that an extended attribute be set, the > filesystem-specific code should be able to assume it's allowed. I've > tried to keep the JFS code simple. It really doesn't care and doesn't > want to care about namespaces. I've special cased the setting of acl's > to make sure the permissions get set correctly, but I'd prefer this > happened at a higher level as well. > I think that is the right solution. FS should not care about namespaces > and potential limitations they should just provide storage for EA. >>From a filesystem point of view I can understand this position. From the VFS point of view this doesn't make too much sense though: For each namespace there are at least three kinds of limitations: Policy/permissions, restrictions on the valid values, and storage related limitations. Filesystems may support different namespaces, and within namespaces like `system', different attributes with individual restrictions. If we implement the policy in the VFS, then the VFS would have to know about all possible kinds of namespaces and attributes, and about their generic limitations, while the file systems would still need to check for their specific limitations (i.e., some tasks would have to be done twice). The current interface (the xattr VFS operations) wouldn't fit. Some filesystems (e.g., XFS) have legacy support for things like ACLs with their own specific limitations. JFS apparently has some sort of legacy extended attributes (the OS/2 stuff that's mentioned in the patch), NTFS has very different Windows type ACLs. ACLs will start to differ from each other once additional features are implemented. Some file systems will find it easy to support additions/extensions, while others may find it more difficult or impossible. There are many examples why enforcing a common policy doesn't make a lot of sense at the moment. Note that the VFS also doesn't enforce the permission scheme filesystems implement, but only has a mechanism to test if a certain type of access is allowed. Extended attributes are not used in the kernel outside the file systems, except for kernel nfsd, which is a notorious exception from many rules anyway. > I anyway do not like the fact that EA functionality is limited for > different types of files. > If the only limitation is quata system, then we may just have a additional > mount option to support EA on any file type - this way user can select what > they want to have (strict quota or EA on special files and symbolic links). Roughly the current xattr interface is defined like this (a more detailed description is found in the attr(5) manual page): There are different namespaces. Each namespace determines the rules for accessing the xatts in this namespace; the rules are consistent inside the namespace. Currently the `user' and `system' namespaces are defined. `User' means permissions to xattrs are similar to permissions for file contents. `System' means there are specific limitations depending on the full attribute name (i.e., the rules for `system.posix_acl_*' will likely differ from `system.posix_capabilities', etc.). If you take this as the definition, Extended User Attributes (`user' namespace) make no sense for device special files, symlinks, or for sticky directories. For these, file permissions work too differently from the usual case, so the usual permissions used on UNIX systems would lead to peculiar `user.*' permissions. (Which sysadmin would expect user xattrs of /dev/null to be the cause for a full disk?) The reasoning in the attr(5) manual page is terse, because a verbose description didn't seem to make much sense there. If you want more information/discussion on this issue you are invited to ask, or contact Nathan Scott who was also involved in thinking out the rules. Cheers, Andreas. ------------------------------------------------------------------ Andreas Gruenbacher SuSE Linux AG mailto:agruen@suse.de Deutschherrnstr. 15-19 http://www.suse.de/ D-90429 Nuernberg, Germany