···234234 return ret;235235}236236237237+/*238238+ * We require the high 32 bits of 'seconds' to be 0, and239239+ * we ignore all 32 bits of 'nseconds'.240240+ */241241+static __be32242242+nfsd4_decode_time(struct nfsd4_compoundargs *argp, struct timespec *tv)243243+{244244+ DECODE_HEAD;245245+ u64 sec;246246+247247+ READ_BUF(12);248248+ p = xdr_decode_hyper(p, &sec);249249+ tv->tv_sec = sec;250250+ tv->tv_nsec = be32_to_cpup(p++);251251+ if (tv->tv_nsec >= (u32)1000000000)252252+ return nfserr_inval;253253+254254+ DECODE_TAIL;255255+}256256+237257static __be32238258nfsd4_decode_bitmap(struct nfsd4_compoundargs *argp, u32 *bmval)239259{···287267{288268 int expected_len, len = 0;289269 u32 dummy32;290290- u64 sec;291270 char *buf;292271293272 DECODE_HEAD;···377358 dummy32 = be32_to_cpup(p++);378359 switch (dummy32) {379360 case NFS4_SET_TO_CLIENT_TIME:380380- /* We require the high 32 bits of 'seconds' to be 0, and we ignore381381- all 32 bits of 'nseconds'. */382382- READ_BUF(12);383361 len += 12;384384- p = xdr_decode_hyper(p, &sec);385385- iattr->ia_atime.tv_sec = (time_t)sec;386386- iattr->ia_atime.tv_nsec = be32_to_cpup(p++);387387- if (iattr->ia_atime.tv_nsec >= (u32)1000000000)388388- return nfserr_inval;362362+ status = nfsd4_decode_time(argp, &iattr->ia_atime);363363+ if (status)364364+ return status;389365 iattr->ia_valid |= (ATTR_ATIME | ATTR_ATIME_SET);390366 break;391367 case NFS4_SET_TO_SERVER_TIME:···396382 dummy32 = be32_to_cpup(p++);397383 switch (dummy32) {398384 case NFS4_SET_TO_CLIENT_TIME:399399- /* We require the high 32 bits of 'seconds' to be 0, and we ignore400400- all 32 bits of 'nseconds'. */401401- READ_BUF(12);402385 len += 12;403403- p = xdr_decode_hyper(p, &sec);404404- iattr->ia_mtime.tv_sec = sec;405405- iattr->ia_mtime.tv_nsec = be32_to_cpup(p++);406406- if (iattr->ia_mtime.tv_nsec >= (u32)1000000000)407407- return nfserr_inval;386386+ status = nfsd4_decode_time(argp, &iattr->ia_mtime);387387+ if (status)388388+ return status;408389 iattr->ia_valid |= (ATTR_MTIME | ATTR_MTIME_SET);409390 break;410391 case NFS4_SET_TO_SERVER_TIME: