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]
Message-ID: <516FAA7E.3040604@rs.jp.nec.com>
Date:	Thu, 18 Apr 2013 17:10:38 +0900
From:	Akira Fujita <a-fujita@...jp.nec.com>
To:	Theodore Tso <tytso@....edu>
CC:	ext4 development <linux-ext4@...r.kernel.org>
Subject: [PATCH] tune2fs: Disallow tune2fs to set inode size larger than block
 size

Disallow tune2fs command to set inode size larger than
block size to ext3 and ext4 (^flex_bg).
Without this patch, tune2fs makes FS unmountable.

Steps to reproduce:

1.Create ext4 without flex_bg (or just create ext3)
  # mke2fs -t ext4 -O ^flex_bg DEV

2.Set inode size larger than block size
  # tune2fs -I 8192 DEV
  
3. We failed to mount FS
  # mount DEV MP
    mount: wrong fs type, bad option, bad superblock on /dev/sda7,
           missing codepage or helper program, or other error
           In some cases useful info is found in syslog - try
           dmesg | tail  or so

Signed-off-by: Akira Fujita <a-fujita@...jp.nec.com>
---
 misc/tune2fs.c | 8 ++++++++
 1 file changed, 8 insertions(+)
diff --git a/misc/tune2fs.c b/misc/tune2fs.c
index c1ecae8..17e5335 100644
--- a/misc/tune2fs.c
+++ b/misc/tune2fs.c
@@ -2370,6 +2370,14 @@ retry_open:
 			rc = 1;
 			goto closefs;
 		}
+		if ((new_inode_size > fs->blocksize) &&
+       			!(fs->super->s_feature_incompat &
+				EXT4_FEATURE_INCOMPAT_FLEX_BG)) {
+			fprintf(stderr, _("Invalid inode size %lu (max %d)\n"),
+				new_inode_size, fs->blocksize);
+			rc = 1;
+			goto closefs;
+		}
 
 		/*
 		 * If inode resize is requested use the
--
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