HomeFreeBSD

nfsd: Limit parsing of layout errors to maxcnt bytes

Description

nfsd: Limit parsing of layout errors to maxcnt bytes

This patch decrements maxcnt by the appropriate
number of bytes during parsing and checks to see
if there is data remaining. If not, it just returns
from nfsrv_flexlayouterr() without further processing.
This prevents the tl pointer from running off the end
of the error data pointed at by layp, if there are
flaws in the data.

Reported by: rtm@lcs.mit.edu
Tested by: rtm@lcs.mit.edu
PR: 260293
MFC after: 2 weeks

Details

Provenance
rmacklemAuthored on Dec 13 2021, 11:21 PM
Parents
rGe448ff6f0e80: rc: network.subr improve network6_getladdr()
Branches
Unknown
Tags
Unknown