From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from list by lists.gnu.org with archive (Exim 4.90_1) id 1k1ARq-0002L9-3z for mharc-grub-devel@gnu.org; Thu, 30 Jul 2020 11:26:22 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:49944) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1k1ARo-0002Io-8M for grub-devel@gnu.org; Thu, 30 Jul 2020 11:26:20 -0400 Received: from wout2-smtp.messagingengine.com ([64.147.123.25]:42271) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1k1ARl-00009M-Eq for grub-devel@gnu.org; Thu, 30 Jul 2020 11:26:19 -0400 Received: from compute3.internal (compute3.nyi.internal [10.202.2.43]) by mailout.west.internal (Postfix) with ESMTP id E0F36CBA; Thu, 30 Jul 2020 11:26:14 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute3.internal (MEProxy); Thu, 30 Jul 2020 11:26:15 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=pks.im; h=date :from:to:cc:subject:message-id:references:mime-version :content-type:in-reply-to; s=fm1; bh=4/s0zQI0LSErzctLwYsiOXlNQza 1FE4rNIhGP45n+d4=; b=P07RawhAOIveUirRcIbs7dA0dzzWENewVtoi2iEYbwA 8CCsvGTMqcVmjfUuYLeLVIv8FrDYB7uCOaGgH6MCwUEJqUkB6jlYC1ybMK8spogX lYlbdNuAB0T87kA0CSM7Dp6IdExVck+GdqW07vXv5brGItg8DgxhkLro5qJGB4sW SZ+q1cbFdJ/eL/EITKsBVn3sh71czL48o9sZs/ywD7AT1uexfQOcEQ3jHqMP9IXS PN5RdVOKT9glQ08igelEbQID1KdPcYVkoeXUNKbJbNknKFbyZ952G858aQgad0wX ZqSYV50YzBAReP/E7Qacg1P/PjWx3Bv9dUmDHDcndtg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm3; bh=4/s0zQ I0LSErzctLwYsiOXlNQza1FE4rNIhGP45n+d4=; b=DN6pimFqF1eGAWQ90baUxH RnBCJxzgyNWhvCN94cKFKnGHb0RXDl5l1vXbtY1f4TebWvxbUdnMb4oV+wYgL8MB Xzp7tVXQPKpsdey/H0CCDtLdf8stPVKCfJshx7NTQlp9NwYj//Cbuxo9TeZgQm5j FzclDKd+wKfaHAw7Zw9HUa1Wk8G+LzMblKxR//o3h9BF762ujmigxcRpewGwX2eY B4MTqHLG+v1kEyfmMrTv5UWkswEr7gsfxdeDm5K05k6EA13+qmaCHOzBBSigHIM+ o88bdmqFLmCJHJg8KEe26q8dBns+bWnUD+aCLREar/oHGmr5run6OFICRfyjyTtQ == X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduiedrieeigdeltdcutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpeffhffvuffkfhggtggujgesghdtreertddtvdenucfhrhhomheprfgrthhrihgt khcuufhtvghinhhhrghrughtuceophhssehpkhhsrdhimheqnecuggftrfgrthhtvghrnh epheeghfdtfeeuffehkefgffduleffjedthfdvjeektdfhhedvlefgtefgvdettdfhnecu kfhppeekledrudegrdeffedrtdenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmh epmhgrihhlfhhrohhmpehpshesphhkshdrihhm X-ME-Proxy: Received: from vm-mail.pks.im (x590e2100.dyn.telefonica.de [89.14.33.0]) by mail.messagingengine.com (Postfix) with ESMTPA id B2D8930600B1; Thu, 30 Jul 2020 11:26:13 -0400 (EDT) Received: from localhost (tanuki [10.192.0.23]) by vm-mail.pks.im (OpenSMTPD) with ESMTPSA id a85c0ab2 (TLSv1.3:TLS_AES_256_GCM_SHA384:256:NO); Thu, 30 Jul 2020 15:26:10 +0000 (UTC) Date: Thu, 30 Jul 2020 17:26:26 +0200 From: Patrick Steinhardt To: development@efficientek.com Cc: grub-devel@gnu.org, Daniel Kiper Subject: Re: [PATCH 09/17] fs: When checking if a block list goes past the end of the disk, make sure the total size of the disk is in grub native sector sizes, otherwise there will be blocks at the end of the disk unaccessible by block lists. Message-ID: <20200730152626.GD39309@tanuki.pks.im> References: <8da016945d48f0cf8452ea005f5be79bddde57a0.1596056714.git.development@efficientek.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="cQXOx3fnlpmgJsTP" Content-Disposition: inline In-Reply-To: <8da016945d48f0cf8452ea005f5be79bddde57a0.1596056714.git.development@efficientek.com> Received-SPF: pass client-ip=64.147.123.25; envelope-from=ps@pks.im; helo=wout2-smtp.messagingengine.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/07/30 11:14:46 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] [fuzzy] X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: The development of GNU GRUB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 Jul 2020 15:26:20 -0000 --cQXOx3fnlpmgJsTP Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Jul 29, 2020 at 04:50:14PM -0500, development@efficientek.com wrote: > From: Glenn Washburn The commit message header is quite long. Could you please shorten it to at most 80 characters and maybe put remaining info into the message body? >=20 > Signed-off-by: Glenn Washburn > --- > grub-core/kern/fs.c | 4 +++- > 1 file changed, 3 insertions(+), 1 deletion(-) >=20 > diff --git a/grub-core/kern/fs.c b/grub-core/kern/fs.c > index fb30da9f4..14c17df74 100644 > --- a/grub-core/kern/fs.c > +++ b/grub-core/kern/fs.c > @@ -139,6 +139,7 @@ grub_fs_blocklist_open (grub_file_t file, const char = *name) > unsigned i; > grub_disk_t disk =3D file->device->disk; > struct grub_fs_block *blocks; > + grub_size_t total_native_sectors; > =20 > /* First, count the number of blocks. */ > do > @@ -156,6 +157,7 @@ grub_fs_blocklist_open (grub_file_t file, const char = *name) > return 0; > =20 > file->size =3D 0; > + total_native_sectors =3D disk->total_sectors << (disk->log_sector_size= - GRUB_DISK_SECTOR_BITS); > p =3D (char *) name; > for (i =3D 0; i < num; i++) > { > @@ -181,7 +183,7 @@ grub_fs_blocklist_open (grub_file_t file, const char = *name) > goto fail; > } > =20 > - if (disk->total_sectors < blocks[i].offset + blocks[i].length) > + if (total_native_sectors < blocks[i].offset + blocks[i].length) > { > grub_error (GRUB_ERR_BAD_FILENAME, "beyond the total sectors"); > goto fail; > --=20 > 2.25.1 >=20 --cQXOx3fnlpmgJsTP Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEEF9hrgiFbCdvenl/rVbJhu7ckPpQFAl8i5qEACgkQVbJhu7ck PpSdOw//cxz440EY5N6iBCA0xuoeGrno9EM3kW2S9WKu5ZJzDb9zGPm264T0oOcL KtmTqOrXw9PcWQ39/NrlwvAQ5pJih7656ckxLPZ9hE/J4373fBJBBlRJndyU03ZH gVyKFRTIR1YXoSicW5aXAhnGlf6sr2WA2ulELVdYs6LemymYr9gDeGpchnHwEtiB lL71StME9ZTYIiEaPO8OYK3IcjxxurWqDpwGHyN/2BJ05qyT0nxb1o7orvDimp24 DzAUFnJ3eaZhZ1qAY10GuzmbiDaUicBE1cQP/EdtxjDHxwGNfbvhfcsxJLAoRsi2 k8Ui60U6dI/OjH5+JNNG4gbpnSPABA449enPYKXZEpjCBMg1Uzn5dCrwKUcH+ZGO iXyJpSzZ49sPRVyRVGrK4AvbEinTjKVoYrlMgXbfG2xEu42N0bSc7VKGpRiET7tc UqrswK63qsbF0WUL5q8DSvjJvRU85NqK08FjZVeZPkM+CYro+d83wRC5Fy9nmdfJ /qcc+/plxvEB6KYvuS/KjCiCrNSwipD/dfR/s9QsgL29baJN3VPOZbBdB1QOa+rQ vjbsLZgYMxcV0Q5XKYX5v4z0y0e6dZq1eBvvfbGPxD8lco7jJlbB8MtqK8evlEfS +0h507BPlIyQlvZ1ySncZVUaPwZsrwQ/EDfBJDHAsHI7xrDMIng= =PsJ/ -----END PGP SIGNATURE----- --cQXOx3fnlpmgJsTP--