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.

(cherry picked from commit 06afb53bcd7b6a928bc90acb820383302ea8be9e)

Details

Provenance
rmacklemAuthored on Aug 12 2021, 11:48 PM
Parents
rG5e9c2a6a9023: Apply clang fix for assertion failure compiling multimedia/minitube
Branches
Unknown
Tags
Unknown