From 7ab0158403f5ff36c4fc8f3133ab1b6175c91585 Mon Sep 17 00:00:00 2001 From: NeilBrown Date: Mar 20 2024 01:32:41 +0000 Subject: NFSD: change LISTXATTRS cookie encoding to big-endian (git-fixes). --- diff --git a/patches.suse/NFSD-change-LISTXATTRS-cookie-encoding-to-big-endian.patch b/patches.suse/NFSD-change-LISTXATTRS-cookie-encoding-to-big-endian.patch new file mode 100644 index 0000000..f1dee97 --- /dev/null +++ b/patches.suse/NFSD-change-LISTXATTRS-cookie-encoding-to-big-endian.patch @@ -0,0 +1,40 @@ +From: Jorge Mora +Date: Thu, 25 Jan 2024 07:46:12 -0700 +Subject: [PATCH] NFSD: change LISTXATTRS cookie encoding to big-endian +Git-commit: 61ab5e07587554d0edec318b6c99b7083967b2ec +Patch-mainline: v6.9-rc1 +References: git-fixes + +Function nfsd4_listxattr_validate_cookie() expects the cookie +as an offset to the list thus it needs to be encoded in big-endian. + +Fixes: 23e50fe3a5e6 ("nfsd: implement the xattr functions and en/decode logic") +Signed-off-by: Jorge Mora +Reviewed-by: Jeff Layton +Signed-off-by: Chuck Lever +Acked-by: NeilBrown + +--- + fs/nfsd/nfs4xdr.c | 4 +++- + 1 file changed, 3 insertions(+), 1 deletion(-) + +--- a/fs/nfsd/nfs4xdr.c ++++ b/fs/nfsd/nfs4xdr.c +@@ -5052,6 +5052,7 @@ nfsd4_encode_listxattrs(struct nfsd4_com + u64 cookie; + char *sp; + __be32 status, tmp; ++ __be64 wire_cookie; + __be32 *p; + u32 nuser; + +@@ -5143,7 +5144,8 @@ wreof: + + cookie = offset + count; + +- write_bytes_to_xdr_buf(xdr->buf, cookie_offset, &cookie, 8); ++ wire_cookie = cpu_to_be64(cookie); ++ write_bytes_to_xdr_buf(xdr->buf, cookie_offset, &wire_cookie, 8); + tmp = cpu_to_be32(count); + write_bytes_to_xdr_buf(xdr->buf, count_offset, &tmp, 4); + out: diff --git a/series.conf b/series.conf index 2f28bec..501d063 100644 --- a/series.conf +++ b/series.conf @@ -45589,6 +45589,7 @@ patches.suse/SUNRPC-fix-a-memleak-in-gss_import_v2_context.patch patches.suse/SUNRPC-fix-some-memleaks-in-gssx_dec_option_array.patch patches.suse/NFSD-fix-nfsd4_listxattr_validate_cookie.patch + patches.suse/NFSD-change-LISTXATTRS-cookie-encoding-to-big-endian.patch patches.suse/doc-guide-kernel-doc-tell-about-object-like-macros.patch patches.suse/wifi-b43-Stop-wake-correct-queue-in-DMA-Tx-path-when.patch patches.suse/wifi-b43-Stop-wake-correct-queue-in-PIO-Tx-path-when.patch