git: bbb5bd61b794 - stable/12 - nfssvc: Zero the buffer copied out when NFSSVC_DUMPMNTOPTS is set
Mark Johnston
markj at FreeBSD.org
Fri Jul 23 11:52:39 UTC 2021
The branch stable/12 has been updated by markj:
URL: https://cgit.FreeBSD.org/src/commit/?id=bbb5bd61b7948543178626de0e53523d3b968d92
commit bbb5bd61b7948543178626de0e53523d3b968d92
Author: Mark Johnston <markj at FreeBSD.org>
AuthorDate: 2021-07-16 02:39:27 +0000
Commit: Mark Johnston <markj at FreeBSD.org>
CommitDate: 2021-07-23 11:50:35 +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 97cde6421da2..cf6a070786d4 100644
--- a/sys/fs/nfsclient/nfs_clport.c
+++ b/sys/fs/nfsclient/nfs_clport.c
@@ -1301,7 +1301,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);
More information about the dev-commits-src-all
mailing list