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:	Wed, 10 Jun 2009 09:52:26 +0300
From:	Yevgeny Petrilin <yevgenyp@...lanox.co.il>
To:	Roland Dreier <rdreier@...co.com>
CC:	netdev@...r.kernel.org, general@...ts.openfabrics.org,
	Christoph Lameter <cl@...ux-foundation.org>
Subject: Re: [ofa-general][PATCH] mlx4: FIX error flow when initializing EQ
 table

Roland Dreier wrote:
>  > If mlx4_create_eq() would fail for one of EQ's assigned for
>  > completion handling, the code would try to free the same EQ
>  > we failed to create.
>  > The crash was found by Christoph Lameter
> 
> Thanks, good catch.  However looking at the code it seems that a simpler
> way to fix this would be as below.  Can you confirm that this works too?
> ---
>  drivers/net/mlx4/eq.c |    6 +++---
>  1 files changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/net/mlx4/eq.c b/drivers/net/mlx4/eq.c
> index 8830dcb..033817e 100644
> --- a/drivers/net/mlx4/eq.c
> +++ b/drivers/net/mlx4/eq.c
> @@ -677,12 +677,12 @@ err_out_async:
>  	mlx4_free_eq(dev, &priv->eq_table.eq[dev->caps.num_comp_vectors]);
>  
>  err_out_comp:
> -	i = dev->caps.num_comp_vectors - 1;
> +	i = dev->caps.num_comp_vectors;
>  
>  err_out_unmap:
> -	while (i >= 0) {
> -		mlx4_free_eq(dev, &priv->eq_table.eq[i]);
> +	while (i > 0) {
>  		--i;
> +		mlx4_free_eq(dev, &priv->eq_table.eq[i]);
>  	}
>  	mlx4_unmap_clr_int(dev);
>  	mlx4_free_irqs(dev);
> 
Yes, it also works
Yevgeny
--
To unsubscribe from this list: send the line "unsubscribe netdev" 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