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]
Message-Id: <D7E9803B-18EC-4E23-BD3A-4A3B7802C735@dilger.ca>
Date:	Tue, 8 Jul 2014 17:30:10 -0600
From:	Andreas Dilger <adilger@...ger.ca>
To:	Azat Khuzhin <a3at.mail@...il.com>
Cc:	linux-ext4@...r.kernel.org, tytso@....edu
Subject: Re: [PATCH 1/3] journal: use consts instead of 1024 and add helper for journal with 1k blocksize

On Jul 8, 2014, at 2:41 PM, Azat Khuzhin <a3at.mail@...il.com> wrote:
> Use EXT2_MIN_BLOCK_SIZE/JFS_MIN_JOURNAL_BLOCKS instead of hardcoded 1024
> when it is okay, and also add a helper ext2fs_journal_sb_start() that
> will return start of journal sb with special case for fs with 1k block
> size.

Seems like a good idea, but an issue below.

> diff --git a/lib/ext2fs/mkjournal.c b/lib/ext2fs/mkjournal.c
> index 884d9c0..068eed7 100644
> --- a/lib/ext2fs/mkjournal.c
> +++ b/lib/ext2fs/mkjournal.c
> @@ -75,10 +75,7 @@ errcode_t ext2fs_create_journal_superblock(ext2_filsys fs,
> 	if (fs->super->s_feature_incompat &
> 	    EXT3_FEATURE_INCOMPAT_JOURNAL_DEV) {
> 		jsb->s_nr_users = 0;
> -		if (fs->blocksize == 1024)
> -			jsb->s_first = htonl(3);
> -		else
> -			jsb->s_first = htonl(2);
> +		jsb->s_first = ext2fs_journal_sb_start(fs->blocksize) + 1;

This looks like it is missing the htonl() conversion, and will break the on-disk format?

The JBD code stores all data on-disk in big-endian to ensure that it is converted properly
on the most common little-endian systems, and will therefore also work on big-endian systems.

Cheers, Andreas






Download attachment "signature.asc" of type "application/pgp-signature" (834 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ