Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 16 Jul 2021 02:42:30 GMT
From:      Mark Johnston <markj@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org
Subject:   git: 7a9bc8a82ec2 - main - nfssvc: Zero the buffer copied out when NFSSVC_DUMPMNTOPTS is set
Message-ID:  <202107160242.16G2gU2L080556@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch main has been updated by markj:

URL: https://cgit.FreeBSD.org/src/commit/?id=7a9bc8a82ec20f9208643f1615ea4ca1d0e5d933

commit 7a9bc8a82ec20f9208643f1615ea4ca1d0e5d933
Author:     Mark Johnston <markj@FreeBSD.org>
AuthorDate: 2021-07-16 02:39:27 +0000
Commit:     Mark Johnston <markj@FreeBSD.org>
CommitDate: 2021-07-16 02:41:10 +0000

    nfssvc: Zero the buffer copied out when NFSSVC_DUMPMNTOPTS is set
    
    Reported by:    KMSAN
    MFC after:      1 week
    Sponsored by:   The FreeBSD Foundation
---
 sys/fs/nfsclient/nfs_clport.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/sys/fs/nfsclient/nfs_clport.c b/sys/fs/nfsclient/nfs_clport.c
index 90d403334155..5c79e3ac6960 100644
--- a/sys/fs/nfsclient/nfs_clport.c
+++ b/sys/fs/nfsclient/nfs_clport.c
@@ -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);



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202107160242.16G2gU2L080556>