Unverified Commit aa0f0127 authored by openeuler-ci-bot's avatar openeuler-ci-bot Committed by Gitee
Browse files

!12983 CVE-2024-49968

Merge Pull Request from: @ci-robot 
 
PR sync from: Yongjian Sun <sunyongjian1@huawei.com>
https://mailweb.openeuler.org/hyperkitty/list/kernel@openeuler.org/message/V45AL645D5FGOZMMH4PRSPMFA7G4IK5G/ 
*** BLURB HERE ***

Gabriel Krisman Bertazi (1):
  [Backport] ext4: fix error message when rejecting the default hash

Lizhi Xu (1):
  [Backport] ext4: filesystems without casefold feature cannot be
    mounted with siphash


-- 
2.39.2
 
https://gitee.com/src-openeuler/kernel/issues/IAYR8N 
 
Link:https://gitee.com/openeuler/kernel/pulls/12983

 

Reviewed-by: default avatarZhang Peng <zhangpeng362@huawei.com>
Signed-off-by: default avatarZhang Peng <zhangpeng362@huawei.com>
parents 86b0589e a85d2515
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -2456,6 +2456,7 @@ static inline __le16 ext4_rec_len_to_disk(unsigned len, unsigned blocksize)
#define DX_HASH_HALF_MD4_UNSIGNED	4
#define DX_HASH_TEA_UNSIGNED		5
#define DX_HASH_SIPHASH			6
#define DX_HASH_LAST 			DX_HASH_SIPHASH

static inline u32 ext4_chksum(struct ext4_sb_info *sbi, u32 crc,
			      const void *address, unsigned int length)
+17 −3
Original line number Diff line number Diff line
@@ -5227,16 +5227,27 @@ static int ext4_load_super(struct super_block *sb, ext4_fsblk_t *lsb,
	return ret;
}

static void ext4_hash_info_init(struct super_block *sb)
static int ext4_hash_info_init(struct super_block *sb)
{
	struct ext4_sb_info *sbi = EXT4_SB(sb);
	struct ext4_super_block *es = sbi->s_es;
	unsigned int i;

	sbi->s_def_hash_version = es->s_def_hash_version;

	if (sbi->s_def_hash_version > DX_HASH_LAST) {
		ext4_msg(sb, KERN_ERR,
			 "Invalid default hash set in the superblock");
		return -EINVAL;
	} else if (sbi->s_def_hash_version == DX_HASH_SIPHASH) {
		ext4_msg(sb, KERN_ERR,
			 "SIPHASH is not a valid default hash value");
		return -EINVAL;
	}

	for (i = 0; i < 4; i++)
		sbi->s_hash_seed[i] = le32_to_cpu(es->s_hash_seed[i]);

	sbi->s_def_hash_version = es->s_def_hash_version;
	if (ext4_has_feature_dir_index(sb)) {
		i = le32_to_cpu(es->s_flags);
		if (i & EXT2_FLAGS_UNSIGNED_HASH)
@@ -5254,6 +5265,7 @@ static void ext4_hash_info_init(struct super_block *sb)
#endif
		}
	}
	return 0;
}

static int ext4_block_group_meta_init(struct super_block *sb, int silent)
@@ -5401,7 +5413,9 @@ static int __ext4_fill_super(struct fs_context *fc, struct super_block *sb)
	if (err)
		goto failed_mount;

	ext4_hash_info_init(sb);
	err = ext4_hash_info_init(sb);
	if (err)
		goto failed_mount;

	err = ext4_handle_clustersize(sb);
	if (err)