grub_ufs_mount: Check that sblock.ino_per_group is not 0.

This commit is contained in:
Vladimir Serbinenko 2015-01-20 14:30:05 +01:00
parent 9201cd79a3
commit 245e21b2b5
2 changed files with 7 additions and 1 deletions

View file

@ -1,3 +1,8 @@
2015-01-20 Vladimir Serbinenko <phcoder@gmail.com>
* grub-core/fs/ufs.c (grub_ufs_mount): Check
that sblock.ino_per_group is not 0.
2015-01-20 Vladimir Serbinenko <phcoder@gmail.com>
Reject NILFS2 superblocks with over 1GiB blocks.

View file

@ -604,7 +604,8 @@ grub_ufs_mount (grub_disk_t disk)
endiannesses. */
if (data->sblock.magic == grub_cpu_to_ufs32_compile_time (GRUB_UFS_MAGIC)
&& data->sblock.bsize != 0
&& ((data->sblock.bsize & (data->sblock.bsize - 1)) == 0))
&& ((data->sblock.bsize & (data->sblock.bsize - 1)) == 0)
&& data->sblock.ino_per_group != 0)
{
for (data->log2_blksz = 0;
(1U << data->log2_blksz) < grub_ufs_to_cpu32 (data->sblock.bsize);