summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2005-08-07 06:36:56 +0000
committerMike Frysinger <vapier@gentoo.org>2005-08-07 06:36:56 +0000
commit7b70d0de887b0a6564d56ca5aefaf699654bed4c (patch)
tree19bc5e5c23fe37b8dd31e96787244a46eb323d91
parentadd some directory checks (diff)
downloadgentoo-2-7b70d0de887b0a6564d56ca5aefaf699654bed4c.tar.gz
gentoo-2-7b70d0de887b0a6564d56ca5aefaf699654bed4c.tar.bz2
gentoo-2-7b70d0de887b0a6564d56ca5aefaf699654bed4c.zip
Add patch from upstream to fix segfault #91751 by Christopher Cowart / Ben Schwartz.
(Portage version: 2.0.51.22-r2)
-rw-r--r--sys-fs/e2fsprogs/ChangeLog7
-rw-r--r--sys-fs/e2fsprogs/e2fsprogs-1.38.ebuild6
-rw-r--r--sys-fs/e2fsprogs/files/e2fsprogs-1.38-disconnected-inodes.patch79
3 files changed, 89 insertions, 3 deletions
diff --git a/sys-fs/e2fsprogs/ChangeLog b/sys-fs/e2fsprogs/ChangeLog
index ab335cb97167..2f79ebdb4ada 100644
--- a/sys-fs/e2fsprogs/ChangeLog
+++ b/sys-fs/e2fsprogs/ChangeLog
@@ -1,6 +1,11 @@
# ChangeLog for sys-fs/e2fsprogs
# Copyright 1999-2005 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/sys-fs/e2fsprogs/ChangeLog,v 1.70 2005/07/25 19:49:13 killerfox Exp $
+# $Header: /var/cvsroot/gentoo-x86/sys-fs/e2fsprogs/ChangeLog,v 1.71 2005/08/07 06:36:56 vapier Exp $
+
+ 07 Aug 2005; Mike Frysinger <vapier@gentoo.org>
+ +files/e2fsprogs-1.38-disconnected-inodes.patch, e2fsprogs-1.38.ebuild:
+ Add patch from upstream to fix segfault #91751 by Christopher Cowart / Ben
+ Schwartz.
25 Jul 2005; Rene Nussbaumer <killerfox@gentoo.org> e2fsprogs-1.38.ebuild:
Stable on hppa.
diff --git a/sys-fs/e2fsprogs/e2fsprogs-1.38.ebuild b/sys-fs/e2fsprogs/e2fsprogs-1.38.ebuild
index 02237fd76b86..6218aa26e9e4 100644
--- a/sys-fs/e2fsprogs/e2fsprogs-1.38.ebuild
+++ b/sys-fs/e2fsprogs/e2fsprogs-1.38.ebuild
@@ -1,6 +1,6 @@
# Copyright 1999-2005 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/sys-fs/e2fsprogs/e2fsprogs-1.38.ebuild,v 1.7 2005/07/25 19:49:13 killerfox Exp $
+# $Header: /var/cvsroot/gentoo-x86/sys-fs/e2fsprogs/e2fsprogs-1.38.ebuild,v 1.8 2005/08/07 06:36:56 vapier Exp $
inherit eutils flag-o-matic toolchain-funcs
@@ -28,6 +28,8 @@ src_unpack() {
chmod u+w po/*.po # Userpriv fix #27348
# Clean up makefile to suck less
epatch "${FILESDIR}"/e2fsprogs-1.36-makefile.patch
+ # Fix segfault with disconnected inodes #91751
+ epatch "${FILESDIR}"/${P}-disconnected-inodes.patch
# kernel headers use the same defines as e2fsprogs and can cause issues #48829
sed -i \
@@ -68,7 +70,7 @@ src_compile() {
$(use_enable nls) \
${myconf} \
|| die
- if [[ ${CTARGET} != *-uclibc ]] && grep -qs 'USE_INCLUDED_LIBINTL.*yes' config.{log,status} ; then
+ if [[ ${CTARGET:-${CHOST}} != *-uclibc ]] && grep -qs 'USE_INCLUDED_LIBINTL.*yes' config.{log,status} ; then
eerror "INTL sanity check failed, aborting build."
eerror "Please post your ${S}/config.log file as an"
eerror "attachment to http://bugs.gentoo.org/show_bug.cgi?id=81096"
diff --git a/sys-fs/e2fsprogs/files/e2fsprogs-1.38-disconnected-inodes.patch b/sys-fs/e2fsprogs/files/e2fsprogs-1.38-disconnected-inodes.patch
new file mode 100644
index 000000000000..f66ca8a06dc1
--- /dev/null
+++ b/sys-fs/e2fsprogs/files/e2fsprogs-1.38-disconnected-inodes.patch
@@ -0,0 +1,79 @@
+http://bugs.gentoo.org/91751
+
+2005-07-04 Theodore Ts'o <tytso@mit.edu>
+
+ * pass2.c (e2fsck_process_bad_inode): Fixed bug which could cause
+ e2fsck to core dump if a disconnected inode contained an
+ extended attribute. This was actually caused by two bugs.
+ The first bug is that if the inode has been fully fixed
+ up, the code will attempt to remove the inode from the
+ inode_bad_map without checking to see if this bitmap is
+ present. Since it is cleared at the end of pass 2, if
+ e2fsck_process_bad_inode is called in pass 4 (as it is for
+ disconnected inodes), this would result in a core dump.
+ This bug was mostly hidden by a second bug, which caused
+ e2fsck_process_bad_inode() to consider all inodes without
+ an extended attribute to be not fixed. (Addresses Debian
+ Bug: #316736)
+
+--- e2fsck/pass2.c
++++ e2fsck/pass2.c
+@@ -1184,27 +1184,29 @@
+ pctx.inode = &inode;
+
+ if (inode.i_file_acl &&
+- !(fs->super->s_feature_compat & EXT2_FEATURE_COMPAT_EXT_ATTR) &&
+- fix_problem(ctx, PR_2_FILE_ACL_ZERO, &pctx)) {
+- inode.i_file_acl = 0;
++ !(fs->super->s_feature_compat & EXT2_FEATURE_COMPAT_EXT_ATTR)) {
++ if (fix_problem(ctx, PR_2_FILE_ACL_ZERO, &pctx)) {
++ inode.i_file_acl = 0;
+ #ifdef EXT2FS_ENABLE_SWAPFS
+- /*
+- * This is a special kludge to deal with long symlinks
+- * on big endian systems. i_blocks had already been
+- * decremented earlier in pass 1, but since i_file_acl
+- * hadn't yet been cleared, ext2fs_read_inode()
+- * assumed that the file was short symlink and would
+- * not have byte swapped i_block[0]. Hence, we have
+- * to byte-swap it here.
+- */
+- if (LINUX_S_ISLNK(inode.i_mode) &&
+- (fs->flags & EXT2_FLAG_SWAP_BYTES) &&
+- (inode.i_blocks == fs->blocksize >> 9))
+- inode.i_block[0] = ext2fs_swab32(inode.i_block[0]);
++ /*
++ * This is a special kludge to deal with long
++ * symlinks on big endian systems. i_blocks
++ * had already been decremented earlier in
++ * pass 1, but since i_file_acl hadn't yet
++ * been cleared, ext2fs_read_inode() assumed
++ * that the file was short symlink and would
++ * not have byte swapped i_block[0]. Hence,
++ * we have to byte-swap it here.
++ */
++ if (LINUX_S_ISLNK(inode.i_mode) &&
++ (fs->flags & EXT2_FLAG_SWAP_BYTES) &&
++ (inode.i_blocks == fs->blocksize >> 9))
++ inode.i_block[0] = ext2fs_swab32(inode.i_block[0]);
+ #endif
+- inode_modified++;
+- } else
+- not_fixed++;
++ inode_modified++;
++ } else
++ not_fixed++;
++ }
+
+ if (!LINUX_S_ISDIR(inode.i_mode) && !LINUX_S_ISREG(inode.i_mode) &&
+ !LINUX_S_ISCHR(inode.i_mode) && !LINUX_S_ISBLK(inode.i_mode) &&
+@@ -1302,7 +1304,7 @@
+
+ if (inode_modified)
+ e2fsck_write_inode(ctx, ino, &inode, "process_bad_inode");
+- if (!not_fixed)
++ if (!not_fixed && ctx->inode_bad_map)
+ ext2fs_unmark_inode_bitmap(ctx->inode_bad_map, ino);
+ return 0;
+ }
+