В Fri, 09 Aug 2013 02:00:51 +0200
Massimo Maggi <m...@massimo-maggi.eu> пишет:

> On 06/05/2013 23:03, Massimo Maggi wrote:
> > 
> > When the issue about the infinite loop gets fully understood and fixed,
> > I'll send an updated set of patches.
> 
> 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 data.
> You can find the patch attached.

> +  phys=(vdev_phys_t*)nvlist;
> +  if( grub_zfs_to_cpu64(phys->vp_zbt.zec_magic,
> +       GRUB_ZFS_LITTLE_ENDIAN) == ZEC_MAGIC)
> +    {
> +      endian = GRUB_ZFS_LITTLE_ENDIAN;
> +    }
> +  else if(grub_zfs_to_cpu64(phys->vp_zbt.zec_magic,
> +       GRUB_ZFS_BIG_ENDIAN) != ZEC_MAGIC)

This condition sounds strange. Should it not be " == ZEC_MAGIC"?

> +    {
> +      endian = GRUB_ZFS_BIG_ENDIAN;
> +    }


> Regards,
> Massimo Maggi
> 

Attachment: signature.asc
Description: PGP signature

_______________________________________________
Grub-devel mailing list
Grub-devel@gnu.org
https://lists.gnu.org/mailman/listinfo/grub-devel

Reply via email to