HomeFreeBSD

nfsd: Fix sanity check for NFSv4.2 Allocate operations

Description

nfsd: Fix sanity check for NFSv4.2 Allocate operations

The NFSv4.2 Allocate operation sanity checks the aa_offset
and aa_length arguments. Since they are assigned to variables
of type off_t (signed) it was possible for them to be negative.
It was also possible for aa_offset+aa_length to exceed OFF_MAX
when stored in lo_end, which is uint64_t.

This patch adds checks for these cases to the sanity check.

Reviewed by: kib
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D31511

Details

Provenance
rmacklemAuthored on Aug 12 2021, 11:48 PM
Reviewer
kib
Differential Revision
D31511: fix sanity check for offset and length of Allocate NFSv4.2 operation
Parents
rG5ff5d1177bc6: clang: Fix inverted condition in llvm.build.mk
Branches
Unknown
Tags
Unknown