Skip to contentSkip to conversation

Patch "nfsd: Fix up the "supattr_exclcreat" attributes" has been added to the 4.4-stable tree

PATCH In review [email protected] 2 participants 5 messages May 23, 2017 – Jun 12, 2017

Subsystems (3)
lore
Share & tools
lore

[email protected]

author maintainer Applied
#0 lore raw

This is a note to let you know that I've just added the patch titled

nfsd: Fix up the "supattr_exclcreat" attributes

to the 4.4-stable tree which can be found at:
http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
nfsd-fix-up-the-supattr_exclcreat-attributes.patch
and it can be found in the queue-4.4 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree, please let <[email protected]> know about it.

Quoted 1 line

From b26b78cb726007533d81fdf90a62e915002ef5c8 Mon Sep 17 00:00:00 2001

From: Trond Myklebust <[email protected]>
Date: Tue, 9 May 2017 16:24:59 -0400
Subject: nfsd: Fix up the "supattr_exclcreat" attributes

From: Trond Myklebust <[email protected]>

commit b26b78cb726007533d81fdf90a62e915002ef5c8 upstream.

If an NFSv4 client asks us for the supattr_exclcreat, then we must not return attributes that are unsupported by this minor version.

Fixes 75976de6556f ("NFSD: Return word2 bitmask if setting security..,")
---
 fs/nfsd/nfs4xdr.c |   11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)
fs/nfsd/nfs4xdr.c +8 -3
@@ -2753,9 +2753,14 @@ out_acl:
 	}
 #endif /* CONFIG_NFSD_PNFS */
 	if (bmval2 & FATTR4_WORD2_SUPPATTR_EXCLCREAT) {
-		status = nfsd4_encode_bitmap(xdr, NFSD_SUPPATTR_EXCLCREAT_WORD0,
-						  NFSD_SUPPATTR_EXCLCREAT_WORD1,
-						  NFSD_SUPPATTR_EXCLCREAT_WORD2);
+		u32 supp[3];
+
+		memcpy(supp, nfsd_suppattrs[minorversion], sizeof(supp));
+		supp[0] &= NFSD_SUPPATTR_EXCLCREAT_WORD0;
+		supp[1] &= NFSD_SUPPATTR_EXCLCREAT_WORD1;
+		supp[2] &= NFSD_SUPPATTR_EXCLCREAT_WORD2;
+
+		status = nfsd4_encode_bitmap(xdr, supp[0], supp[1], supp[2]);
 		if (status)
 			goto out;
 	}

Patches currently in stable-queue which might be from [email protected] are

queue-4.4/nfsd-fix-up-the-supattr_exclcreat-attributes.patch

author maintainer
#1 lore raw

Oops, nope, this breaks the build on 4.4, can someone please provide a working backport as it is "supposed" to be added to that kernel...

thanks,

greg k-h

Quoted 62 lines · On Tue, May 23, 2017 at 08:37:32PM +0200, [email protected] wrote:

This is a note to let you know that I've just added the patch titled

nfsd: Fix up the "supattr_exclcreat" attributes

to the 4.4-stable tree which can be found at:
http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
nfsd-fix-up-the-supattr_exclcreat-attributes.patch
and it can be found in the queue-4.4 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree, please let <[email protected]> know about it.

Quoted 1 line

From b26b78cb726007533d81fdf90a62e915002ef5c8 Mon Sep 17 00:00:00 2001

From: Trond Myklebust <[email protected]>
Date: Tue, 9 May 2017 16:24:59 -0400
Subject: nfsd: Fix up the "supattr_exclcreat" attributes

From: Trond Myklebust <[email protected]>

commit b26b78cb726007533d81fdf90a62e915002ef5c8 upstream.

If an NFSv4 client asks us for the supattr_exclcreat, then we must not return attributes that are unsupported by this minor version.

Fixes 75976de6556f ("NFSD: Return word2 bitmask if setting security..,")
---
 fs/nfsd/nfs4xdr.c |   11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)
fs/nfsd/nfs4xdr.c +8 -3
@@ -2753,9 +2753,14 @@ out_acl:
 	}
 #endif /* CONFIG_NFSD_PNFS */
 	if (bmval2 & FATTR4_WORD2_SUPPATTR_EXCLCREAT) {
-		status = nfsd4_encode_bitmap(xdr, NFSD_SUPPATTR_EXCLCREAT_WORD0,
-						  NFSD_SUPPATTR_EXCLCREAT_WORD1,
-						  NFSD_SUPPATTR_EXCLCREAT_WORD2);
+		u32 supp[3];
+
+		memcpy(supp, nfsd_suppattrs[minorversion], sizeof(supp));
+		supp[0] &= NFSD_SUPPATTR_EXCLCREAT_WORD0;
+		supp[1] &= NFSD_SUPPATTR_EXCLCREAT_WORD1;
+		supp[2] &= NFSD_SUPPATTR_EXCLCREAT_WORD2;
+
+		status = nfsd4_encode_bitmap(xdr, supp[0], supp[1], supp[2]);
 		if (status)
 			goto out;
 	}

Patches currently in stable-queue which might be from [email protected] are

queue-4.4/nfsd-fix-up-the-supattr_exclcreat-attributes.patch

#2 lore raw
Quoted 2 lines · Greg KH

Oops, nope, this breaks the build on 4.4, can someone please provide a working backport as it is "supposed" to be added to that kernel...

The issue is

916d2d844afd "nfsd: clean up supported attribute handling" dcd208697707 "nfsd: fix supported attributes for acl & labels"

which replaced 3 numbered constants by an array, and went in between 4.8 and 4.10.

But for the purposes of older stable branches, best is probably just to use the old constants. I'll send an updated patch.

--b.

Quoted 68 lines

thanks,

greg k-h

Quoted 62 lines · On Tue, May 23, 2017 at 08:37:32PM +0200, [email protected] wrote:

This is a note to let you know that I've just added the patch titled

nfsd: Fix up the "supattr_exclcreat" attributes

to the 4.4-stable tree which can be found at:
http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
nfsd-fix-up-the-supattr_exclcreat-attributes.patch
and it can be found in the queue-4.4 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree, please let <[email protected]> know about it.

Quoted 1 line

From b26b78cb726007533d81fdf90a62e915002ef5c8 Mon Sep 17 00:00:00 2001

From: Trond Myklebust <[email protected]>
Date: Tue, 9 May 2017 16:24:59 -0400
Subject: nfsd: Fix up the "supattr_exclcreat" attributes

From: Trond Myklebust <[email protected]>

commit b26b78cb726007533d81fdf90a62e915002ef5c8 upstream.

If an NFSv4 client asks us for the supattr_exclcreat, then we must not return attributes that are unsupported by this minor version.

Fixes 75976de6556f ("NFSD: Return word2 bitmask if setting security..,")
---
 fs/nfsd/nfs4xdr.c |   11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)
fs/nfsd/nfs4xdr.c +8 -3
@@ -2753,9 +2753,14 @@ out_acl:
 	}
 #endif /* CONFIG_NFSD_PNFS */
 	if (bmval2 & FATTR4_WORD2_SUPPATTR_EXCLCREAT) {
-		status = nfsd4_encode_bitmap(xdr, NFSD_SUPPATTR_EXCLCREAT_WORD0,
-						  NFSD_SUPPATTR_EXCLCREAT_WORD1,
-						  NFSD_SUPPATTR_EXCLCREAT_WORD2);
+		u32 supp[3];
+
+		memcpy(supp, nfsd_suppattrs[minorversion], sizeof(supp));
+		supp[0] &= NFSD_SUPPATTR_EXCLCREAT_WORD0;
+		supp[1] &= NFSD_SUPPATTR_EXCLCREAT_WORD1;
+		supp[2] &= NFSD_SUPPATTR_EXCLCREAT_WORD2;
+
+		status = nfsd4_encode_bitmap(xdr, supp[0], supp[1], supp[2]);
 		if (status)
 			goto out;
 	}

Patches currently in stable-queue which might be from [email protected] are

queue-4.4/nfsd-fix-up-the-supattr_exclcreat-attributes.patch

#3 lore raw

PATCH 1/1 nfsd: Fix up the "supattr_exclcreat" attributes

From: Trond Myklebust <[email protected]>

commit b26b78cb726007533d81fdf90a62e915002ef5c8 upstream

If an NFSv4 client asks us for the supattr_exclcreat, then we must not return attributes that are unsupported by this minor version.

Fixes 75976de6556f ("NFSD: Return word2 bitmask if setting security..,")
[bfields: use old functions instead of new array in stable backport]
---
 fs/nfsd/nfs4xdr.c | 13 ++++++++++---
 1 file changed, 10 insertions(+), 3 deletions(-)
Quoted 10 lines · J. Bruce Fields

The issue is

916d2d844afd "nfsd: clean up supported attribute handling" dcd208697707 "nfsd: fix supported attributes for acl & labels"

which replaced 3 numbered constants by an array, and went in between 4.8 and 4.10.

But for the purposes of older stable branches, best is probably just to use the old constants. I'll send an updated patch.

Here it is. This should do for 4.9 and older stable branches.

fs/nfsd/nfs4xdr.c +10 -3
index 12935209deca..37d30e5caf46 100644
@@ -2753,9 +2753,16 @@ out_acl:
 	}
 #endif /* CONFIG_NFSD_PNFS */
 	if (bmval2 & FATTR4_WORD2_SUPPATTR_EXCLCREAT) {
-		status = nfsd4_encode_bitmap(xdr, NFSD_SUPPATTR_EXCLCREAT_WORD0,
-						  NFSD_SUPPATTR_EXCLCREAT_WORD1,
-						  NFSD_SUPPATTR_EXCLCREAT_WORD2);
+		u32 supp[3];
+
+		supp[0] = nfsd_suppattrs0(minorversion);
+		supp[1] = nfsd_suppattrs1(minorversion);
+		supp[2] = nfsd_suppattrs2(minorversion);
+		supp[0] &= NFSD_SUPPATTR_EXCLCREAT_WORD0;
+		supp[1] &= NFSD_SUPPATTR_EXCLCREAT_WORD1;
+		supp[2] &= NFSD_SUPPATTR_EXCLCREAT_WORD2;
+
+		status = nfsd4_encode_bitmap(xdr, supp[0], supp[1], supp[2]);
 		if (status)
 			goto out;
 	}
Signature · 1 line
2.9.3
author maintainer
#4 lore raw

Re: [PATCH] nfsd: Fix up the "supattr_exclcreat" attributes

Quoted 21 lines · J. Bruce Fields

From: Trond Myklebust <[email protected]>

commit b26b78cb726007533d81fdf90a62e915002ef5c8 upstream

If an NFSv4 client asks us for the supattr_exclcreat, then we must not return attributes that are unsupported by this minor version.

Fixes 75976de6556f ("NFSD: Return word2 bitmask if setting security..,")
[bfields: use old functions instead of new array in stable backport]
---
 fs/nfsd/nfs4xdr.c | 13 ++++++++++---
 1 file changed, 10 insertions(+), 3 deletions(-)
Quoted 5 lines · J. Bruce Fields

The issue is

916d2d844afd "nfsd: clean up supported attribute handling" dcd208697707 "nfsd: fix supported attributes for acl & labels"

Quoted 7 lines
Quoted 5 lines

which replaced 3 numbered constants by an array, and went in between 4.8 and 4.10.

But for the purposes of older stable branches, best is probably just to use the old constants. I'll send an updated patch.

Here it is. This should do for 4.9 and older stable branches.

Thanks, now queued up.

greg k-h