All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Aneesh Kumar K. V" <aneesh.kumar@linux.vnet.ibm.com>
To: Andreas Gruenbacher <agruen@suse.de>
Cc: sfrench@us.ibm.com, ffilz@us.ibm.com, adilger@sun.com,
	sandeen@redhat.com, tytso@mit.edu, staubach@redhat.com,
	bfields@citi.umich.edu, jlayton@redhat.com,
	linux-fsdevel@vger.kernel.org, nfsv4@linux-nfs.org,
	linux-ext4@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH -V2 00/16]  New ACL format for better NFSv4 acl interoperability
Date: Tue, 20 Jul 2010 15:01:07 +0530	[thread overview]
Message-ID: <m34ofucxes.fsf@linux.vnet.ibm.com> (raw)
In-Reply-To: <201007192119.50868.agruen@suse.de>

On Mon, 19 Jul 2010 21:19:50 +0200, Andreas Gruenbacher <agruen@suse.de> wrote:
> Aneesh,
> 
> here is a patch on top of the richacl-upstream queue.
> 
> So far, we were assuming that acls are always masked, and the file masks
> could be set so that they would not mask any permissions.  This is fine
> for permission checking, but richacl_apply_masks() didn't recognize when
> the file masks were set to mask nothing, and was still transforming such
> acls unnecessarily.  This could lead to correct but surprising results.
> 
> Instead of using a flag here we could check if the file masks are set to
> "ineffective" values, but that would require the same computation as
> richacl_compute_max_masks(), which can be a slow on large acls.  It is a
> lot easier to instead remember if the file masks are "effective".
> 
> (We still need to compute the file masks in nfsd where no file masks are
> supplied so that the file permission bits will be set to a reasonable
> value. user space will always pass valid file masks in, so we are covered
> in that side.)

We need to update ACL4_VALID_FLAGS to now consider ACL4_MASKED as a
valid flag. This is also needed for userspace. On a related note,
should we move ACL4_MASKED and ACL4_POSIX_MAPPED to be the higher
bits ? That would make sure we will be able to accomodate new flag
value NFSv4 define. Something like 

diff --git a/include/linux/richacl.h b/include/linux/richacl.h
index 929cc32..ff3c12b 100644
--- a/include/linux/richacl.h
+++ b/include/linux/richacl.h
@@ -50,16 +50,17 @@ struct richacl {
 /* a_flags values */
 #define ACL4_AUTO_INHERIT		0x01
 #define ACL4_PROTECTED			0x02
-/*#define ACL4_DEFAULTED			0x04*/
-#define ACL4_MASKED			0x08
-#define ACL4_POSIX_MAPPED		0x10
+#define ACL4_DEFAULTED			0x04
+/* flag value defined by Richacl */
+#define ACL4_MASKED			0x40
+#define ACL4_POSIX_MAPPED		0x80
 
 #define ACL4_VALID_FLAGS (	\
 	ACL4_AUTO_INHERIT |	\
 	ACL4_PROTECTED |	\
+	ACL4_MASKED |		\
 	ACL4_POSIX_MAPPED)
 
-
 /* e_type values */
 #define ACE4_ACCESS_ALLOWED_ACE_TYPE	0x0000
 #define ACE4_ACCESS_DENIED_ACE_TYPE	0x0001



-aneesh



WARNING: multiple messages have this Message-ID (diff)
From: "Aneesh Kumar K. V" <aneesh.kumar@linux.vnet.ibm.com>
To: Andreas Gruenbacher <agruen@suse.de>
Cc: sandeen@redhat.com, adilger@sun.com, tytso@mit.edu,
	jlayton@redhat.com, staubach@redhat.com, bfields@citi.umich.edu,
	nfsv4@linux-nfs.org, linux-kernel@vger.kernel.org,
	linux-fsdevel@vger.kernel.org, sfrench@us.ibm.com,
	ffilz@us.ibm.com, linux-ext4@vger.kernel.org
Subject: Re: [PATCH -V2 00/16] New ACL format for better NFSv4 acl interoperability
Date: Tue, 20 Jul 2010 15:01:07 +0530	[thread overview]
Message-ID: <m34ofucxes.fsf@linux.vnet.ibm.com> (raw)
In-Reply-To: <201007192119.50868.agruen@suse.de>

On Mon, 19 Jul 2010 21:19:50 +0200, Andreas Gruenbacher <agruen@suse.de> wrote:
> Aneesh,
> 
> here is a patch on top of the richacl-upstream queue.
> 
> So far, we were assuming that acls are always masked, and the file masks
> could be set so that they would not mask any permissions.  This is fine
> for permission checking, but richacl_apply_masks() didn't recognize when
> the file masks were set to mask nothing, and was still transforming such
> acls unnecessarily.  This could lead to correct but surprising results.
> 
> Instead of using a flag here we could check if the file masks are set to
> "ineffective" values, but that would require the same computation as
> richacl_compute_max_masks(), which can be a slow on large acls.  It is a
> lot easier to instead remember if the file masks are "effective".
> 
> (We still need to compute the file masks in nfsd where no file masks are
> supplied so that the file permission bits will be set to a reasonable
> value. user space will always pass valid file masks in, so we are covered
> in that side.)

We need to update ACL4_VALID_FLAGS to now consider ACL4_MASKED as a
valid flag. This is also needed for userspace. On a related note,
should we move ACL4_MASKED and ACL4_POSIX_MAPPED to be the higher
bits ? That would make sure we will be able to accomodate new flag
value NFSv4 define. Something like 

diff --git a/include/linux/richacl.h b/include/linux/richacl.h
index 929cc32..ff3c12b 100644
--- a/include/linux/richacl.h
+++ b/include/linux/richacl.h
@@ -50,16 +50,17 @@ struct richacl {
 /* a_flags values */
 #define ACL4_AUTO_INHERIT		0x01
 #define ACL4_PROTECTED			0x02
-/*#define ACL4_DEFAULTED			0x04*/
-#define ACL4_MASKED			0x08
-#define ACL4_POSIX_MAPPED		0x10
+#define ACL4_DEFAULTED			0x04
+/* flag value defined by Richacl */
+#define ACL4_MASKED			0x40
+#define ACL4_POSIX_MAPPED		0x80
 
 #define ACL4_VALID_FLAGS (	\
 	ACL4_AUTO_INHERIT |	\
 	ACL4_PROTECTED |	\
+	ACL4_MASKED |		\
 	ACL4_POSIX_MAPPED)
 
-
 /* e_type values */
 #define ACE4_ACCESS_ALLOWED_ACE_TYPE	0x0000
 #define ACE4_ACCESS_DENIED_ACE_TYPE	0x0001



-aneesh


_______________________________________________
NOTE: THIS LIST IS DEPRECATED.  Please use linux-nfs@vger.kernel.org instead.
(To subscribe to linux-nfs@vger.kernel.org: send "subscribe linux-nfs" in the body of a message to majordomo@vger.kernel.org.)

NFSv4 mailing list
NFSv4@linux-nfs.org
http://linux-nfs.org/cgi-bin/mailman/listinfo/nfsv4

  reply	other threads:[~2010-07-20  9:31 UTC|newest]

Thread overview: 41+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-07-02 18:43 [PATCH -V2 00/16] New ACL format for better NFSv4 acl interoperability Aneesh Kumar K.V
2010-07-02 18:43 ` [PATCH -V2 01/16] vfs: Hooks for more fine-grained directory permission checking Aneesh Kumar K.V
2010-07-02 18:43   ` Aneesh Kumar K.V
2010-07-02 18:43 ` [PATCH -V2 02/16] vfs: Add generic IS_ACL() test for acl support Aneesh Kumar K.V
2010-07-02 18:43   ` Aneesh Kumar K.V
2010-07-02 18:43 ` [PATCH -V2 03/16] vfs: Add IS_RICHACL() test for richacl support Aneesh Kumar K.V
2010-07-02 18:43   ` Aneesh Kumar K.V
2010-07-02 18:43 ` [PATCH -V2 04/16] richacl: In-memory representation and helper functions Aneesh Kumar K.V
2010-07-02 18:43   ` Aneesh Kumar K.V
2010-07-02 18:43 ` [PATCH -V2 05/16] richacl: Permission mapping functions Aneesh Kumar K.V
2010-07-02 18:43   ` Aneesh Kumar K.V
2010-07-02 18:43 ` [PATCH -V2 06/16] richacl: Compute maximum file masks from an acl Aneesh Kumar K.V
2010-07-02 18:43   ` Aneesh Kumar K.V
2010-07-02 18:43 ` [PATCH -V2 07/16] richacl: Update the file masks in chmod() Aneesh Kumar K.V
2010-07-02 18:43   ` Aneesh Kumar K.V
2010-07-02 18:43 ` [PATCH -V2 08/16] richacl: Permission check algorithm Aneesh Kumar K.V
2010-07-02 18:43   ` Aneesh Kumar K.V
2010-07-02 18:43 ` [PATCH -V2 09/16] richacl: Helper functions for implementing richacl inode operations Aneesh Kumar K.V
2010-07-02 18:43   ` Aneesh Kumar K.V
2010-07-02 18:43 ` [PATCH -V2 10/16] richacl: Create-time inheritance Aneesh Kumar K.V
2010-07-02 18:43   ` Aneesh Kumar K.V
2010-07-02 18:43 ` [PATCH -V2 11/16] richacl: Check if an acl is equivalent to a file mode Aneesh Kumar K.V
2010-07-02 18:43   ` Aneesh Kumar K.V
2010-07-02 18:43 ` [PATCH -V2 12/16] richacl: Automatic Inheritance Aneesh Kumar K.V
2010-07-02 18:43   ` Aneesh Kumar K.V
2010-07-02 18:43 ` [PATCH -V2 13/16] richacl: xattr mapping functions Aneesh Kumar K.V
2010-07-02 18:43   ` Aneesh Kumar K.V
2010-07-02 18:43 ` [PATCH -V2 14/16] ext4: Use IS_POSIXACL() to check for POSIX ACL support Aneesh Kumar K.V
2010-07-02 18:43   ` Aneesh Kumar K.V
2010-07-02 18:43 ` [PATCH -V2 15/16] ext4: Implement rich acl for ext4 Aneesh Kumar K.V
2010-07-02 18:43   ` Aneesh Kumar K.V
2010-07-02 18:43 ` [PATCH -V2 16/16] ext4: Add temporary richacl mount option " Aneesh Kumar K.V
2010-07-03 10:53   ` Aneesh Kumar K. V
2010-07-03 10:50 ` [PATCH -V2 00/16] New ACL format for better NFSv4 acl interoperability Aneesh Kumar K. V
2010-07-19 19:19 ` Andreas Gruenbacher
2010-07-20  9:31   ` Aneesh Kumar K. V [this message]
2010-07-20  9:31     ` Aneesh Kumar K. V
2010-07-20 10:11     ` Andreas Gruenbacher
2010-07-20 15:23       ` Aneesh Kumar K. V
2010-07-20 15:52         ` Andreas Gruenbacher
2010-07-20 15:52           ` Andreas Gruenbacher

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=m34ofucxes.fsf@linux.vnet.ibm.com \
    --to=aneesh.kumar@linux.vnet.ibm.com \
    --cc=adilger@sun.com \
    --cc=agruen@suse.de \
    --cc=bfields@citi.umich.edu \
    --cc=ffilz@us.ibm.com \
    --cc=jlayton@redhat.com \
    --cc=linux-ext4@vger.kernel.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=nfsv4@linux-nfs.org \
    --cc=sandeen@redhat.com \
    --cc=sfrench@us.ibm.com \
    --cc=staubach@redhat.com \
    --cc=tytso@mit.edu \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.