From nobody Wed Oct 05 11:48:37 2022 X-Original-To: dev-commits-src-all@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 4MjCWn6cT5z4f3sb; Wed, 5 Oct 2022 11:48:37 +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 4MjCWn60ckz3LDt; Wed, 5 Oct 2022 11:48:37 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1664970517; 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=MouKqhlZbjp/HBKZ8LBhWHd/E1ILIg7Db8BM+w5u104=; b=VQywRTr4h+iE5Xr7/jP2a/eDlA19UwuG5ydw7WueEG8pRUxLenEpqeydhB3fotMvt0m118 DqYxiv5Ij86wQ2s7ouNT036m93ZCiSuVtTM4kkvkUBzK8vJ0+fWse+MfghUw8kdUQ07ISr k8xF859ylXuD/EgY/Hf3ofd6BGc97FejEPbl76javF+jKpSOmxJS4GcRL4LFWy0RYTFqP7 wEvPUHf68qEvicLlct17ufSpTsSefCziiCCZL2xZJ04CE6ArqlYMjplXXby2qZowuhtP+3 t67uY/mhbGBKF+fcBias2Sz1zAkwgAVtSpz1ZPmt1+JffXqGBARkv+JA5+PuMQ== 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 4MjCWn4mB6ztRm; Wed, 5 Oct 2022 11:48:37 +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 295Bmb0k093068; Wed, 5 Oct 2022 11:48:37 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 295BmbuC093067; Wed, 5 Oct 2022 11:48:37 GMT (envelope-from git) Date: Wed, 5 Oct 2022 11:48:37 GMT Message-Id: <202210051148.295BmbuC093067@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Michael Gmelin Subject: git: 6d162b90b54b - stable/13 - stand: Unbreak FAT32 in loader List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@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/stable/13 X-Git-Reftype: branch X-Git-Commit: 6d162b90b54b6733bdb91b82f3b97ac84c6b9f8c Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1664970517; 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=MouKqhlZbjp/HBKZ8LBhWHd/E1ILIg7Db8BM+w5u104=; b=dBCbBkfnNG3xMY3JNfMpty6QStIEF4Xhb3I86vj1NqvkCfkLXcL73W+hEJqa9z82qbsTmR 6Uo4NL95i4TFIgwCDkNZ2sjqYrY7GAxgvPiZg6GMV87PE/n+ZohXX9PIay7OlNXOWMSPJg SJNH3GlT8wznVT8D0oSVTd2YNQkEHC9/oF+JXgXtRx3bgVSiHXWUL0VIpDo40PZLv9Un8V ARD8sVpsJua2wEnhnFDJQrC+7WOl8ZPgFC6A0xrYs+moRKPCV7tUaWJMNwkuXWZIo9Hrr1 2IVwF36ALKwRalLse0PrnLJrNyNlL1Mtul4YReWZF8fNtjSqEeXd+1lkY362lQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1664970517; a=rsa-sha256; cv=none; b=IF+BtI82X4EN7+m51SQ9Htj+WOkrIi0XelpeSw9c4ieYqklmxBP7tlBQpzl5Ewp5igEUil s+8kL9yXFvUUXqf2Dq2quPtfbKfvkm/DixzfYin4Qt9yel/dmQ7OX8gW0md8/UNNqJNaXj Qb/3pdhaa3Wm1dLUh9+g7W/FMNTiIXBsOiWJKPVBz3C1xviDyTlNXteSBbOuHiWKXfDCw4 JTTIKvfoFVxNJpTJOdCyAWxsbLX3ZZ3SM/vS+LMSjhawjC9Rs6hRF9m+2ll4AgNYkqDwKz TDD1UTbrXkSMff1e9SrSV1r7lTifgZ6bbOw6kNOYtoJARs7ULg8dDkR5NZJNjg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by grembo (ports committer): URL: https://cgit.FreeBSD.org/src/commit/?id=6d162b90b54b6733bdb91b82f3b97ac84c6b9f8c commit 6d162b90b54b6733bdb91b82f3b97ac84c6b9f8c Author: Michael Gmelin AuthorDate: 2022-09-07 16:56:49 +0000 Commit: Michael Gmelin CommitDate: 2022-10-05 11:47:39 +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 (cherry picked from commit 0eb736c0f673d2804a0c8c14fa1e4eae228ab6d2) --- 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 452a79ae12dc..b931648a364b 100644 --- a/stand/libsa/dosfs.c +++ b/stand/libsa/dosfs.c @@ -322,7 +322,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);