patches for DPDK stable branches
 help / color / mirror / Atom feed
From: Dmitry Kozlyuk <dkozlyuk@nvidia.com>
To: <stable@dpdk.org>
Cc: Suanming Mou <suanmingm@nvidia.com>,
	Matan Azrad <matan@nvidia.com>,
	Shahaf Shuler <shahafs@nvidia.com>,
	Viacheslav Ovsiienko <viacheslavo@nvidia.com>
Subject: [PATCH 19.11] net/mlx5: cleanup Netlink interrupt handler
Date: Thu, 8 Sep 2022 12:34:08 +0300	[thread overview]
Message-ID: <20220908093408.2171090-1-dkozlyuk@nvidia.com> (raw)

[ upstream commit 17f95513adca1f4ee5bba305b154ac984ee50cee ]

When the upstream commit was backported by the offending commit,
the cleanup part of the fix was missed. The interrupt handler
was not unregistered and the Netlink socket was not closed
with the device closing. The socket was leaking and the handler
could continue working with random content in the freed memory:

    net_mlx5: Failed to process Netlink events: \
        Socket operation on non-socket

Fixes: edea6144b47f ("net/mlx5: fix link status change detection")

Signed-off-by: Dmitry Kozlyuk <dkozlyuk@nvidia.com>
Acked-by: Suanming Mou <suanmingm@nvidia.com>
---
 drivers/net/mlx5/mlx5.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/drivers/net/mlx5/mlx5.c b/drivers/net/mlx5/mlx5.c
index dee018bbba..f3b440635e 100644
--- a/drivers/net/mlx5/mlx5.c
+++ b/drivers/net/mlx5/mlx5.c
@@ -579,6 +579,11 @@ mlx5_dev_shared_handler_uninstall(struct mlx5_ibv_shared *sh)
 	if (sh->intr_handle.fd >= 0)
 		mlx5_intr_callback_unregister(&sh->intr_handle,
 					      mlx5_dev_interrupt_handler, sh);
+	if (sh->intr_handle_nl.fd >= 0) {
+		mlx5_intr_callback_unregister(&sh->intr_handle_nl,
+					      mlx5_dev_interrupt_handler_nl, sh);
+		close(sh->intr_handle_nl.fd);
+	}
 #ifdef HAVE_IBV_DEVX_ASYNC
 	if (sh->intr_handle_devx.fd >= 0)
 		rte_intr_callback_unregister(&sh->intr_handle_devx,
-- 
2.25.1


             reply	other threads:[~2022-09-08  9:34 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-09-08  9:34 Dmitry Kozlyuk [this message]
2022-12-07 12:46 ` Ali Alnubani

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=20220908093408.2171090-1-dkozlyuk@nvidia.com \
    --to=dkozlyuk@nvidia.com \
    --cc=matan@nvidia.com \
    --cc=shahafs@nvidia.com \
    --cc=stable@dpdk.org \
    --cc=suanmingm@nvidia.com \
    --cc=viacheslavo@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;
as well as URLs for NNTP newsgroup(s).