From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from list by lists.gnu.org with archive (Exim 4.71) id 1V7ccJ-0007M3-9T for mharc-grub-devel@gnu.org; Thu, 08 Aug 2013 22:39:51 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:55247) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1V7ccD-0007L6-9l for grub-devel@gnu.org; Thu, 08 Aug 2013 22:39:50 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1V7cc8-0001Xw-DC for grub-devel@gnu.org; Thu, 08 Aug 2013 22:39:45 -0400 Received: from mail-lb0-x233.google.com ([2a00:1450:4010:c04::233]:38697) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1V7cc8-0001Xh-4v for grub-devel@gnu.org; Thu, 08 Aug 2013 22:39:40 -0400 Received: by mail-lb0-f179.google.com with SMTP id v1so2920791lbd.38 for ; Thu, 08 Aug 2013 19:39:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=date:from:to:cc:subject:message-id:in-reply-to:references :mime-version:content-type; bh=YVip1TxI4Q7OQfmdo8KBOyskMQrAvrER9YrAAoNcW7k=; b=Yz5YdxVirrh/SWqVqdeL2PeUiOc5g2GCE524UgJB2ACQRGWOWallKArw06IofidG4q eDHedrFMzH2IXrNIzUw4Cf7aNxJ2aaKNG3KbIPYoJyvrc4636eyKHkkHpctc61zGV+sl Vmc01lSZRTrdffcvG+i63tfE1AlX176mo0awq1vcnO77QFrIieDIjDkGs3namyV2vBBo T1Dq/mqzgG1mPzAkLDe8VDuYn56yxshHd8Ime55VmzHIcrveiyvvksuyjY8IIEt1LlKd xBXtR8upZGfxCEKC1WDrJVK0ejC9rAXCaeQwtIACTrJK6CLQ7Hg5HzKgTg6ppL5xNfO3 pL1Q== X-Received: by 10.152.18.164 with SMTP id x4mr4934083lad.71.1376015979120; Thu, 08 Aug 2013 19:39:39 -0700 (PDT) Received: from opensuse.site (ppp79-139-160-84.pppoe.spdop.ru. [79.139.160.84]) by mx.google.com with ESMTPSA id p10sm5721399lap.8.2013.08.08.19.39.38 for (version=SSLv3 cipher=RC4-SHA bits=128/128); Thu, 08 Aug 2013 19:39:38 -0700 (PDT) Date: Fri, 9 Aug 2013 06:39:35 +0400 From: Andrey Borzenkov To: The development of GNU GRUB Subject: Re: [PATCH 1/5] Fix reporting of RAIDZ vdevs in zfsinfo Message-ID: <20130809063935.0396c64f@opensuse.site> In-Reply-To: <52043133.6080603@massimo-maggi.eu> References: <510F96B1.6080509@massimo-maggi.eu> <5185928A.9060905@gmail.com> <5187C6B6.1060709@massimo-maggi.eu> <5187F205.8000105@gmail.com> <51881A91.6050603@massimo-maggi.eu> <52043133.6080603@massimo-maggi.eu> X-Mailer: Claws Mail 3.9.0 (GTK+ 2.24.18; x86_64-suse-linux-gnu) Mime-Version: 1.0 Content-Type: multipart/signed; micalg=PGP-SHA1; boundary="Sig_/jsAaKbrWbb4asURmCf2+ARo"; protocol="application/pgp-signature" X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2a00:1450:4010:c04::233 Cc: me@massimo-maggi.eu X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list Reply-To: The development of GNU GRUB List-Id: The development of GNU GRUB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 09 Aug 2013 02:39:50 -0000 --Sig_/jsAaKbrWbb4asURmCf2+ARo Content-Type: text/plain; charset=KOI8-R Content-Transfer-Encoding: quoted-printable =F7 Fri, 09 Aug 2013 02:00:51 +0200 Massimo Maggi =D0=C9=DB=C5=D4: > On 06/05/2013 23:03, Massimo Maggi wrote: > >=20 > > When the issue about the infinite loop gets fully understood and fixed, > > I'll send an updated set of patches. >=20 > Sorry for the long wait, I was really busy. > I've seen that the previous patches were merged. :) > In https://github.com/maxximino/grub2/issues/1, > Christopher Siden suggested as a proper fix to check the zio_eck_t > structure inside the vdev_phys_t structure, which includes a magic > number, to be sure that the code is looking as a real ZFS filesystem. > I've added also the validation of the SHA256 checksum of the structure > itself, so we know that we are not dealing with corrupted or improper dat= a. > You can find the patch attached. > + phys=3D(vdev_phys_t*)nvlist; > + if( grub_zfs_to_cpu64(phys->vp_zbt.zec_magic, > + GRUB_ZFS_LITTLE_ENDIAN) =3D=3D ZEC_MAGIC) > + { > + endian =3D GRUB_ZFS_LITTLE_ENDIAN; > + } > + else if(grub_zfs_to_cpu64(phys->vp_zbt.zec_magic, > + GRUB_ZFS_BIG_ENDIAN) !=3D ZEC_MAGIC) This condition sounds strange. Should it not be " =3D=3D ZEC_MAGIC"? > + { > + endian =3D GRUB_ZFS_BIG_ENDIAN; > + } > Regards, > Massimo Maggi >=20 --Sig_/jsAaKbrWbb4asURmCf2+ARo Content-Type: application/pgp-signature; name=signature.asc Content-Disposition: attachment; filename=signature.asc -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.19 (GNU/Linux) iEYEARECAAYFAlIEVmcACgkQR6LMutpd94w5AACffLe3VPAg+/h2OM0Ioo9pPb+K XHYAninWrmC3qR4PVrGHV8G5xmy3lX1D =xtzy -----END PGP SIGNATURE----- --Sig_/jsAaKbrWbb4asURmCf2+ARo--