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: <a1e7b180-a3f8-4faf-8815-4b9a76fe2e4f@gmail.com>
Date: Thu, 6 Mar 2025 21:38:29 +0200
From: Tariq Toukan <ttoukan.linux@...il.com>
To: Wentao Liang <vulab@...as.ac.cn>, saeedm@...dia.com, leon@...nel.org,
 tariqt@...dia.com, andrew+netdev@...n.ch, davem@...emloft.net,
 edumazet@...gle.com, kuba@...nel.org, pabeni@...hat.com
Cc: netdev@...r.kernel.org, linux-rdma@...r.kernel.org,
 linux-kernel@...r.kernel.org
Subject: Re: [PATCH v3] net/mlx5: handle errors in mlx5_chains_create_table()



On 06/03/2025 12:43, Wentao Liang wrote:
> In mlx5_chains_create_table(), the return value of mlx5_get_fdb_sub_ns()
> and mlx5_get_flow_namespace() must be checked to prevent NULL pointer
> dereferences. If either function fails, the function should log error
> message with mlx5_core_warn() and return error pointer.
> 
> Fixes: 39ac237ce009 ("net/mlx5: E-Switch, Refactor chains and priorities")
> Signed-off-by: Wentao Liang <vulab@...as.ac.cn>
> ---
>   drivers/net/ethernet/mellanox/mlx5/core/lib/fs_chains.c | 5 +++++
>   1 file changed, 5 insertions(+)
> 

You totally dropped the change log, and the branch target.
Other than that, the patch itself LGTM.

Reviewed-by: Tariq Toukan <tariqt@...dia.com>


> diff --git a/drivers/net/ethernet/mellanox/mlx5/core/lib/fs_chains.c b/drivers/net/ethernet/mellanox/mlx5/core/lib/fs_chains.c
> index a80ecb672f33..711d14dea248 100644
> --- a/drivers/net/ethernet/mellanox/mlx5/core/lib/fs_chains.c
> +++ b/drivers/net/ethernet/mellanox/mlx5/core/lib/fs_chains.c
> @@ -196,6 +196,11 @@ mlx5_chains_create_table(struct mlx5_fs_chains *chains,
>   		ns = mlx5_get_flow_namespace(chains->dev, chains->ns);
>   	}
>   
> +	if (!ns) {
> +		mlx5_core_warn(chains->dev, "Failed to get flow namespace\n");
> +		return ERR_PTR(-EOPNOTSUPP);
> +	}
> +
>   	ft_attr.autogroup.num_reserved_entries = 2;
>   	ft_attr.autogroup.max_num_groups = chains->group_num;
>   	ft = mlx5_create_auto_grouped_flow_table(ns, &ft_attr);


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ