diff options
author | Jorge Mora <jmora1300@gmail.com> | 2024-01-25 07:46:12 -0700 |
---|---|---|
committer | Chuck Lever <chuck.lever@oracle.com> | 2024-03-01 09:12:06 -0500 |
commit | 61ab5e07587554d0edec318b6c99b7083967b2ec (patch) | |
tree | ef3326e90ed3c58264850c0567c63d66d841cac8 /fs/nfsd/nfs4xdr.c | |
parent | 52a357db8074e18aa51085a8c8d8af7057dffa11 (diff) | |
download | linux-stable-61ab5e07587554d0edec318b6c99b7083967b2ec.tar.gz linux-stable-61ab5e07587554d0edec318b6c99b7083967b2ec.tar.bz2 linux-stable-61ab5e07587554d0edec318b6c99b7083967b2ec.zip |
NFSD: change LISTXATTRS cookie encoding to big-endian
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 <mora@netapp.com>
Reviewed-by: Jeff Layton <jlayton@kernel.org>
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
Diffstat (limited to 'fs/nfsd/nfs4xdr.c')
-rw-r--r-- | fs/nfsd/nfs4xdr.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/fs/nfsd/nfs4xdr.c b/fs/nfsd/nfs4xdr.c index f0be0d6fe63f..5649076df4b4 100644 --- a/fs/nfsd/nfs4xdr.c +++ b/fs/nfsd/nfs4xdr.c @@ -5407,6 +5407,7 @@ nfsd4_encode_listxattrs(struct nfsd4_compoundres *resp, __be32 nfserr, u64 cookie; char *sp; __be32 status, tmp; + __be64 wire_cookie; __be32 *p; u32 nuser; @@ -5498,7 +5499,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: |