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:	Wed, 23 Oct 2013 19:40:30 -0400
From:	Theodore Ts'o <tytso@....edu>
To:	"Darrick J. Wong" <darrick.wong@...cle.com>
Cc:	linux-ext4@...r.kernel.org
Subject: Re: [PATCH 03/25] mke2fs: don't let resize= turn on resize_inode
 when meta_bg is set

Here's a better way to fix this.  Thanks for pointing out this
problem!

					- Ted

>From cecfb4c04227dd5803c24b311d92a80e91b7b380 Mon Sep 17 00:00:00 2001
From: Theodore Ts'o <tytso@....edu>
Date: Thu, 17 Oct 2013 21:49:16 -0700
Subject: [PATCH] mke2fs: don't let resize= turn on resize_inode when meta_bg
 is set

Passing the "-E resize=NNN" option to mke2fs sets the resize_inode
feature.  However, resize_inode and meta_bg are mutually exclusive;
unfortunately, we check this constraint before we parse the extended
options.  Fix this by moving this check after the calls
parse_extended_opts().

Reported-by: "Darrick J. Wong" <darrick.wong@...cle.com>
Signed-off-by: "Theodore Ts'o" <tytso@....edu>
---
 misc/mke2fs.c | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/misc/mke2fs.c b/misc/mke2fs.c
index cc06a97..64d923a 100644
--- a/misc/mke2fs.c
+++ b/misc/mke2fs.c
@@ -1797,15 +1797,6 @@ profile_error:
 		fs_param.s_feature_ro_compat = 0;
  	}
 
-	if ((fs_param.s_feature_incompat & EXT2_FEATURE_INCOMPAT_META_BG) &&
-	    (fs_param.s_feature_compat & EXT2_FEATURE_COMPAT_RESIZE_INODE)) {
-		fprintf(stderr, _("The resize_inode and meta_bg features "
-				  "are not compatible.\n"
-				  "They can not be both enabled "
-				  "simultaneously.\n"));
-		exit(1);
-	}
-
 	/* Check the user's mkfs options for 64bit */
 	if ((fs_param.s_feature_incompat & EXT4_FEATURE_INCOMPAT_64BIT) &&
 	    !(fs_param.s_feature_incompat & EXT3_FEATURE_INCOMPAT_EXTENTS)) {
@@ -1978,6 +1969,15 @@ profile_error:
 		exit(1);
 	}
 
+	if ((fs_param.s_feature_incompat & EXT2_FEATURE_INCOMPAT_META_BG) &&
+	    (fs_param.s_feature_compat & EXT2_FEATURE_COMPAT_RESIZE_INODE)) {
+		fprintf(stderr, _("The resize_inode and meta_bg features "
+				  "are not compatible.\n"
+				  "They can not be both enabled "
+				  "simultaneously.\n"));
+		exit(1);
+	}
+
 	if (!quiet &&
 	    (fs_param.s_feature_ro_compat & EXT4_FEATURE_RO_COMPAT_BIGALLOC))
 		fprintf(stderr, _("\nWarning: the bigalloc feature is still "
-- 
1.7.12.rc0.22.gcdd159b

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