* [PATCH net] net/mlx5e: Fix AF_XDP TX timestamp teardown NULL dereference
@ 2026-09-26 16:53 prathameshdeshpande7
2026-09-28 12:15 ` Tariq Toukan
2026-10-01 1:00 ` patchwork-bot+netdevbpf
0 siblings, 2 replies; 3+ messages in thread
From: prathameshdeshpande7 @ 2026-09-26 16:53 UTC (permalink / raw)
To: tariqt; +Cc: saeedm, leon, mbloch, sdf, netdev, bpf, Prathamesh Deshpande
From: Prathamesh Deshpande <prathameshdeshpande7@gmail.com>
During XSK TX queue teardown, outstanding descriptors are completed
without a CQE. If one requested a TX timestamp, the completion path
passes that NULL CQE to mlx5e_xsk_fill_timestamp(), which dereferences
it.
Return zero when no CQE is available, indicating that teardown did not
produce a TX timestamp.
Fixes: ec706a860eba ("net/mlx5e: Implement AF_XDP TX timestamp and checksum offload")
Signed-off-by: Prathamesh Deshpande <prathameshdeshpande7@gmail.com>
---
drivers/net/ethernet/mellanox/mlx5/core/en/xdp.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en/xdp.c b/drivers/net/ethernet/mellanox/mlx5/core/en/xdp.c
index 77ea51bfbaae..2cca20e1b9b7 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/en/xdp.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/en/xdp.c
@@ -293,6 +293,9 @@ static u64 mlx5e_xsk_fill_timestamp(void *_priv)
struct mlx5e_xsk_tx_complete *priv = _priv;
u64 ts;
+ if (!priv->cqe)
+ return 0;
+
ts = get_cqe_ts(priv->cqe);
if (mlx5_is_real_time_rq(priv->cq->mdev) || mlx5_is_real_time_sq(priv->cq->mdev))
--
2.43.0
^ permalink raw reply related [flat|nested] 3+ messages in thread* Re: [PATCH net] net/mlx5e: Fix AF_XDP TX timestamp teardown NULL dereference
2026-09-26 16:53 [PATCH net] net/mlx5e: Fix AF_XDP TX timestamp teardown NULL dereference prathameshdeshpande7
@ 2026-09-28 12:15 ` Tariq Toukan
2026-10-01 1:00 ` patchwork-bot+netdevbpf
1 sibling, 0 replies; 3+ messages in thread
From: Tariq Toukan @ 2026-09-28 12:15 UTC (permalink / raw)
To: prathameshdeshpande7, tariqt; +Cc: saeedm, leon, mbloch, sdf, netdev, bpf
On 26/09/2026 19:53, prathameshdeshpande7@gmail.com wrote:
> From: Prathamesh Deshpande <prathameshdeshpande7@gmail.com>
>
> During XSK TX queue teardown, outstanding descriptors are completed
> without a CQE. If one requested a TX timestamp, the completion path
> passes that NULL CQE to mlx5e_xsk_fill_timestamp(), which dereferences
> it.
>
> Return zero when no CQE is available, indicating that teardown did not
> produce a TX timestamp.
>
> Fixes: ec706a860eba ("net/mlx5e: Implement AF_XDP TX timestamp and checksum offload")
>
> Signed-off-by: Prathamesh Deshpande <prathameshdeshpande7@gmail.com>
> ---
> drivers/net/ethernet/mellanox/mlx5/core/en/xdp.c | 3 +++
> 1 file changed, 3 insertions(+)
>
> diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en/xdp.c b/drivers/net/ethernet/mellanox/mlx5/core/en/xdp.c
> index 77ea51bfbaae..2cca20e1b9b7 100644
> --- a/drivers/net/ethernet/mellanox/mlx5/core/en/xdp.c
> +++ b/drivers/net/ethernet/mellanox/mlx5/core/en/xdp.c
> @@ -293,6 +293,9 @@ static u64 mlx5e_xsk_fill_timestamp(void *_priv)
> struct mlx5e_xsk_tx_complete *priv = _priv;
> u64 ts;
>
> + if (!priv->cqe)
> + return 0;
> +
> ts = get_cqe_ts(priv->cqe);
>
> if (mlx5_is_real_time_rq(priv->cq->mdev) || mlx5_is_real_time_sq(priv->cq->mdev))
Reviewed-by: Tariq Toukan <tariqt@nvidia.com>
Thanks.
^ permalink raw reply [flat|nested] 3+ messages in thread* Re: [PATCH net] net/mlx5e: Fix AF_XDP TX timestamp teardown NULL dereference
2026-09-26 16:53 [PATCH net] net/mlx5e: Fix AF_XDP TX timestamp teardown NULL dereference prathameshdeshpande7
2026-09-28 12:15 ` Tariq Toukan
@ 2026-10-01 1:00 ` patchwork-bot+netdevbpf
1 sibling, 0 replies; 3+ messages in thread
From: patchwork-bot+netdevbpf @ 2026-10-01 1:00 UTC (permalink / raw)
To: Prathamesh Deshpande; +Cc: tariqt, saeedm, leon, mbloch, sdf, netdev, bpf
Hello:
This patch was applied to netdev/net.git (main)
by Jakub Kicinski <kuba@kernel.org>:
On Sat, 26 Sep 2026 17:53:57 +0100 you wrote:
> From: Prathamesh Deshpande <prathameshdeshpande7@gmail.com>
>
> During XSK TX queue teardown, outstanding descriptors are completed
> without a CQE. If one requested a TX timestamp, the completion path
> passes that NULL CQE to mlx5e_xsk_fill_timestamp(), which dereferences
> it.
>
> [...]
Here is the summary with links:
- [net] net/mlx5e: Fix AF_XDP TX timestamp teardown NULL dereference
https://git.kernel.org/netdev/net/c/7b97273cbebe
You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2026-10-01 1:00 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-09-26 16:53 [PATCH net] net/mlx5e: Fix AF_XDP TX timestamp teardown NULL dereference prathameshdeshpande7
2026-09-28 12:15 ` Tariq Toukan
2026-10-01 1:00 ` patchwork-bot+netdevbpf
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox