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>] [day] [month] [year] [list]
Date:	Wed, 7 Dec 2011 01:40:39 -0700
From:	Andreas Dilger <adilger@...ger.ca>
To:	Andreas Dilger <adilger.kernel@...ger.ca>
Cc:	"Darrick J. Wong" <djwong@...ibm.com>,
	Theodore Tso <tytso@....edu>,
	Amir Goldstein <amir73il@...il.com>,
	Mingming Cao <cmm@...ibm.com>,
	ext4 development <linux-ext4@...r.kernel.org>
Subject: Re: [PATCH 03/22] ext4: Record the checksum algorithm in use in the superblock

On 2011-12-06, at 10:01 PM, Andreas Dilger wrote:
> On 2011-11-28, at 4:26 PM, Darrick J. Wong wrote:
>> Record the type of checksum algorithm we're using for metadata in the
>> superblock, in case we ever want/need to change the algorithm.
>> 
>> @@ -982,6 +982,9 @@ extern void ext4_set_bits(void *bm, int cur, int len);
>> +/* Metadata checksum algorithm codes */
>> +#define EXT4_CRC32C_CHKSUM		1
> 
> It might make sense to add a constant for the existing CRC16 type:
> 
> #define EXT4_CRC16_CHKSUM    0
> #define EXT4_CRC32C_CHKSUM   1
> #define EXT4_CHKSUM_MAX      1

Never mind, I had EXT4_FEATURE_INCOMPAT_BG_USE_META_CSUM on the brain.
CRC16 is completely unrelated to EXT4_FEATURE_RO_COMPAT_METADATA_CSUM.

>> +static int ext4_verify_csum_type(struct super_block *sb,
>> +				 struct ext4_super_block *es)
>> +{
>> +	if (!EXT4_HAS_RO_COMPAT_FEATURE(sb,
>> +					EXT4_FEATURE_RO_COMPAT_METADATA_CSUM))
>> +		return 1;
>> +
>> +	return es->s_checksum_type == EXT4_CRC32C_CHKSUM;
>> +}
> 
> Then this checks "return es->s_checksum_type <= EXT4_CHKSUM_MAX;".
> 
>> @@ -3182,6 +3192,14 @@ static int ext4_fill_super(struct super_block *sb, 
>> +	/* Check for a known checksum algorithm */
>> +	if (!ext4_verify_csum_type(sb, es)) {
>> +		ext4_msg(sb, KERN_ERR, "VFS: Found ext4 filesystem with "
>> +			 "unknown checksum algorithm.");
> 
> It would be useful if this error message printed the checksum type.

This is still a valid comment.

Cheers, Andreas





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