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, 25 Apr 2022 08:48:27 -0400 (EDT)
From:   Mikulas Patocka <mpatocka@...hat.com>
To:     Dan Carpenter <dan.carpenter@...cle.com>
cc:     Alasdair Kergon <agk@...hat.com>,
        Mike Snitzer <snitzer@...nel.org>, dm-devel@...hat.com,
        Milan Broz <gmazyland@...il.com>, linux-kernel@...r.kernel.org,
        kernel-janitors@...r.kernel.org
Subject: Re: [PATCH] dm integrity: fix error code in dm_integrity_ctr()

Thanks for finding it.


On Mon, 25 Apr 2022, Dan Carpenter wrote:

> The "r" variable shadows an earlier "r" that has function scope.  It
> means that we accidentally return success instead of an error code.
> Smatch has a warning for this:
> 
> 	drivers/md/dm-integrity.c:4503 dm_integrity_ctr()
> 	warn: missing error code 'r'
> 
> Fixes: 7eada909bfd7 ("dm: add integrity target")
> Signed-off-by: Dan Carpenter <dan.carpenter@...cle.com>

add:

Cc: stable@...r.kernel.org
Reviewed-by: Mikulas Patocka <mpatocka@...hat.com>

> ---
>  drivers/md/dm-integrity.c | 2 --
>  1 file changed, 2 deletions(-)
> 
> diff --git a/drivers/md/dm-integrity.c b/drivers/md/dm-integrity.c
> index 36ae30b73a6e..3d5a0ce123c9 100644
> --- a/drivers/md/dm-integrity.c
> +++ b/drivers/md/dm-integrity.c
> @@ -4494,8 +4494,6 @@ static int dm_integrity_ctr(struct dm_target *ti, unsigned argc, char **argv)
>  	}
>  
>  	if (should_write_sb) {
> -		int r;
> -
>  		init_journal(ic, 0, ic->journal_sections, 0);
>  		r = dm_integrity_failed(ic);
>  		if (unlikely(r)) {
> -- 
> 2.35.1
> 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ