]> git.ipfire.org Git - thirdparty/grub.git/commitdiff
Fix double-free introduced by commit 33d02a42d64cf06cada1c389e5abba4b9d196cc5
authorJon McCune <jonmccune@google.com>
Fri, 13 Dec 2013 16:47:12 +0000 (08:47 -0800)
committerJon McCune <jonmccune@google.com>
Tue, 17 Dec 2013 15:32:07 +0000 (07:32 -0800)
To reproduce the problem, make sure you have a GPG public key available, build and install GRUB:
grub-install --debug --debug-image="all" --pubkey=/boot/pubkey.gpg --modules="serial terminfo gzio search search_label search_fs_uuid search_fs_file linux vbe video_fb video mmap relocator verify gcry_rsa gcry_dsa gcry_sha256 hashsum gcry_sha1 mpi echo loadenv boottime" /dev/sda
Sign all the files in /boot/grub/* and reboot.

'make check' results identical before and after this change.

TESTED: In a QEMU VM using an i386 target.

ChangeLog
grub-core/commands/verify.c
grub-core/io/gzio.c
grub-core/io/lzopio.c
grub-core/io/xzio.c

index c8bf716b0dae20c9ee29bb57433bbf5a4d35ad67..9895a2fb3cd7afad6d055a6f4a5731469eca6bfc 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2013-12-17  Jon McCune  <jonmccune@google.com>
+
+       Fix double-free introduced by commit 33d02a42d64cf06cada1c389
+
 2013-12-17  Vladimir Serbinenko  <phcoder@gmail.com>
 
        Unify message for unsupported relocation.
index 85a72d65f6befadc61f3365c5b2bef48e0231de8..87c6d4f2ca422ae68f3b9b743d83944acdbd8b9f 100644 (file)
@@ -885,6 +885,7 @@ grub_pubkey_open (grub_file_t io, const char *filename)
   if (err)
     return NULL;
   io->device = 0;
+  io->name = 0;
   grub_file_close (io);
   return ret;
 }
index 6327fda3543d90ddada5fad627ad415ce1245f23..aec798f5951c62ffe4cff30f81dc48f4a0db8259 100644 (file)
@@ -1275,6 +1275,7 @@ grub_gzio_close (grub_file_t file)
 
   /* No need to close the same device twice.  */
   file->device = 0;
+  file->name = 0;
 
   return grub_errno;
 }
index b1ce26029ecef83987b40ee7fa06af3dbf37eccc..de2ea6778e2e25da82ea8199d49e019238895c69 100644 (file)
@@ -525,6 +525,7 @@ grub_lzopio_close (grub_file_t file)
 
   /* Device must not be closed twice.  */
   file->device = 0;
+  file->name = 0;
   return grub_errno;
 }
 
index e57f8019e83085358c38f70f976939eaf33cdc0f..a3536ad73b19e0a2c0925796b4b9ce8e6fee2bff 100644 (file)
@@ -319,6 +319,7 @@ grub_xzio_close (grub_file_t file)
 
   /* Device must not be closed twice.  */
   file->device = 0;
+  file->name = 0;
   return grub_errno;
 }