[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

grub2_1.96+20080724-15



Hi,

Please consider approving grub2_1.96+20080724-15, it fixes the last two RC
bugs.

-- 
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."
diff -u grub2-1.96+20080724/debian/changelog grub2-1.96+20080724/debian/changelog
--- grub2-1.96+20080724/debian/changelog
+++ grub2-1.96+20080724/debian/changelog
@@ -1,3 +1,12 @@
+grub2 (1.96+20080724-15) unstable; urgency=high
+
+  * Avoid mounting ext2 partitions with backward-incompatible features.
+    (Closes: #502333)
+  * patches/13_update_grub_gnumach.diff: Temporary hack to prevent gnumach
+    from triggering postinst failure.  (Closes: #512968)
+
+ -- Robert Millan <rmh@aybabtu.com>  Mon,  9 Feb 2009 18:56:00 +0100
+
 grub2 (1.96+20080724-14) unstable; urgency=high
 
   * 00_use_setroot_inside_menuentrys.diff: New patch to use `set root' inside
only in patch2:
unchanged:
--- grub2-1.96+20080724.orig/debian/patches/00_ext2_incompatible_features.diff
+++ grub2-1.96+20080724/debian/patches/00_ext2_incompatible_features.diff
@@ -0,0 +1,96 @@
+2009-02-07  Robert Millan  <rmh@aybabtu.com>
+
+	* fs/ext2.c (grub_ext2_mount): Avoid mounting filesystems with
+	backward-incompatible features.
+
+	Based on patch from Javier Martín, with some adjustments.
+
+Index: fs/ext2.c
+===================================================================
+--- fs/ext2.c	(Revision 1976)
++++ fs/ext2.c	(Revision 1979)
+@@ -71,8 +71,53 @@
+          ? EXT2_GOOD_OLD_INODE_SIZE \
+          : grub_le_to_cpu16 (data->sblock.inode_size))
+ 
+-#define EXT3_FEATURE_COMPAT_HAS_JOURNAL	0x0004
++/* Superblock filesystem feature flags (RW compatible)
++ * A filesystem with any of these enabled can be read and written by a driver
++ * that does not understand them without causing metadata/data corruption.  */
++#define EXT2_FEATURE_COMPAT_DIR_PREALLOC	0x0001
++#define EXT2_FEATURE_COMPAT_IMAGIC_INODES	0x0002
++#define EXT3_FEATURE_COMPAT_HAS_JOURNAL		0x0004
++#define EXT2_FEATURE_COMPAT_EXT_ATTR		0x0008
++#define EXT2_FEATURE_COMPAT_RESIZE_INODE	0x0010
++#define EXT2_FEATURE_COMPAT_DIR_INDEX		0x0020
++/* Superblock filesystem feature flags (RO compatible)
++ * A filesystem with any of these enabled can be safely read by a driver that
++ * does not understand them, but should not be written to, usually because
++ * additional metadata is required.  */
++#define EXT2_FEATURE_RO_COMPAT_SPARSE_SUPER	0x0001
++#define EXT2_FEATURE_RO_COMPAT_LARGE_FILE	0x0002
++#define EXT2_FEATURE_RO_COMPAT_BTREE_DIR	0x0004
++#define EXT4_FEATURE_RO_COMPAT_GDT_CSUM		0x0010
++#define EXT4_FEATURE_RO_COMPAT_DIR_NLINK	0x0020
++#define EXT4_FEATURE_RO_COMPAT_EXTRA_ISIZE	0x0040
++/* Superblock filesystem feature flags (back-incompatible)
++ * A filesystem with any of these enabled should not be attempted to be read
++ * by a driver that does not understand them, since they usually indicate
++ * metadata format changes that might confuse the reader.  */
++#define EXT2_FEATURE_INCOMPAT_COMPRESSION	0x0001
++#define EXT2_FEATURE_INCOMPAT_FILETYPE		0x0002
++#define EXT3_FEATURE_INCOMPAT_RECOVER		0x0004 /* Needs recovery */
++#define EXT3_FEATURE_INCOMPAT_JOURNAL_DEV	0x0008 /* Volume is journal device */
++#define EXT2_FEATURE_INCOMPAT_META_BG		0x0010
++#define EXT4_FEATURE_INCOMPAT_EXTENTS		0x0040 /* Extents used */
++#define EXT4_FEATURE_INCOMPAT_64BIT		0x0080
++#define EXT4_FEATURE_INCOMPAT_FLEX_BG		0x0200
+ 
++/* The set of back-incompatible features this driver DOES support. Add (OR)
++ * flags here as the related features are implemented into the driver.  */
++#define EXT2_DRIVER_SUPPORTED_INCOMPAT ( EXT2_FEATURE_INCOMPAT_FILETYPE \
++                                       | EXT4_FEATURE_INCOMPAT_EXTENTS  \
++                                       | EXT4_FEATURE_INCOMPAT_FLEX_BG )
++/* List of rationales for the ignored "incompatible" features:
++ * needs_recovery: Not really back-incompatible - was added as such to forbid
++ *                 ext2 drivers from mounting an ext3 volume with a dirty
++ *                 journal because they will ignore the journal, but the next
++ *                 ext3 driver to mount the volume will find the journal and
++ *                 replay it, potentially corrupting the metadata written by
++ *                 the ext2 drivers. Safe to ignore for this RO driver.  */
++#define EXT2_DRIVER_IGNORED_INCOMPAT ( EXT3_FEATURE_INCOMPAT_RECOVER )
++
++
+ #define EXT3_JOURNAL_MAGIC_NUMBER	0xc03b3998U
+ 
+ #define EXT3_JOURNAL_DESCRIPTOR_BLOCK	1
+@@ -503,8 +548,20 @@
+ 
+   /* Make sure this is an ext2 filesystem.  */
+   if (grub_le_to_cpu16 (data->sblock.magic) != EXT2_MAGIC)
+-    goto fail;
++    {
++      grub_error (GRUB_ERR_BAD_FS, "not an ext2 filesystem");
++      goto fail;
++    }
+   
++  /* Check the FS doesn't have feature bits enabled that we don't support. */
++  if (grub_le_to_cpu32 (data->sblock.feature_incompat)
++        & ~(EXT2_DRIVER_SUPPORTED_INCOMPAT | EXT2_DRIVER_IGNORED_INCOMPAT))
++    {
++      grub_error (GRUB_ERR_BAD_FS, "filesystem has unsupported incompatible features");
++      goto fail;
++    }
++    
++  
+   data->disk = disk;
+ 
+   data->diropen.data = data;
+@@ -520,7 +577,6 @@
+   return data;
+ 
+  fail:
+-  grub_error (GRUB_ERR_BAD_FS, "not an ext2 filesystem");
+   grub_free (data);
+   return 0;
+ }
only in patch2:
unchanged:
--- grub2-1.96+20080724.orig/debian/patches/13_update_grub_gnumach.diff
+++ grub2-1.96+20080724/debian/patches/13_update_grub_gnumach.diff
@@ -0,0 +1,13 @@
+Index: util/grub.d/10_hurd.in
+===================================================================
+--- util/grub.d/10_hurd.in	(revision 1986)
++++ util/grub.d/10_hurd.in	(working copy)
+@@ -65,7 +65,7 @@
+ 
+ if ${all_of_them} && test -e /lib/ld.so.1 ; then : ; else
+   echo "Some Hurd stuff found, but not enough to boot." >&2
+-  exit 1
++  exit 0 # temporary hack, see #512968
+ fi
+ 
+ cat << EOF

Reply to: