Skip to content

net/mlx5: fix several correctness bugs

Stephen Hemminger dpdk-dev 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest4 patches 5 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/4net/mlx5: fix NULL dereference in Tx queue startdrivers/net/mlx5/mlx5_trigger.c+2 -11 reply
2/4net/mlx5: fix counter leak in hairpin queue setupdrivers/net/mlx5/mlx5.c+2 -01 reply
3/4net/mlx5: fix use-after-free in ASO management initdrivers/net/mlx5/mlx5.c+2 -01 reply
4/4net/mlx5: fix counter truncation in queue counter readdrivers/net/mlx5/mlx5.c+8 -11 reply

Reviews trailers per patch

All 4 patches have a Reviewed-by or Acked-by.

PatchDariusz Sosnowski
1/4A-b
2/4A-b
3/4A-b
4/4A-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v1 thread

Cover letter [RFT 0/4] net/mlx5: fix several correctness bugs

Found these during a code review of the mlx5 driver. I don't have ConnectX hardware to test, so sending as RFC for maintainers to verify and test.

Summary:

1/4 NULL pointer dereference in mlx5_txq_start() - txq_ctrl is
dereferenced before the NULL check one line later.

2/4 DevX queue counter leak in hairpin counter setup - the
counter object is not freed when the subsequent modify call fails.

3/4 Use-after-free in ASO age and CT management init - on queue
init failure the management structure is freed but the pointer is not NULLed, so a retry dereferences freed memory.

4/4 64-bit counter truncation - uint64_t* cast to uint32_t*
leaves the upper 32 bits uninitialised, producing wrong hairpin queue statistics.

Stephen Hemminger (4):
net/mlx5: fix NULL dereference in Tx queue start net/mlx5: fix counter leak in hairpin queue setup net/mlx5: fix use-after-free in ASO management init net/mlx5: fix counter truncation in queue counter read

 drivers/net/mlx5/mlx5.c         | 13 ++++++++++++-
 drivers/net/mlx5/mlx5_trigger.c |  3 ++-
 2 files changed, 14 insertions(+), 2 deletions(-)
Signature · 1 line
2.51.0