All of lore.kernel.org
 help / color / mirror / Atom feed
From: Tariq Toukan <ttoukan.linux@gmail.com>
To: Vadim Fedorenko <vfedorenko@novek.ru>,
	Vadim Fedorenko <vadfed@fb.com>, Aya Levin <ayal@nvidia.com>,
	Saeed Mahameed <saeedm@nvidia.com>,
	Jakub Kicinski <kuba@kernel.org>, Gal Pressman <gal@nvidia.com>
Cc: Vadim Fedorenko <vadfed@meta.com>, netdev@vger.kernel.org
Subject: Re: [PATCH net v3 1/2] mlx5: fix skb leak while fifo resync and push
Date: Thu, 26 Jan 2023 08:33:51 +0200	[thread overview]
Message-ID: <1b9571f2-eadd-5cda-a368-78d6ce4ae873@gmail.com> (raw)
In-Reply-To: <20230126010206.13483-2-vfedorenko@novek.ru>



On 26/01/2023 3:02, Vadim Fedorenko wrote:
> From: Vadim Fedorenko <vadfed@meta.com>
> 
> During ptp resync operation SKBs were poped from the fifo but were never
> freed neither by napi_consume nor by dev_kfree_skb_any. Add call to
> napi_consume_skb to properly free SKBs.
> 
> Another leak was happening because mlx5e_skb_fifo_has_room() had an error
> in the check. Comparing free running counters works well unless C promotes
> the types to something wider than the counter. In this case counters are
> u16 but the result of the substraction is promouted to int and it causes
> wrong result (negative value) of the check when producer have already
> overlapped but consumer haven't yet. Explicit cast to u16 fixes the issue.
> 
> Fixes: 58a518948f60 ("net/mlx5e: Add resiliency for PTP TX port timestamp")
> Reviewed-by: Gal Pressman <gal@nvidia.com>
> Signed-off-by: Vadim Fedorenko <vadfed@meta.com>
> ---
>   drivers/net/ethernet/mellanox/mlx5/core/en/ptp.c  | 6 ++++--
>   drivers/net/ethernet/mellanox/mlx5/core/en/txrx.h | 2 +-
>   2 files changed, 5 insertions(+), 3 deletions(-)
> 

Thanks for your patch.
Reviewed-by: Tariq Toukan <tariqt@nvidia.com>


  reply	other threads:[~2023-01-26  6:33 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-01-26  1:02 [PATCH net v3 0/2] mlx5: ptp fifo bugfixes Vadim Fedorenko
2023-01-26  1:02 ` [PATCH net v3 1/2] mlx5: fix skb leak while fifo resync and push Vadim Fedorenko
2023-01-26  6:33   ` Tariq Toukan [this message]
2023-01-26  1:02 ` [PATCH net v3 2/2] mlx5: fix possible ptp queue fifo use-after-free Vadim Fedorenko
2023-01-26  1:09   ` Rahul Rameshbabu
2023-01-26 10:53     ` Vadim Fedorenko
2023-01-26  1:27   ` Rahul Rameshbabu
2023-01-26 10:53     ` Vadim Fedorenko
2023-01-26  6:53   ` Tariq Toukan
2023-01-26 13:22     ` Vadim Fedorenko
2023-01-28 16:42   ` kernel test robot
2023-01-28 17:55   ` kernel test robot
2023-01-28 21:42   ` kernel test robot
2023-01-29  0:05   ` kernel test robot
2023-01-29 12:32   ` kernel test robot

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=1b9571f2-eadd-5cda-a368-78d6ce4ae873@gmail.com \
    --to=ttoukan.linux@gmail.com \
    --cc=ayal@nvidia.com \
    --cc=gal@nvidia.com \
    --cc=kuba@kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=saeedm@nvidia.com \
    --cc=vadfed@fb.com \
    --cc=vadfed@meta.com \
    --cc=vfedorenko@novek.ru \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.