Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 29 Jan 2021 00:18:46 GMT
From:      Ed Maste <emaste@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org
Subject:   git: 41e1fe830083 - releng/11.4 - msdosfs: Fix a leak of dirent padding bytes
Message-ID:  <202101290018.10T0Iks8079593@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch releng/11.4 has been updated by emaste:

URL: https://cgit.FreeBSD.org/src/commit/?id=41e1fe830083ea1d6ac1441dc193c99648f1ce93

commit 41e1fe830083ea1d6ac1441dc193c99648f1ce93
Author:     Mark Johnston <markj@FreeBSD.org>
AuthorDate: 2020-12-27 21:52:30 +0000
Commit:     Ed Maste <emaste@FreeBSD.org>
CommitDate: 2021-01-29 00:07:15 +0000

    msdosfs: Fix a leak of dirent padding bytes
    
    This was missed in r340856 / commit
    6d2e2df764199f0a15fd743e79599391959cc17d.  Three bytes from the kernel
    stack may be leaked when reading directory entries.
    
    Reported by:    Syed Faraz Abrar <faraz@elttam.com>
    Sponsored by:   The FreeBSD Foundation
    
    (cherry picked from commit 599f90446376370eb365a0fde857ea2b5766873a)
    (cherry picked from commit 6d0a2f9d2ffce3d94c9a523d7779f791355d3677)
    
    Approved by:    so
    Security:       CVE-2020-25579
---
 sys/fs/msdosfs/msdosfs_vnops.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/sys/fs/msdosfs/msdosfs_vnops.c b/sys/fs/msdosfs/msdosfs_vnops.c
index d8274f66635b..e747e47fecb5 100644
--- a/sys/fs/msdosfs/msdosfs_vnops.c
+++ b/sys/fs/msdosfs/msdosfs_vnops.c
@@ -1701,6 +1701,7 @@ msdosfs_readdir(struct vop_readdir_args *ap)
 				mbnambuf_flush(&nb, &dirbuf);
 			chksum = -1;
 			dirbuf.d_reclen = GENERIC_DIRSIZ(&dirbuf);
+			dirent_terminate(&dirbuf);
 			if (uio->uio_resid < dirbuf.d_reclen) {
 				brelse(bp);
 				goto out;



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