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, 17 Jun 2008 02:06:31 -0400
From:	Theodore Ts'o <tytso@....edu>
To:	linux-ext4@...r.kernel.org
Cc:	Theodore Ts'o <tytso@....edu>
Subject: [PATCH] ext2fs_zero_blocks: Avoid clearing more blocks than requested

This could cause certain mke2fs feature combinations to result in the
initial blocks of the inode table getting wiped out when the journal
is created.

Signed-off-by: "Theodore Ts'o" <tytso@....edu>
---
 lib/ext2fs/mkjournal.c |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/lib/ext2fs/mkjournal.c b/lib/ext2fs/mkjournal.c
index ca8e733..e55dcbd 100644
--- a/lib/ext2fs/mkjournal.c
+++ b/lib/ext2fs/mkjournal.c
@@ -170,9 +170,11 @@ errcode_t ext2fs_zero_blocks(ext2_filsys fs, blk_t blk, int num,
 	/* OK, do the write loop */
 	j=0;
 	while (j < num) {
-		if (blk % STRIDE_LENGTH)
+		if (blk % STRIDE_LENGTH) {
 			count = STRIDE_LENGTH - (blk % STRIDE_LENGTH);
-		else {
+			if (count > (num - j))
+				count = num - j;
+		} else {
 			count = num - j;
 			if (count > STRIDE_LENGTH)
 				count = STRIDE_LENGTH;
-- 
1.5.6.rc3.1.g36b7.dirty

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