linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] tmpfs: Fix simple_set_acl()
@ 2014-04-22 22:08 Chuck Lever
  2014-05-04 12:42 ` J. Bruce Fields
  0 siblings, 1 reply; 4+ messages in thread
From: Chuck Lever @ 2014-04-22 22:08 UTC (permalink / raw)
  To: linux-fsdevel

Ben Greear <greearb@candelatech.com> reports that NFSD panics in
posix_acl_equiv_mode() during an NFSv3 SETACL operation. I have
reproduced this using an exported tmpfs and cthon04 with NFSv3.

A survey of .set_acl methods suggests that simple_set_acl() must
tolerate a NULL "acl" argument.

Fixes: feda821e76f3bbbba4bd54d30b4d4005a7848aa5
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
---

 fs/posix_acl.c |   12 +++++++-----
 1 files changed, 7 insertions(+), 5 deletions(-)

diff --git a/fs/posix_acl.c b/fs/posix_acl.c
index 9e363e4..0b25aae 100644
--- a/fs/posix_acl.c
+++ b/fs/posix_acl.c
@@ -863,11 +863,13 @@ int simple_set_acl(struct inode *inode, struct posix_acl *acl, int type)
 	int error;
 
 	if (type == ACL_TYPE_ACCESS) {
-		error = posix_acl_equiv_mode(acl, &inode->i_mode);
-		if (error < 0)
-			return 0;
-		if (error == 0)
-			acl = NULL;
+		if (acl) {
+			error = posix_acl_equiv_mode(acl, &inode->i_mode);
+			if (error < 0)
+				return 0;
+			if (error == 0)
+				acl = NULL;
+		}
 	}
 
 	inode->i_ctime = CURRENT_TIME;


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] tmpfs: Fix simple_set_acl()
  2014-04-22 22:08 [PATCH] tmpfs: Fix simple_set_acl() Chuck Lever
@ 2014-05-04 12:42 ` J. Bruce Fields
  2014-05-04 19:08   ` Chuck Lever
  0 siblings, 1 reply; 4+ messages in thread
From: J. Bruce Fields @ 2014-05-04 12:42 UTC (permalink / raw)
  To: Chuck Lever; +Cc: linux-fsdevel

This doesn't seem upstream--whose job is it to pick this up?

Maybe you could resend directly To: linus?

--b.

On Tue, Apr 22, 2014 at 06:08:51PM -0400, Chuck Lever wrote:
> Ben Greear <greearb@candelatech.com> reports that NFSD panics in
> posix_acl_equiv_mode() during an NFSv3 SETACL operation. I have
> reproduced this using an exported tmpfs and cthon04 with NFSv3.
> 
> A survey of .set_acl methods suggests that simple_set_acl() must
> tolerate a NULL "acl" argument.
> 
> Fixes: feda821e76f3bbbba4bd54d30b4d4005a7848aa5
> Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
> ---
> 
>  fs/posix_acl.c |   12 +++++++-----
>  1 files changed, 7 insertions(+), 5 deletions(-)
> 
> diff --git a/fs/posix_acl.c b/fs/posix_acl.c
> index 9e363e4..0b25aae 100644
> --- a/fs/posix_acl.c
> +++ b/fs/posix_acl.c
> @@ -863,11 +863,13 @@ int simple_set_acl(struct inode *inode, struct posix_acl *acl, int type)
>  	int error;
>  
>  	if (type == ACL_TYPE_ACCESS) {
> -		error = posix_acl_equiv_mode(acl, &inode->i_mode);
> -		if (error < 0)
> -			return 0;
> -		if (error == 0)
> -			acl = NULL;
> +		if (acl) {
> +			error = posix_acl_equiv_mode(acl, &inode->i_mode);
> +			if (error < 0)
> +				return 0;
> +			if (error == 0)
> +				acl = NULL;
> +		}
>  	}
>  
>  	inode->i_ctime = CURRENT_TIME;
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] tmpfs: Fix simple_set_acl()
  2014-05-04 12:42 ` J. Bruce Fields
@ 2014-05-04 19:08   ` Chuck Lever
  2014-05-05 14:29     ` J.;Bruce Fields
  0 siblings, 1 reply; 4+ messages in thread
From: Chuck Lever @ 2014-05-04 19:08 UTC (permalink / raw)
  To: J.;Bruce Fields; +Cc: linux-fsdevel

Hi Bruce-

On May 4, 2014, at 8:42 AM, J. Bruce Fields <bfields@fieldses.org> wrote:

> This doesn't seem upstream--whose job is it to pick this up?
> 
> Maybe you could resend directly To: linus?

Thanks for following up.

There was some discussion about it this week because the same issue
arose for jfs as well.

Christoph has a broader solution: simply check for acl == NULL in
posix_acl_equiv_mode(). The plan is then to remove that check from
filesystem-specific .set_acl methods.

He posted a patch this morning, so I'm going to let him run this
to ground.

> --b.
> 
> On Tue, Apr 22, 2014 at 06:08:51PM -0400, Chuck Lever wrote:
>> Ben Greear <greearb@candelatech.com> reports that NFSD panics in
>> posix_acl_equiv_mode() during an NFSv3 SETACL operation. I have
>> reproduced this using an exported tmpfs and cthon04 with NFSv3.
>> 
>> A survey of .set_acl methods suggests that simple_set_acl() must
>> tolerate a NULL "acl" argument.
>> 
>> Fixes: feda821e76f3bbbba4bd54d30b4d4005a7848aa5
>> Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
>> ---
>> 
>> fs/posix_acl.c |   12 +++++++-----
>> 1 files changed, 7 insertions(+), 5 deletions(-)
>> 
>> diff --git a/fs/posix_acl.c b/fs/posix_acl.c
>> index 9e363e4..0b25aae 100644
>> --- a/fs/posix_acl.c
>> +++ b/fs/posix_acl.c
>> @@ -863,11 +863,13 @@ int simple_set_acl(struct inode *inode, struct posix_acl *acl, int type)
>> 	int error;
>> 
>> 	if (type == ACL_TYPE_ACCESS) {
>> -		error = posix_acl_equiv_mode(acl, &inode->i_mode);
>> -		if (error < 0)
>> -			return 0;
>> -		if (error == 0)
>> -			acl = NULL;
>> +		if (acl) {
>> +			error = posix_acl_equiv_mode(acl, &inode->i_mode);
>> +			if (error < 0)
>> +				return 0;
>> +			if (error == 0)
>> +				acl = NULL;
>> +		}
>> 	}
>> 
>> 	inode->i_ctime = CURRENT_TIME;
>> 
>> --
>> To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" in
>> the body of a message to majordomo@vger.kernel.org
>> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> --
> To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

-- 
Chuck Lever
chuck[dot]lever[at]oracle[dot]com





^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] tmpfs: Fix simple_set_acl()
  2014-05-04 19:08   ` Chuck Lever
@ 2014-05-05 14:29     ` J.;Bruce Fields
  0 siblings, 0 replies; 4+ messages in thread
From: J.;Bruce Fields @ 2014-05-05 14:29 UTC (permalink / raw)
  To: Chuck Lever; +Cc: linux-fsdevel

On Sun, May 04, 2014 at 03:08:17PM -0400, Chuck Lever wrote:
> Hi Bruce-
> 
> On May 4, 2014, at 8:42 AM, J. Bruce Fields <bfields@fieldses.org> wrote:
> 
> > This doesn't seem upstream--whose job is it to pick this up?
> > 
> > Maybe you could resend directly To: linus?
> 
> Thanks for following up.
> 
> There was some discussion about it this week because the same issue
> arose for jfs as well.
> 
> Christoph has a broader solution: simply check for acl == NULL in
> posix_acl_equiv_mode(). The plan is then to remove that check from
> filesystem-specific .set_acl methods.
> 
> He posted a patch this morning, so I'm going to let him run this
> to ground.

OK, thanks.--b.

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2014-05-05 14:29 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-04-22 22:08 [PATCH] tmpfs: Fix simple_set_acl() Chuck Lever
2014-05-04 12:42 ` J. Bruce Fields
2014-05-04 19:08   ` Chuck Lever
2014-05-05 14:29     ` J.;Bruce Fields

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).