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-prev] [thread-next>] [day] [month] [year] [list]
Date:	Tue,  3 Dec 2013 00:10:15 -0500
From:	Theodore Ts'o <tytso@....edu>
To:	Ext4 Developers List <linux-ext4@...r.kernel.org>
Cc:	Kit Westneat <kwestneat@....com>, Theodore Ts'o <tytso@....edu>
Subject: [PATCH 07/10] e2fsck: fix j_maxlen if the file system is exactly 1 << 32 blocks

If the external journal device has exactly 1 << 32 blocks,
journal->j_maxlen would get set to zero, which would cause e2fsck to
declare the journal to be invalid.

Signed-off-by: "Theodore Ts'o" <tytso@....edu>
---
 e2fsck/journal.c | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/e2fsck/journal.c b/e2fsck/journal.c
index ff11f22..bd2c9a1 100644
--- a/e2fsck/journal.c
+++ b/e2fsck/journal.c
@@ -241,7 +241,6 @@ static errcode_t e2fsck_get_journal(e2fsck_t ctx, journal_t **ret_journal)
 	unsigned long long	start = 0;
 	int			ext_journal = 0;
 	int			tried_backup_jnl = 0;
-	blk64_t			maxlen;
 
 	clear_problem_context(&pctx);
 
@@ -392,6 +391,8 @@ static errcode_t e2fsck_get_journal(e2fsck_t ctx, journal_t **ret_journal)
 	io_channel_set_blksize(ctx->journal_io, ctx->fs->blocksize);
 
 	if (ext_journal) {
+		blk64_t maxlen;
+
 		if (ctx->fs->blocksize == 1024)
 			start = 1;
 		bh = getblk(dev_journal, start, ctx->fs->blocksize);
@@ -426,9 +427,7 @@ static errcode_t e2fsck_get_journal(e2fsck_t ctx, journal_t **ret_journal)
 		}
 
 		maxlen = ext2fs_blocks_count(&jsuper);
-		if (maxlen > 1ULL << 32)
-			maxlen = (1ULL << 32) - 1;
-		journal->j_maxlen = maxlen;
+		journal->j_maxlen = (maxlen < 1ULL << 32) ? maxlen : (1ULL << 32) - 1;
 		start++;
 	}
 
-- 
1.8.5.rc3.362.gdf10213

--
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