From: Mark Bloch <mbloch@nvidia.com>
To: Markus Elfring <Markus.Elfring@web.de>,
Paolo Abeni <pabeni@redhat.com>,
Henry Martin <bsdhenrymartin@gmail.com>,
linux-rdma@vger.kernel.org, netdev@vger.kernel.org
Cc: LKML <linux-kernel@vger.kernel.org>,
Amir Tzin <amirtz@nvidia.com>,
Andrew Lunn <andrew+netdev@lunn.ch>, Aya Levin <ayal@nvidia.com>,
"David S. Miller" <davem@davemloft.net>,
Eric Dumazet <edumazet@google.com>,
Jakub Kicinski <kuba@kernel.org>,
Leon Romanovsky <leon@kernel.org>,
Saeed Mahameed <saeedm@nvidia.com>,
Simon Horman <horms@kernel.org>, Tariq Toukan <tariqt@nvidia.com>
Subject: Re: [PATCH] net/mlx5: Fix null-ptr-deref in mlx5_create_inner_ttc_table()
Date: Tue, 8 Apr 2025 18:01:22 +0300 [thread overview]
Message-ID: <7aa5ceb8-6cf7-4f60-90bf-5a8ace49ecc6@nvidia.com> (raw)
In-Reply-To: <5ddf49e1-eea3-4a20-b6f2-fc365b821dea@web.de>
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
>
next prev parent reply other threads:[~2025-04-08 15:01 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-04-05 10:00 [PATCH v1] " Henry Martin
2025-04-07 8:34 ` [PATCH] " Markus Elfring
2025-04-08 9:53 ` [PATCH v1] " Paolo Abeni
2025-04-08 12:25 ` [PATCH] " Markus Elfring
2025-04-08 15:01 ` Mark Bloch [this message]
2025-04-08 15:20 ` henry martin
2025-04-08 16:42 ` Markus Elfring
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=7aa5ceb8-6cf7-4f60-90bf-5a8ace49ecc6@nvidia.com \
--to=mbloch@nvidia.com \
--cc=Markus.Elfring@web.de \
--cc=amirtz@nvidia.com \
--cc=andrew+netdev@lunn.ch \
--cc=ayal@nvidia.com \
--cc=bsdhenrymartin@gmail.com \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=horms@kernel.org \
--cc=kuba@kernel.org \
--cc=leon@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-rdma@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=saeedm@nvidia.com \
--cc=tariqt@nvidia.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®