lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Date:	Wed, 19 Mar 2008 15:20:18 -0500
From:	Eric Sandeen <sandeen@...hat.com>
To:	ext4 development <linux-ext4@...r.kernel.org>,
	Theodore Tso <tytso@....edu>
CC:	"Aneesh Kumar K.V" <aneesh.kumar@...ux.vnet.ibm.com>
Subject: [PATCH] e2fsprogs: fix ext2fs_extent_get for uninit leaf extents

Fix ext2fs_extent_get for uninit leaf extents

From: Eric Sandeen <sandeen@...hat.com>

The ext2fs_extent_get() function was not OR-ing together UNINIT
and LEAF flags in the case where an extent was both; so if we 
had an extent which was both uniint and leaf, pass1 would bail
out where depth == max_depth but was not marked as leaf, and
e2fsck (from the next branch) would abort with:

e2fsck 1.40.8 (13-Mar-2008)
Pass 1: Checking inodes, blocks, and sizes
Error1: No 'down' extent
Aborted

Also, if the error is encountered again, print the inode number
to aid debugging until it's properly handled, at least.

Signed-off-by: Eric Sandeen <sandeen@...hat.com>

---

diff --git a/lib/ext2fs/extent.c b/lib/ext2fs/extent.c
index ab211b1..c616984 100644
--- a/lib/ext2fs/extent.c
+++ b/lib/ext2fs/extent.c
@@ -463,10 +463,10 @@ retry:
 			((__u64) ext2fs_le16_to_cpu(ex->ee_start_hi) << 32);
 		extent->e_lblk = ext2fs_le32_to_cpu(ex->ee_block);
 		extent->e_len = ext2fs_le16_to_cpu(ex->ee_len);
-		extent->e_flags = EXT2_EXTENT_FLAGS_LEAF;
+		extent->e_flags |= EXT2_EXTENT_FLAGS_LEAF;
 		if (extent->e_len > EXT_INIT_MAX_LEN) {
 			extent->e_len -= EXT_INIT_MAX_LEN;
-			extent->e_flags = EXT2_EXTENT_FLAGS_UNINIT;
+			extent->e_flags |= EXT2_EXTENT_FLAGS_UNINIT;
 		}
 	} else {
 		extent->e_pblk = ext2fs_le32_to_cpu(ix->ei_leaf) +

diff --git a/e2fsck/pass1.c b/e2fsck/pass1.c
index 50e38e1..79e9f23 100644
--- a/e2fsck/pass1.c
+++ b/e2fsck/pass1.c
@@ -1622,14 +1622,16 @@ static void scan_extent_node(e2fsck_t ctx, struct problem_context *pctx,
 			pctx->errcode = ext2fs_extent_get(ehandle,
 						  EXT2_EXTENT_DOWN, &extent);
 			if (pctx->errcode) {
-				printf("Error1: %s\n", error_message(pctx->errcode));
+				printf("Error1: %s on inode %lld\n",
+					error_message(pctx->errcode), pctx->ino);
 				abort();
 			}
 			scan_extent_node(ctx, pctx, pb, ehandle);
 			pctx->errcode = ext2fs_extent_get(ehandle,
 						  EXT2_EXTENT_UP, &extent);
 			if (pctx->errcode) {
-				printf("Error1: %s\n", error_message(pctx->errcode));
+				printf("Error1: %s on inode %lld\n",
+					error_message(pctx->errcode), pctx->ino);
 				abort();
 			}
 			goto next;

--
To unsubscribe from this list: send the line "unsubscribe linux-ext4" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ