Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 23 Jul 2021 11:56:41 GMT
From:      Mark Johnston <markj@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org
Subject:   git: 51095d36de44 - stable/13 - nfssvc: Zero the buffer copied out when NFSSVC_DUMPMNTOPTS is set
Message-ID:  <202107231156.16NBufx7088219@gitrepo.freebsd.org>

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

URL: https://cgit.FreeBSD.org/src/commit/?id=51095d36de449526a80da6ca859185a0107a497f

commit 51095d36de449526a80da6ca859185a0107a497f
Author:     Mark Johnston <markj@FreeBSD.org>
AuthorDate: 2021-07-16 02:39:27 +0000
Commit:     Mark Johnston <markj@FreeBSD.org>
CommitDate: 2021-07-23 11:49:31 +0000

    nfssvc: Zero the buffer copied out when NFSSVC_DUMPMNTOPTS is set
    
    Reported by:    KMSAN
    Sponsored by:   The FreeBSD Foundation
    
    (cherry picked from commit 7a9bc8a82ec20f9208643f1615ea4ca1d0e5d933)
---
 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 264d99626394..6364cce6626c 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?202107231156.16NBufx7088219>