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:	Thu, 22 Dec 2011 17:30:22 +0900
From:	Akira Fujita <a-fujita@...jp.nec.com>
To:	Theodore Tso <tytso@....edu>,
	ext4 development <linux-ext4@...r.kernel.org>
Subject: [PATCH 1/2] e2fsprogs: fix data lost with mke2fs -S

If we run the mke2fs with the -S option and the uninit_bg feature
simultaneously, the mke2fs marks blockgroups as uninitialized.
The e2fsck which run immediately after the mke2fs
removes all of the files.

To avoid this, the patch prohibits user from
setting the -S option and the uninit_bg feature simultaneously.

Usage example of the mke2fsk -S is as follows:

1. mke2fs -t ext4 -S -O ^uninit_bg DEV
2. tune2fs -O uninit_bg DEV 
3. e2fsck DEV

#2 is not necessary only if the uninit_bg feature is not set
to ext4 originally. 

Signed-off-by: Akira Fujita <a-fujita@...jp.nec.com>
---
 misc/mke2fs.c |   10 ++++++++++
 1 files changed, 10 insertions(+), 0 deletions(-)

diff --git a/misc/mke2fs.c b/misc/mke2fs.c
index 0ef2531..19f3684 100644
--- a/misc/mke2fs.c
+++ b/misc/mke2fs.c
@@ -1676,6 +1676,16 @@ profile_error:
        if (tmp)
                free(tmp);

+       if (super_only == 1 &&
+           EXT2_HAS_RO_COMPAT_FEATURE((&fs_param),
+                                       EXT4_FEATURE_RO_COMPAT_GDT_CSUM)) {
+               fprintf(stderr, _("The -S option and the uninit_bg feature "
+                                 "are not compatible.\n"
+                                 "They can not be set both "
+                                 "simultaneously.\n"));
+               exit(1);
+       }
+
        /*
         * We now need to do a sanity check of fs_blocks_count for
         * 32-bit vs 64-bit block number support.
--
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