From nobody Thu Sep 08 00:19:16 2022 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4MNKVr5Mytz4bXHF; Thu, 8 Sep 2022 00:19:16 +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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4MNKVr4sWxz3pXB; Thu, 8 Sep 2022 00:19:16 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1662596356; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=bituk7gIQumYTGiVDyf8PwzcaIU/5CNljjYCZY5WsPk=; b=fdxGJC68to5/jXUrM/ghC7e6w9Jts3bb2vbxhiTg3Gt7MRIQnvP5zlK9/rO5ZMbuw4oZIZ VSKV5vbftOKBdGkzewMbyYkDOaI3PA68gdgnDAiQjhUJbLvzZeU7PaPbO55QOiXVqABe6v jw2rxrVo6CN2Nzax8e77NB6lHVfVJqRGYF63BRV0XD9hTLr5E2FNY+R/qRt33WUOCmZLyW 2qexN0xfj6zbyHOHLPYZOQEc2S2sY9jWavYOOONbaqC/xJqGyOv7rPeX/zsc7xXgNEJuQA Ugi163qJAdx7JqraWLCoc0wXLaaTfvP6l68xD8FB2F9nqGhPvtZjm1CT6n4qQA== 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 4MNKVr3w6Yzhrp; Thu, 8 Sep 2022 00:19:16 +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 2880JGjw080006; Thu, 8 Sep 2022 00:19:16 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 2880JGvt080005; Thu, 8 Sep 2022 00:19:16 GMT (envelope-from git) Date: Thu, 8 Sep 2022 00:19:16 GMT Message-Id: <202209080019.2880JGvt080005@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Michael Gmelin Subject: git: 0eb736c0f673 - main - stand: Unbreak FAT32 in loader List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: grembo X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 0eb736c0f673d2804a0c8c14fa1e4eae228ab6d2 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1662596356; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=bituk7gIQumYTGiVDyf8PwzcaIU/5CNljjYCZY5WsPk=; b=mlt9yqxItfs1JEmU4eNeQ6pYG8g61TWWt3kTkBkvKHwH74eRwnnRVgUk+jvnNRecKs1Tc9 cpYTOsagdY5ckftsVfeYZb4FYfBlOE+ODnUUg+CPzG7SP5Pvn4xLe57mTMHl7Ig4ZlgSHh EP6U4z5qlQ48Ksw2+LgA02vdXatXgKg/iRu89eKOfYZ7pquoQ8pDCAwT5HYmPLIBUg1UFq E5IZ8tNEmvDlfE8cHK8BX8xw0PKQCYvWBdvfBnGYdVloBtzGi44VGfLHohZiLRxRtNCTlj 1hxFS7iVNJPtl5ncWHRWP14P+SnpZy2WMaoDgSI/2BsCuJ847PonmHjXcQArDw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1662596356; a=rsa-sha256; cv=none; b=QYCTs8GSffHSp542ki/MlPcWB+3njLzzq9R2SU9WEMbsWPgJ/POsEMhSfi3UDc5siepFlh QSL30E1dH7FpeelcLkjXpJ0UfH8YC5M/uw3Z9qIG3jqRjeFo/Lcpq+X6ENIgudm7n+eU6W s/3m8XJmDpf+xZqphIS4roWKXKPxJ74fxWEc5n/0BylHeTFQIq1iH9URDDSLsPSppmHT0U v//iVNtyA6PuRjOmBf33ww7YlkwFtNw8NQRNqRc61X7TVKGxY9jz24IoLHJOQ9nno537Vk m2DpNObtNCeG2sPI96NZgMEd/NrrsHE1xCWtCc5EWAVvePj7WXpXEcNxuqNE2w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by grembo (ports committer): URL: https://cgit.FreeBSD.org/src/commit/?id=0eb736c0f673d2804a0c8c14fa1e4eae228ab6d2 commit 0eb736c0f673d2804a0c8c14fa1e4eae228ab6d2 Author: Michael Gmelin AuthorDate: 2022-09-07 16:56:49 +0000 Commit: Michael Gmelin CommitDate: 2022-09-08 00:16:34 +0000 stand: Unbreak FAT32 in loader This corrects an issue introduced in b4cb3fe0e39a3, where a freshly allocated `DOS_FS` structure would not be initialized properly before use in `dos_open`. In case of FAT32 file systems, this would leave `fs->dirents` uninitialized and - depending on its content and due to checks in `parsebs` - prevent mounting the file system successfully. This particularily impacted the EFI loader, as it was sometimes not able to read files from a FAT32-formatted EFI partition, including LoaderEnv (`/efi/freebsd/loader.env`). Accepted by: imp MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D36482 --- stand/libsa/dosfs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/stand/libsa/dosfs.c b/stand/libsa/dosfs.c index 09f09dc66809..e50f8f25e16a 100644 --- a/stand/libsa/dosfs.c +++ b/stand/libsa/dosfs.c @@ -321,7 +321,7 @@ dos_open(const char *path, struct open_file *fd) if (mnt == NULL) { /* Allocate mount structure, associate with open */ - if ((fs = malloc(sizeof(DOS_FS))) == NULL) + if ((fs = calloc(1, sizeof(DOS_FS))) == NULL) return (errno); if ((err = dos_mount_impl(fs, fd))) { free(fs);