nfssvc: Zero the buffer copied out when NFSSVC_DUMPMNTOPTS is set

Reported by:	KMSAN
MFC after:	1 week
Sponsored by:	The FreeBSD Foundation
This commit is contained in:
Mark Johnston 2021-07-15 22:39:27 -04:00
parent 2e5f615295
commit 7a9bc8a82e

View File

@ -1312,7 +1312,8 @@ nfssvc_nfscl(struct thread *td, struct nfssvc_args *uap)
error = EINVAL;
}
if (error == 0) {
buf = malloc(dumpmntopts.ndmnt_blen, M_TEMP, M_WAITOK);
buf = malloc(dumpmntopts.ndmnt_blen, M_TEMP, M_WAITOK |
M_ZERO);
nfscl_retopts(VFSTONFS(nd.ni_vp->v_mount), buf,
dumpmntopts.ndmnt_blen);
vput(nd.ni_vp);