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:	Mon, 31 Mar 2014 18:12:39 +0400
From:	Dmitry Monakhov <dmonakhov@...nvz.org>
To:	Lukas Czerner <lczerner@...hat.com>, linux-ext4@...r.kernel.org
Cc:	dan.carpenter@...cle.com, Lukas Czerner <lczerner@...hat.com>
Subject: Re: [PATCH 1/2] ext4: Fix flag handling in ext4_split_convert_extents()

On Mon, 31 Mar 2014 11:11:33 +0200, Lukas Czerner <lczerner@...hat.com> wrote:
> In commit 1f0e51771281 "ext4: Introduce FALLOC_FL_ZERO_RANGE flag
> for fallocate" we've introduced wrong flag handling. Fix it.
> 
> Signed-off-by: Lukas Czerner <lczerner@...hat.com>
> ---
>  fs/ext4/extents.c | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/fs/ext4/extents.c b/fs/ext4/extents.c
> index 243a02e..491208c 100644
> --- a/fs/ext4/extents.c
> +++ b/fs/ext4/extents.c
> @@ -3644,13 +3644,13 @@ static int ext4_split_convert_extents(handle_t *handle,
>  	ee_len = ext4_ext_get_actual_len(ex);
>  
>  	/* Convert to unwritten */
> -	if (flags | EXT4_GET_BLOCKS_CONVERT_UNWRITTEN) {
> +	if (flags & EXT4_GET_BLOCKS_CONVERT_UNWRITTEN) {
:).  But how did you found this? 
I think that this type of bugs should be caught by some semantics
analyzer? I've done simple test and sparse(1) owerlooked this,
Also I cant find specific rule for Coccinelle ( if (var | CONST)).

>  		split_flag |= EXT4_EXT_DATA_VALID1;
>  	/* Convert to initialized */
> -	} else if (flags | EXT4_GET_BLOCKS_CONVERT) {
> +	} else if (flags & EXT4_GET_BLOCKS_CONVERT) {
>  		split_flag |= ee_block + ee_len <= eof_block ?
>  			      EXT4_EXT_MAY_ZEROOUT : 0;
> -		split_flag |= (EXT4_EXT_MARK_UNINIT2 & EXT4_EXT_DATA_VALID2);
> +		split_flag |= (EXT4_EXT_MARK_UNINIT2 | EXT4_EXT_DATA_VALID2);
>  	}
>  	flags |= EXT4_GET_BLOCKS_PRE_IO;
>  	return ext4_split_extent(handle, inode, path, map, split_flag, flags);
> -- 
> 1.8.3.1
> 
> --
> 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