From: Chuck Lever Date: Thu, 19 Nov 2020 18:54:26 +0000 (-0500) Subject: NFSD: Replace READ* macros that decode the fattr4 mode attribute X-Git-Tag: accepted/tizen/unified/20230118.172025~8293^2~90 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=1c8f0ad7dd35fd12307904036c7c839f77b6e3f9;p=platform%2Fkernel%2Flinux-rpi.git NFSD: Replace READ* macros that decode the fattr4 mode attribute Signed-off-by: Chuck Lever --- diff --git a/fs/nfsd/nfs4xdr.c b/fs/nfsd/nfs4xdr.c index ac2f259..e6c3b67 100644 --- a/fs/nfsd/nfs4xdr.c +++ b/fs/nfsd/nfs4xdr.c @@ -351,8 +351,11 @@ nfsd4_decode_fattr(struct nfsd4_compoundargs *argp, u32 *bmval, } else *acl = NULL; if (bmval[1] & FATTR4_WORD1_MODE) { - READ_BUF(4); - iattr->ia_mode = be32_to_cpup(p++); + u32 mode; + + if (xdr_stream_decode_u32(argp->xdr, &mode) < 0) + return nfserr_bad_xdr; + iattr->ia_mode = mode; iattr->ia_mode &= (S_IFMT | S_IALLUGO); iattr->ia_valid |= ATTR_MODE; }