Skip to contentSkip to conversation

deadloop in grub_ext2_iterate_dir

PATCH In review Vasily Averin 3 participants 3 messages Oct 17, 2009 – Oct 24, 2009 VFS

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 deadloop in grub_ext2_iterate_dir

fix for deadloop in grub_ext2_iterate_dir:
fpos is not updated if dirent.direntlen == 0

fs/ext2.c renamed from fs/ext2.c.e2rdr +3 -0
diff -up ./fs/ext2.c.e2rdr ./fs/ext2.c
@@ -649,6 +649,9 @@ grub_ext2_iterate_dir (grub_fshelp_node_
       if (grub_errno)
 	return 0;
 
+      if (grub_le_to_cpu16 (dirent.direntlen) == 0)
+        return 0;
+
       if (dirent.namelen != 0)
 	{
 	  char filename[dirent.namelen + 1];
#1 lore raw

Am Samstag, den 17.10.2009, 16:17 +0400 schrieb Vasily Averin:

fs/ext2.c grub_ext2_iterate_dir (grub_fshelp_node_ · line 655

Quoted 4 lines
fs/ext2.c renamed from fs/ext2.c.e2rdr +3 -0
+      if (grub_le_to_cpu16 (dirent.direntlen) == 0)
+        return 0;
+
       if (dirent.namelen != 0) 

For consistency we should either always use the grub_Xe_to_cpuYZ functions or never when checking for a 0 value.

Oh and in my first reply I forgot to tell you, that we prefer to have GNU Changelog entries sent along with patches.
A git Signed-off-by line is useless. We use SVN not git as our main repository.

Signature · 2 lines
Felix Zielcke
Proud Debian Maintainer and GNU GRUB developer
#2 lore raw
In reply to Vasily Averin
Quoted 2 lines · Vasily Averin

fix for deadloop in grub_ext2_iterate_dir:
fpos is not updated if dirent.direntlen == 0

Committed, thanks.

Quoted 2 lines · Felix Zielcke

For consistency we should either always use the grub_Xe_to_cpuYZ functions or never when checking for a 0 value.

I've set it to keep not using it.

Signature · 5 lines
Robert Millan

  The DRM opt-in fallacy: "Your data belongs to us. We will decide when (and
  how) you may access your data; but nobody's threatening your freedom: we
  still allow you to remove your data and not access it at all."