Received: from list by lists.gnu.org with archive (Exim 4.90_1) id 1oCRgj-0007Op-9A for mharc-grub-devel@gnu.org; Fri, 15 Jul 2022 16:13:25 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:56222) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oCRga-0007Kt-DZ for grub-devel@gnu.org; Fri, 15 Jul 2022 16:13:16 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]:40883) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oCRgW-0005m6-A0 for grub-devel@gnu.org; Fri, 15 Jul 2022 16:13:15 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1657915990; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=5B/rYv4sifqlcMYKb4Sd/5mnc2psWrDjo9LVeF4pje0=; b=QzNjPG7+Y3rmyoou0onFR/XD2eosNKw3R2aqK6NsJD4LkoFARUhKIrX8co1ZjzjrG9L97c HHImugIRlc2tzHtjcCbYV+9HERa3DcxUJyP1mvbHrbtLDqU4Qdm0rLzkL4NFX9Yf7FOyhu VUC3pqx82mVNQ/sGvSnn2LE+XKf8sV0= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-349-Wy-R8HDoMbWIQ4pumL08lg-1; Fri, 15 Jul 2022 16:13:09 -0400 X-MC-Unique: Wy-R8HDoMbWIQ4pumL08lg-1 Received: from smtp.corp.redhat.com (int-mx09.intmail.prod.int.rdu2.redhat.com [10.11.54.9]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id CE0BC801590 for ; Fri, 15 Jul 2022 20:13:08 +0000 (UTC) Received: from eesha.redhat.com (unknown [10.22.32.145]) by smtp.corp.redhat.com (Postfix) with ESMTP id ADF49492C3B; Fri, 15 Jul 2022 20:13:08 +0000 (UTC) From: Robbie Harwood To: grub-devel@gnu.org Cc: Robbie Harwood Subject: [PATCH v1 3/3] fs/fat: don't error when mtime is 0 Date: Fri, 15 Jul 2022 16:13:02 -0400 Message-Id: <20220715201302.16108-4-rharwood@redhat.com> In-Reply-To: <20220715201302.16108-1-rharwood@redhat.com> References: <20220715201302.16108-1-rharwood@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.85 on 10.11.54.9 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=rharwood@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Received-SPF: pass client-ip=170.10.129.124; envelope-from=rharwood@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -28 X-Spam_score: -2.9 X-Spam_bar: -- X-Spam_report: (-2.9 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.082, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: The development of GNU GRUB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 15 Jul 2022 20:13:16 -0000 In the wild, we occasionally see valid ESPs where some file modification times are 0. For instance: ├── [Dec 31 1979] EFI │ ├── [Dec 31 1979] BOOT │ │ ├── [Dec 31 1979] BOOTX64.EFI │ │ └── [Dec 31 1979] fbx64.efi │ └── [Jun 27 02:41] fedora │ ├── [Dec 31 1979] BOOTX64.CSV │ ├── [Dec 31 1979] fonts │ ├── [Mar 14 03:35] fw │ │ ├── [Mar 14 03:35] fwupd-359c1169-abd6-4a0d-8bce-e4d4713335c1.cap │ │ ├── [Mar 14 03:34] fwupd-9d255c4b-2d88-4861-860d-7ee52ade9463.cap │ │ └── [Mar 14 03:34] fwupd-b36438d8-9128-49d2-b280-487be02d948b.cap │ ├── [Dec 31 1979] fwupdx64.efi │ ├── [May 10 10:47] grub.cfg │ ├── [Jun 3 12:38] grub.cfg.new.new │ ├── [May 10 10:41] grub.cfg.old │ ├── [Jun 27 02:41] grubenv │ ├── [Dec 31 1979] grubx64.efi │ ├── [Dec 31 1979] mmx64.efi │ ├── [Dec 31 1979] shim.efi │ ├── [Dec 31 1979] shimx64.efi │ └── [Dec 31 1979] shimx64-fedora.efi └── [Dec 31 1979] FSCK0000.REC 5 directories, 17 files This causes grub-probe failure, which in turn causes grub-mkconfig failure. They are valid filesystems that appear intact, and the Linux FAT stack is able to mount and manipulate them without complaint. The check for mtime of 0 has been present since 20def1a3c3952982395cd7c3ea7e78638527962b ("fat: support file modification times"). Signed-off-by: Robbie Harwood --- grub-core/fs/fat.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/grub-core/fs/fat.c b/grub-core/fs/fat.c index 0951b2e63f..c5efed7241 100644 --- a/grub-core/fs/fat.c +++ b/grub-core/fs/fat.c @@ -1027,9 +1027,6 @@ grub_fat_dir (grub_device_t device, const char *path, grub_fs_dir_hook_t hook, grub_le_to_cpu16 (ctxt.dir.w_date), &info.mtime); #endif - if (info.mtimeset == 0) - grub_error (GRUB_ERR_OUT_OF_RANGE, - "invalid modification timestamp for %s", path); if (hook (ctxt.filename, &info, hook_data)) break; -- 2.35.1