Skip to content

Commit

Permalink
Merge tag 'nfsd-5.16-1' of git://linux-nfs.org/~bfields/linux
Browse files Browse the repository at this point in the history
Pull nfsd bugfix from Bruce Fields:
 "This is just one bugfix for a buffer overflow in knfsd's xdr decoding"

* tag 'nfsd-5.16-1' of git://linux-nfs.org/~bfields/linux:
  NFSD: Fix exposure in nfsd4_decode_bitmap()
  • Loading branch information
Linus Torvalds committed Nov 17, 2021
2 parents 8ab7745 + c0019b7 commit ef1d8dd
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions fs/nfsd/nfs4xdr.c
Original file line number Diff line number Diff line change
Expand Up @@ -288,11 +288,8 @@ nfsd4_decode_bitmap4(struct nfsd4_compoundargs *argp, u32 *bmval, u32 bmlen)
p = xdr_inline_decode(argp->xdr, count << 2);
if (!p)
return nfserr_bad_xdr;
i = 0;
while (i < count)
bmval[i++] = be32_to_cpup(p++);
while (i < bmlen)
bmval[i++] = 0;
for (i = 0; i < bmlen; i++)
bmval[i] = (i < count) ? be32_to_cpup(p++) : 0;

return nfs_ok;
}
Expand Down

0 comments on commit ef1d8dd

Please sign in to comment.