Bug#634799: grub2 claims grub.cfg is out of partition

Samuel Thibault samuel.thibault at ens-lyon.org
Wed Jul 20 22:28:08 UTC 2011


tags 634799 + upstream patch
thanks

Hello,

Digging a bit with the issue, it seems grub2 does not ignore entries
with inode == 0 while it should. See linux' ext2_readdir() in
fs/ext2/dir.c doing it:

		for ( ;(char*)de <= limit; de = ext2_next_entry(de)) {
			if (de->inode) {
			  ...
			}
		}

The attached patch fixes it. Shall I commit it to upstream grub2?

Samuel
-------------- next part --------------
=== modified file 'grub-core/fs/ext2.c'
--- grub-core/fs/ext2.c	2011-04-11 21:01:51 +0000
+++ grub-core/fs/ext2.c	2011-07-20 22:20:43 +0000
@@ -689,7 +689,7 @@ grub_ext2_iterate_dir (grub_fshelp_node_
       if (dirent.direntlen == 0)
         return 0;
 
-      if (dirent.namelen != 0)
+      if (dirent.inode != 0 && dirent.namelen != 0)
 	{
 	  char filename[dirent.namelen + 1];
 	  struct grub_fshelp_node *fdiro;



More information about the Pkg-grub-devel mailing list