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] [day] [month] [year] [list]
Message-ID: <4993C166.6020905@cn.fujitsu.com>
Date:	Thu, 12 Feb 2009 14:27:50 +0800
From:	Wei Yongjun <yjwei@...fujitsu.com>
To:	Theodore Tso <tytso@....edu>
CC:	akpm@...ux-foundation.org, linux-ext4@...r.kernel.org
Subject: Re: + ext2-fix-support-for-empty-directory-blocks-in-64k-blocksize-filesys
 tems.patch added to -mm tree

Theodore Tso wrote:
> On Tue, Feb 10, 2009 at 02:57:58PM -0800, akpm@...ux-foundation.org wrote:
>   
>> The patch titled
>>      ext2: fix support for empty directory blocks in 64k blocksize filesystems
>> has been added to the -mm tree.  Its filename is
>>      ext2-fix-support-for-empty-directory-blocks-in-64k-blocksize-filesystems.patch
>>     
>
> NACK.  The commit description is incomplete, we need to discuss more
> what's the best way of handling this.  See the discussion around the
> ext4 patch on linux-ext4 for more details.
>
> This patch is entirely moot for ext2 in any case, since
> EXT2_MAX_BLOCK_SIZE was never changed from 4096.
>   

Hi,  Ted

If you are right, I think this patch is necessary.

[PATCH] ext2: Fix to check unsupported filesystem blocksize

EXT2-fs defined that the max blocksize is:
        #define EXT2_MAX_BLOCK_SIZE	4960
and the min blocksize is:
        #define EXT2_MIN_BLOCK_SIZE	1024

But never check this in ext2_fill_super(). So mount will
always success even if the block size is larger than 4096.

This patch fixed the problem.

Signed-off-by: Wei Yongjun <yjwei@...fujitsu.com>
---
 fs/ext2/super.c |    8 ++++++++
 1 files changed, 8 insertions(+), 0 deletions(-)

diff --git a/fs/ext2/super.c b/fs/ext2/super.c
index da8bdea..36cdfd6 100644
--- a/fs/ext2/super.c
+++ b/fs/ext2/super.c
@@ -873,6 +873,14 @@ static int ext2_fill_super(struct super_block *sb, void *data, int silent)
 
 	blocksize = BLOCK_SIZE << le32_to_cpu(sbi->s_es->s_log_block_size);
 
+	if (blocksize < EXT2_MIN_BLOCK_SIZE ||
+	    blocksize > EXT2_MAX_BLOCK_SIZE) {
+		printk(KERN_ERR
+		       "EXT2-fs: Unsupported filesystem blocksize %d on %s.\n",
+		       blocksize, sb->s_id);
+		goto failed_mount;
+	}
+
 	if (ext2_use_xip(sb) && blocksize != PAGE_SIZE) {
 		if (!silent)
 			printk("XIP: Unsupported blocksize\n");
-- 
1.5.3.8




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