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:   Sun, 20 Sep 2020 21:10:57 -0400
From:   Gabriel Krisman Bertazi <krisman@...labora.com>
To:     Daniel Rosenberg <drosen@...gle.com>
Cc:     "Theodore Ts'o" <tytso@....edu>, linux-ext4@...r.kernel.org,
        Jaegeuk Kim <jaegeuk@...nel.org>, Chao Yu <chao@...nel.org>,
        linux-f2fs-devel@...ts.sourceforge.net,
        Eric Biggers <ebiggers@...nel.org>,
        linux-fscrypt@...r.kernel.org,
        Alexander Viro <viro@...iv.linux.org.uk>,
        Andreas Dilger <adilger.kernel@...ger.ca>,
        linux-kernel@...r.kernel.org, linux-fsdevel@...r.kernel.org,
        kernel-team@...roid.com, Eric Biggers <ebiggers@...gle.com>
Subject: Re: [PATCH v12 4/4] ext4: Use generic casefolding support

Daniel Rosenberg <drosen@...gle.com> writes:

> This switches ext4 over to the generic support provided in
> the previous patch.
>
> Since casefolded dentries behave the same in ext4 and f2fs, we decrease
> the maintenance burden by unifying them, and any optimizations will
> immediately apply to both.
>
> Signed-off-by: Daniel Rosenberg <drosen@...gle.com>
> Reviewed-by: Eric Biggers <ebiggers@...gle.com>
>  
>  #ifdef CONFIG_UNICODE
> -	if (EXT4_SB(parent->i_sb)->s_encoding && IS_CASEFOLDED(parent)) {
> +	if (parent->i_sb->s_encoding && IS_CASEFOLDED(parent)) {
>  		if (fname->cf_name.name) {
>  			struct qstr cf = {.name = fname->cf_name.name,
>  					  .len = fname->cf_name.len};
> @@ -2171,9 +2171,6 @@ static int ext4_add_entry(handle_t *handle, struct dentry *dentry,
>  	struct buffer_head *bh = NULL;
>  	struct ext4_dir_entry_2 *de;
>  	struct super_block *sb;
> -#ifdef CONFIG_UNICODE
> -	struct ext4_sb_info *sbi;
> -#endif
>  	struct ext4_filename fname;
>  	int	retval;
>  	int	dx_fallback=0;
> @@ -2190,9 +2187,8 @@ static int ext4_add_entry(handle_t *handle, struct dentry *dentry,
>  		return -EINVAL;
>  
>  #ifdef CONFIG_UNICODE
> -	sbi = EXT4_SB(sb);
> -	if (ext4_has_strict_mode(sbi) && IS_CASEFOLDED(dir) &&
> -	    sbi->s_encoding && utf8_validate(sbi->s_encoding, &dentry->d_name))
> +	if (sb_has_strict_encoding(sb) && IS_CASEFOLDED(dir) &&
> +	    sb->s_encoding && utf8_validate(sb->s_encoding, &dentry->d_name))
>  		return -EINVAL;

hm, just noticed the sb->s_encoding check here is superfluous, since the
has_strict_mode() cannot be true if !s_encoding.  Not related to this
patch though.

Daniel, are you still working on getting this upstream?  The fscrypt
support would be very useful for us. :)

In the hope this will get upstream, as its been flying for a while and
looks correct.

Reviewed-by: Gabriel Krisman Bertazi <krisman@...labora.com>

-- 
Gabriel Krisman Bertazi

Powered by blists - more mailing lists