[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <7aa5ceb8-6cf7-4f60-90bf-5a8ace49ecc6@nvidia.com>
Date: Tue, 8 Apr 2025 18:01:22 +0300
From: Mark Bloch <mbloch@...dia.com>
To: Markus Elfring <Markus.Elfring@....de>, Paolo Abeni <pabeni@...hat.com>,
Henry Martin <bsdhenrymartin@...il.com>, linux-rdma@...r.kernel.org,
netdev@...r.kernel.org
Cc: LKML <linux-kernel@...r.kernel.org>, Amir Tzin <amirtz@...dia.com>,
Andrew Lunn <andrew+netdev@...n.ch>, Aya Levin <ayal@...dia.com>,
"David S. Miller" <davem@...emloft.net>, Eric Dumazet <edumazet@...gle.com>,
Jakub Kicinski <kuba@...nel.org>, Leon Romanovsky <leon@...nel.org>,
Saeed Mahameed <saeedm@...dia.com>, Simon Horman <horms@...nel.org>,
Tariq Toukan <tariqt@...dia.com>
Subject: Re: [PATCH] net/mlx5: Fix null-ptr-deref in
mlx5_create_inner_ttc_table()
On 08/04/2025 15:25, Markus Elfring wrote:
> …
>>> +++ b/drivers/net/ethernet/mellanox/mlx5/core/lib/fs_ttc.c
>>> @@ -655,6 +655,8 @@ struct mlx5_ttc_table *mlx5_create_inner_ttc_table(struct mlx5_core_dev *dev,
>>> }
>>>
>>> ns = mlx5_get_flow_namespace(dev, params->ns_type);
>>> + if (!ns)
>>> + return ERR_PTR(-EOPNOTSUPP);
>>
>> I suspect the ns_type the caller always sets a valid 'ns_type', so the
>> NULL ptr is not really possible here.
>
> Is there a need to mark such a check result as “unlikely”?
>
Please don't. I'm fine with simply adding the check, as
Paolo suggested. When TTC was originally introduced, its
functionality was more limited, and reaching this point in the driver
meant we could be certain the namespace existed. Now that TTC has
become more advanced, adding this check makes sense and I'm okay with
it.
Mark
> Regards,
> Markus
>
Powered by blists - more mailing lists