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, 31 Jul 2012 11:38:47 -0700
From:	Andreas Dilger <adilger@...mcloud.com>
To:	Theodore Ts'o <tytso@....edu>
Cc:	Ext4 Developers List <linux-ext4@...r.kernel.org>,
	"tony@...eyournoodle.com" <tony@...eyournoodle.com>,
	Theodore Ts'o <tytso@....edu>
Subject: Re: [PATCH 7/7] libext2fs: enforce the block group descriptor size in ext2fs_open()

On 2012-07-30, at 14:47, Theodore Ts'o <tytso@....edu> wrote:
> Since various parts of the library depend on the value of s_desc_size,
> check to make sure it is the correct, expected value based on the file
> system features.
> 
> Signed-off-by: "Theodore Ts'o" <tytso@....edu>
> ---
> lib/ext2fs/ext2_err.et.in |  3 +++
> lib/ext2fs/openfs.c       | 15 +++++++++++++++
> 2 files changed, 18 insertions(+)
> 
> diff --git a/lib/ext2fs/ext2_err.et.in b/lib/ext2fs/ext2_err.et.in
> index ccf1894..5987185 100644
> --- a/lib/ext2fs/ext2_err.et.in
> +++ b/lib/ext2fs/ext2_err.et.in
> @@ -443,4 +443,7 @@ ec    EXT2_ET_MMP_CHANGE_ABORT,
> ec    EXT2_ET_MMP_OPEN_DIRECT,
>    "MMP: open with O_DIRECT failed"
> 
> +ec    EXT2_ET_BAD_DESC_SIZE,
> +    "Block group descriptor size incorrect"
> +
>    end
> diff --git a/lib/ext2fs/openfs.c b/lib/ext2fs/openfs.c
> index 482e4ab..fbe9acd 100644
> --- a/lib/ext2fs/openfs.c
> +++ b/lib/ext2fs/openfs.c
> @@ -263,6 +263,21 @@ errcode_t ext2fs_open2(const char *name, const char *io_options,
>        retval = EXT2_ET_CORRUPT_SUPERBLOCK;
>        goto cleanup;
>    }
> +
> +    /* Enforce the block group descriptor size */
> +    if (fs->super->s_feature_incompat & EXT4_FEATURE_INCOMPAT_64BIT) {
> +        if (fs->super->s_desc_size != EXT2_MIN_DESC_SIZE_64BIT) {

It doesn't necessarily make sense to limit this to the minimum size, only that it is at least the minimum size. 

Cheers, Andreas

> +            retval = EXT2_ET_BAD_DESC_SIZE;
> +            goto cleanup;
> +        }
> +    } else {
> +        if (fs->super->s_desc_size &&
> +            fs->super->s_desc_size != EXT2_MIN_DESC_SIZE) {
> +            retval = EXT2_ET_BAD_DESC_SIZE;
> +            goto cleanup;
> +        }
> +    }
> +
>    fs->cluster_ratio_bits = fs->super->s_log_cluster_size -
>        fs->super->s_log_block_size;
>    if (EXT2_BLOCKS_PER_GROUP(fs->super) !=
> -- 
> 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
--
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