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] [day] [month] [year] [list]
Date:	Mon, 10 Sep 2012 13:35:58 -0300
From:	Carlos Maiolino <cmaiolino@...hat.com>
To:	linux-ext4@...r.kernel.org
Subject: Re: [PATCH] ext4: fix possible non-initialized variable

> I'm afraid this doesn't fix it.  So now err is init to 0, but then:
> 
>         err = ext4_map_blocks(handle, inode, &map,
>                               create ? EXT4_GET_BLOCKS_CREATE : 0);
> 
> so err is immediately reset to whatever ext4_map_blocks returns, which might be 0.
> If so, we don't go down this case:
> 
>         if (err < 0)
>                 *errp = err;
> 
> and we do go down this case,
> 
>         if (err <= 0)
>                 return NULL;
> 
> in which case we return with *errp unset.
> 
> It needs something like this, though maybe this could be made prettier/clearer.
> 
> +	*errp = 0;
>  	if (err < 0)
>  		*errp = err;
>  	if (err <= 0)
>  		return NULL;
> -	*errp = 0;

Agreed. just initializing err variable into ext4_getblk() won't ensure *errp
will be filled with 'err' content. Thanks. I'll wait for some extra inputs and
see if is there anything else people have in mind, then release a v2 patch
-- 
--Carlos
--
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