Netdev Archive mirror
 help / color / mirror / Atom feed
From: Vadim Fedorenko <vadfed@meta.com>
To: Jakub Kicinski <kuba@kernel.org>,
	Vadim Fedorenko <vadim.fedorenko@linux.dev>,
	Rahul Rameshbabu <rrameshbabu@nvidia.com>,
	"Tariq Toukan" <ttoukan.linux@gmail.com>,
	Gal Pressman <gal@nvidia.com>,
	"Saeed Mahameed" <saeed@kernel.org>
Cc: Vadim Fedorenko <vadfed@meta.com>, <netdev@vger.kernel.org>
Subject: [PATCH net v5 0/2] mlx5: ptp fifo bugfixes
Date: Thu, 2 Feb 2023 09:13:53 -0800	[thread overview]
Message-ID: <20230202171355.548529-1-vadfed@meta.com> (raw)

Simple FIFO implementation for PTP queue has several bugs which lead to
use-after-free and skb leaks. This series fixes the issues and adds new
checks for this FIFO implementation to uncover the same problems in
future.

v4 -> v5:
  Change check to WARN_ON_ONCE() in mlx5e_skb_fifo_pop()
  Change the check of OOO cqe as Jakub provided corner case
  Move OOO logic into separate function and add counter
v3 -> v4:
  Change pr_err to mlx5_core_err_rl per suggest
  Removed WARN_ONCE on fifo push because has_room() should catch the
  issue
v2 -> v3:
  Rearrange patches order and rephrase commit messages
  Remove counters as Gal confirmed FW bug, use KERN_ERR message instead
  Provide proper budget to napi_consume_skb as Jakub suggested
v1 -> v2:
  Update Fixes tag to proper commit.
  Change debug line to avoid double print of function name

Vadim Fedorenko (2):
  mlx5: fix skb leak while fifo resync and push
  mlx5: fix possible ptp queue fifo use-after-free

 .../net/ethernet/mellanox/mlx5/core/en/ptp.c  | 25 ++++++++++++++++---
 .../net/ethernet/mellanox/mlx5/core/en/txrx.h |  4 ++-
 .../ethernet/mellanox/mlx5/core/en_stats.c    |  1 +
 .../ethernet/mellanox/mlx5/core/en_stats.h    |  1 +
 4 files changed, 27 insertions(+), 4 deletions(-)

-- 
2.30.2


             reply	other threads:[~2023-02-02 17:16 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-02-02 17:13 Vadim Fedorenko [this message]
2023-02-02 17:13 ` [PATCH net v5 1/2] mlx5: fix skb leak while fifo resync and push Vadim Fedorenko
2023-02-02 17:13 ` [PATCH net v5 2/2] mlx5: fix possible ptp queue fifo use-after-free Vadim Fedorenko
2023-02-02 18:53 ` [PATCH net v5 0/2] mlx5: ptp fifo bugfixes Saeed Mahameed

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=20230202171355.548529-1-vadfed@meta.com \
    --to=vadfed@meta.com \
    --cc=gal@nvidia.com \
    --cc=kuba@kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=rrameshbabu@nvidia.com \
    --cc=saeed@kernel.org \
    --cc=ttoukan.linux@gmail.com \
    --cc=vadim.fedorenko@linux.dev \
    /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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).