From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from list by lists.gnu.org with archive (Exim 4.90_1) id 1klzpC-0007N0-AI for mharc-grub-devel@gnu.org; Sun, 06 Dec 2020 14:36:02 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:50976) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1klzp6-0007M9-Nn for grub-devel@gnu.org; Sun, 06 Dec 2020 14:35:58 -0500 Received: from out4-smtp.messagingengine.com ([66.111.4.28]:42521) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1klzp0-0006Vj-Fk for grub-devel@gnu.org; Sun, 06 Dec 2020 14:35:55 -0500 Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.nyi.internal (Postfix) with ESMTP id D28A25C0196; Sun, 6 Dec 2020 14:35:49 -0500 (EST) Received: from mailfrontend2 ([10.202.2.163]) by compute1.internal (MEProxy); Sun, 06 Dec 2020 14:35:49 -0500 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=fm2; bh=Ga2LAn+9MdFEVobaZIU5s4BV/bO hhp7k2LJDnTGh48c=; b=mopDR0eqwkS8uV9nAmOgwrfBVlJTl1RwBK97aNjGMfn MgRNOiKKzyPWLEG00IiZoF0Bmj296rKTHuFfA7jX5jCdIMoRK++SOeEN5+V+F4u1 Tf6MftJdB+TZuD2JRRfDvj5ZENkdmbj+STXdsVC8YJdFAsEq7gDpLex6BXZPsItp AzNW0atPY4vamyB/qyM7WVjldUC3Vf5L/7qUM6tsVyK1am+ob/mcGu4WNcfPH5C9 c5W7Kp9GVdw2Yu3pwJTzzX1l0r+DGurxyYJQS47U1GwfVpdBgNwad9ZdFBIQJ92B XvOvhTYeYameOgWm6T/EbOV2PXMopLJjim0DMXuIsEg== 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=fm1; bh=Ga2LAn +9MdFEVobaZIU5s4BV/bOhhp7k2LJDnTGh48c=; b=jNtfsir1j+L9pRAP307nNf jLcA9ehMkXroku9RmXPsVF/mSVK3VF8w2dt8awM6gjKnX3s2TtqlHWwBYQmQlKuA PAzulrBFsEc3e7oXlJB3Uhh0VMmaaeoYy7GX3kDvdgDBSLAKZ1y5Kulw9LZOoiVk a/h9pmT/IqxvuAVRhvm4igMqi5zqjvuUn3aqAjCfCDY5b++RgT6bMyQ/7SM50ziw GaWvGrVcSSJxq9WehUC00PnSf7uCfBFiPjebOFqZhdol+SftO1Pjzn08aew4X80b 05kHlIkkj/vyac0jfKl/KZBWVpFpWbur68JYI5tC29GXw9M39T5tqdNCPzjEqi+w == X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedujedrudejvddguddvlecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmd enucfjughrpeffhffvuffkfhggtggujgesghdtreertddtvdenucfhrhhomheprfgrthhr ihgtkhcuufhtvghinhhhrghrughtuceophhssehpkhhsrdhimheqnecuggftrfgrthhtvg hrnhepheeghfdtfeeuffehkefgffduleffjedthfdvjeektdfhhedvlefgtefgvdettdfh necukfhppeejjedrudekfedrudejrdduuddtnecuvehluhhsthgvrhfuihiivgeptdenuc frrghrrghmpehmrghilhhfrhhomhepphhssehpkhhsrdhimh X-ME-Proxy: Received: from vm-mail (x4db7116e.dyn.telefonica.de [77.183.17.110]) by mail.messagingengine.com (Postfix) with ESMTPA id 174121080059; Sun, 6 Dec 2020 14:35:48 -0500 (EST) Received: from localhost (ncase [10.192.0.11]) by vm-mail (OpenSMTPD) with ESMTPSA id 3bce15e5 (TLSv1.3:TLS_AES_256_GCM_SHA384:256:NO); Sun, 6 Dec 2020 19:35:48 +0000 (UTC) Date: Sun, 6 Dec 2020 20:35:47 +0100 From: Patrick Steinhardt To: Glenn Washburn Cc: grub-devel@gnu.org, Daniel Kiper , Daniel Kiper Subject: Re: [PATCH v7 13/17] luks2: Error check segment.sector_size Message-ID: References: <2fcef44b6465090f6b779ba040c6ee8a5ff101b0.1607098915.git.development@efficientek.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="zwu04Up/tB1xbWEA" Content-Disposition: inline In-Reply-To: <2fcef44b6465090f6b779ba040c6ee8a5ff101b0.1607098915.git.development@efficientek.com> Received-SPF: pass client-ip=66.111.4.28; envelope-from=ps@pks.im; helo=out4-smtp.messagingengine.com 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 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: Sun, 06 Dec 2020 19:35:58 -0000 --zwu04Up/tB1xbWEA Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, Dec 04, 2020 at 10:43:42AM -0600, Glenn Washburn wrote: > Reviewed-by: Daniel Kiper > Signed-off-by: Glenn Washburn Reviewed-by: Patrick Steinhardt > --- > grub-core/disk/luks2.c | 11 +++++++++++ > 1 file changed, 11 insertions(+) >=20 > diff --git a/grub-core/disk/luks2.c b/grub-core/disk/luks2.c > index 1bb3a333d..499c9330b 100644 > --- a/grub-core/disk/luks2.c > +++ b/grub-core/disk/luks2.c > @@ -629,6 +629,17 @@ luks2_recover_key (grub_disk_t source, > =20 > grub_dprintf ("luks2", "Trying keyslot \"%"PRIuGRUB_UINT64_T"\"\n"= , keyslot.json_slot_key); > =20 > + /* Sector size should be one of 512, 1024, 2048, or 4096. */ > + if (!(segment.sector_size =3D=3D 512 || segment.sector_size =3D=3D= 1024 || > + segment.sector_size =3D=3D 2048 || segment.sector_size =3D=3D 4096)) > + { > + grub_dprintf ("luks2", "Segment \"%"PRIuGRUB_UINT64_T"\" sector" > + " size %"PRIuGRUB_UINT64_T" is not one of" > + " 512, 1024, 2048, or 4096\n", > + segment.json_slot_key, segment.sector_size); > + continue; > + } > + > /* Set up disk according to keyslot's segment. */ > crypt->offset_sectors =3D grub_divmod64 (segment.offset, segment.s= ector_size, NULL); > crypt->log_sector_size =3D sizeof (unsigned int) * 8 > --=20 > 2.27.0 >=20 --zwu04Up/tB1xbWEA Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEEF9hrgiFbCdvenl/rVbJhu7ckPpQFAl/NMpIACgkQVbJhu7ck PpRWbA//dqtTW9b2xxSWs3JRa/wnY/Lfzs0hap/UlEIaC+/vILOr4oOhFFW0JwxI PKp2WU5vfUR1D48ppIaW4K2LTaAAH6lRJ0W901M++UMxdCs9+6HHUieWScM/HB23 nZ4aRoVPh8mPBiFDfBS6K3/RLTcfM7wnIhNRIPgKfINLov5hk41V8N0S1jQgDGqD z3xJLCfPkyZpmKtqSz4TQK2peborOtmSjVgxzJ0iB4w1DbBhatSRr/qEufk2LCT6 8701UrDY4cvmJpfrK8rv4mokJgMmlXLKmSo/QmdBvucFGlT3c142Lfq0NiWyCYcJ GwoZQIgh1fLSkPgUqOzAkb8qZCebxCwKtSt0y0Yer0bzfUuEfOnE2UflIB/CFPVI OrkSKhxlqji99TGxOZurc2qoCiaL7WD0uJpgAj4tf42ZDaldbdJygJzzaREA7/j0 SenKAKDRHJ/WLllbyP96I25VD9REdiHenmAwEXt1TIDJR1vrPVdWoffuTSoaClEJ Wwf6g9epitQAXC6YDF4g4RwqbJVkniIeTVjdc1QVbswTuq6DsTQOaCFWMDs7O3an EDV5ie0oHRcBjjTrBAaOfd1Ft+vN10H0BvqVMm/Ml1RxEeJ60/8bbZz2fERqa8Dy z80rJYLeLPhKKi10KVzsyT3IVKHfGmIVwhayi2OleWAlxN/Tqjs= =pkdm -----END PGP SIGNATURE----- --zwu04Up/tB1xbWEA--