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]
Message-ID: <fe8cdf3bede40b46716bf94b0760db6d47a13187.camel@redhat.com>
Date:   Tue, 06 Apr 2021 17:13:36 -0400
From:   Laurence Oberman <loberman@...hat.com>
To:     Colin King <colin.king@...onical.com>,
        Boris Pismenny <borisp@...dia.com>,
        Saeed Mahameed <saeedm@...dia.com>,
        Leon Romanovsky <leon@...nel.org>,
        "David S . Miller" <davem@...emloft.net>,
        Jakub Kicinski <kuba@...nel.org>,
        Raed Salem <raeds@...dia.com>, Huy Nguyen <huyn@...lanox.com>,
        netdev@...r.kernel.org, linux-rdma@...r.kernel.org
Cc:     kernel-janitors@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH][next] net/mlx5: Fix bit-wise and with zero

On Tue, 2021-04-06 at 17:53 +0100, Colin King wrote:
> From: Colin Ian King <colin.king@...onical.com>
> 
> The bit-wise and of the action field with
> MLX5_ACCEL_ESP_ACTION_DECRYPT
> is incorrect as MLX5_ACCEL_ESP_ACTION_DECRYPT is zero and not
> intended
> to be a bit-flag. Fix this by using the == operator as was originally
> intended.
> 
> Addresses-Coverity: ("Logically dead code")
> Fixes: 7dfee4b1d79e ("net/mlx5: IPsec, Refactor SA handle creation
> and destruction")
> Signed-off-by: Colin Ian King <colin.king@...onical.com>
> ---
>  drivers/net/ethernet/mellanox/mlx5/core/fpga/ipsec.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/net/ethernet/mellanox/mlx5/core/fpga/ipsec.c
> b/drivers/net/ethernet/mellanox/mlx5/core/fpga/ipsec.c
> index d43a05e77f67..0b19293cdd74 100644
> --- a/drivers/net/ethernet/mellanox/mlx5/core/fpga/ipsec.c
> +++ b/drivers/net/ethernet/mellanox/mlx5/core/fpga/ipsec.c
> @@ -850,7 +850,7 @@ mlx5_fpga_ipsec_release_sa_ctx(struct
> mlx5_fpga_ipsec_sa_ctx *sa_ctx)
>  		return;
>  	}
>  
> -	if (sa_ctx->fpga_xfrm->accel_xfrm.attrs.action &
> +	if (sa_ctx->fpga_xfrm->accel_xfrm.attrs.action ==
>  	    MLX5_ACCEL_ESP_ACTION_DECRYPT)
>  		ida_free(&fipsec->halloc, sa_ctx->sa_handle);
>  

Looks correct to me with enum mlx5_accel_esp_action action;

Reviewed-by Laurence Oberman <loberman@...hat.com>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ