HomeFreeBSD

MFC: r360032

Description

MFC: r360032
Add a sanity check for nes_numsecflavor to the NFS server.

Ryan Moeller reported crashes in the NFS server that appear to be
caused by stack corruption in nfsrv_compound(). It appears that
the stack got corrupted just after a NFSv4.1 Lookup that crosses
a server mount point.
Although it is just a "theory" at this point, the most obvious way
the stack could get corrupted would be if nfsvno_checkexp() somehow
acquires an export with a bogus nes_numsecflavor value. This would
cause the copying of the secflavors to run off the end of the array,
which is allocated on the stack below where the corruption occurs.

This sanity check is simple to do and would stop the stack corruption
if the theory is correct. Otherwise, doing the sanity check seems to
be a reasonable safety belt to add to the code.

Details

Provenance
rmacklemAuthored on
Parents
rS360554: Use the HSM SBI extension to halt CPUs
Branches
Unknown
Tags
Unknown