From owner-dev-commits-src-main@freebsd.org Sun Dec 27 22:01:55 2020 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 7BBA84C88FA; Sun, 27 Dec 2020 22:01:55 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4D3vm32xl6z3mmH; Sun, 27 Dec 2020 22:01:55 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5856666D3; Sun, 27 Dec 2020 22:01:55 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 0BRM1tek043344; Sun, 27 Dec 2020 22:01:55 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 0BRM1t8U043343; Sun, 27 Dec 2020 22:01:55 GMT (envelope-from git) Date: Sun, 27 Dec 2020 22:01:55 GMT Message-Id: <202012272201.0BRM1t8U043343@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mark Johnston Subject: git: 599f90446376 - main - msdosfs: Fix a leak of dirent padding bytes MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 599f90446376370eb365a0fde857ea2b5766873a Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: "Commit messages for the main branch of the src repository." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 27 Dec 2020 22:01:55 -0000 The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=599f90446376370eb365a0fde857ea2b5766873a commit 599f90446376370eb365a0fde857ea2b5766873a Author: Mark Johnston AuthorDate: 2020-12-27 21:52:30 +0000 Commit: Mark Johnston CommitDate: 2020-12-27 22:01:44 +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 MFC after: 3 days Sponsored by: The FreeBSD Foundation --- 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 857eefb384d9..b940633e0cfd 100644 --- a/sys/fs/msdosfs/msdosfs_vnops.c +++ b/sys/fs/msdosfs/msdosfs_vnops.c @@ -1684,6 +1684,7 @@ msdosfs_readdir(struct vop_readdir_args *ap) dirbuf.d_reclen = GENERIC_DIRSIZ(&dirbuf); /* NOTE: d_off is the offset of the *next* entry. */ dirbuf.d_off = offset + sizeof(struct direntry); + dirent_terminate(&dirbuf); if (uio->uio_resid < dirbuf.d_reclen) { brelse(bp); goto out;