[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <d78fa6dc-5820-46b6-9b7d-0986f9a70da2@gmail.com>
Date: Thu, 3 Apr 2025 21:32:14 +0300
From: Tariq Toukan <ttoukan.linux@...il.com>
To: Charles Han(韩春超) <hanchunchao@...pur.com>,
"przemyslaw.kitszel@...el.com" <przemyslaw.kitszel@...el.com>
Cc: "netdev@...r.kernel.org" <netdev@...r.kernel.org>,
"linux-rdma@...r.kernel.org" <linux-rdma@...r.kernel.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
"saeedm@...dia.com" <saeedm@...dia.com>, "leon@...nel.org"
<leon@...nel.org>, "andrew+netdev@...n.ch" <andrew+netdev@...n.ch>,
"davem@...emloft.net" <davem@...emloft.net>,
"edumazet@...gle.com" <edumazet@...gle.com>,
"kuba@...nel.org" <kuba@...nel.org>, "pabeni@...hat.com"
<pabeni@...hat.com>, "markzhang@...dia.com" <markzhang@...dia.com>,
"mbloch@...dia.com" <mbloch@...dia.com>, Tariq Toukan <tariqt@...dia.com>
Subject: Re: [PATCH] net/mlx5: fix potential null dereference when enable
shared FDB
On 03/04/2025 17:03, Tariq Toukan wrote:
>
>
> On 03/04/2025 12:52, Charles Han(韩春超) wrote:
>> -ENXIO indicates "No such device or address". I've found that in mlx5/
>> core, if mlx5_get_flow_namespace() returns null, it basically returns
>> -EOPNOTSUPP.
>>
>
> Please do not top-post.
>
> +1.
> If namespace is not found it's due to lack of support.
>
>
>> -----邮件原件-----
>> 发件人: Przemek Kitszel <przemyslaw.kitszel@...el.com>
>> 发送时间: 2025年4月2日 19:02
>> 收件人: Charles Han(韩春超) <hanchunchao@...pur.com>
>> 抄送: netdev@...r.kernel.org; linux-rdma@...r.kernel.org; linux-
>> kernel@...r.kernel.org; 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;
>> markzhang@...dia.com; mbloch@...dia.com
>> 主题: Re: [PATCH] net/mlx5: fix potential null dereference when enable
>> shared FDB
>>
>> On 4/2/25 11:43, Charles Han wrote:
>>> mlx5_get_flow_namespace() may return a NULL pointer, dereferencing it
>>> without NULL check may lead to NULL dereference.
>>> Add a NULL check for ns.
>>>
>>> Fixes: db202995f503 ("net/mlx5: E-Switch, add logic to enable shared
>>> FDB")
>>> Signed-off-by: Charles Han <hanchunchao@...pur.com>
>
> Acked-by: Tariq Toukan <tariqt@...dia.com>
>
Re-visiting this...
See comment below.
>>> ---
>>> .../net/ethernet/mellanox/mlx5/core/eswitch_offloads.c | 10 ++++++
>>> ++++
>>> drivers/net/ethernet/mellanox/mlx5/core/fs_cmd.c | 5 +++++
>>> 2 files changed, 15 insertions(+)
>>>
>>> diff --git
>>> a/drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads.c
>>> b/drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads.c
>>> index a6a8eea5980c..dc58e4c2d786 100644
>>> --- a/drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads.c
>>> +++ b/drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads.c
>>> @@ -2667,6 +2667,11 @@ static int esw_set_slave_root_fdb(struct
>>> mlx5_core_dev *master,
>>> if (master) {
>>> ns = mlx5_get_flow_namespace(master,
>>> MLX5_FLOW_NAMESPACE_FDB);
>>> + if (!ns) {
>>> + mlx5_core_warn(master, "Failed to get flow namespace\n");
Use esw_warn(), for all new instances.
Powered by blists - more mailing lists