From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 1ED81A0548 for ; Thu, 8 Sep 2022 11:34:20 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id F2B4E40143; Thu, 8 Sep 2022 11:34:19 +0200 (CEST) Received: from NAM12-BN8-obe.outbound.protection.outlook.com (mail-bn8nam12on2081.outbound.protection.outlook.com [40.107.237.81]) by mails.dpdk.org (Postfix) with ESMTP id CA923400D6 for ; Thu, 8 Sep 2022 11:34:17 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=mC/1kSt9AmupMYbrF2UQGM1pRZfy1TAkOBpJS8FL97nPUUyflDdyeA2mDkUtCkkclOzPO0WUksYijxsE3i3ZjUVDg3shLTGEqugwK/k+gMzvPqFs0j+qlhfZc/8GK6pKD49rkWAf1qFunng2gpwORb7n+vYOrNR4q23vGmXx2Zd0YhUisSja6k8wFye6UpoYvKjI5wL7kQLmHsMzYo31wf3CHZt6Pd+RM3lwwhjKlrV8sEdN4FK6ZUKdA82dKOxIH1GWjMhY5ewxhQ8+XAQn9I/LCESxw+UM2UuukHRX1eXQ+6K7+NyEmdz/ZBlj0vrC8HidtUWrY8FddjnVZcE9Tg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=LvtuJ/c5hBE8s5OPHkJxDhICrt6qzlm8iGTwNz2YRhY=; b=cPgonniNihIwP8GRkwvdyUpNAprkf4MMhledt59sjQlcxM1HBlPgVirHRGXhhO3XFqPIv4KyKAjJy7YjGdfP+tsoPD/pxaP1M01pAou7+F4abwOv3faYFfl+2vxvbYzFC0GE3GbSZTgnAUdzjCl5qluzMppCvUIHeHUaiC+d+4DfJpG0QnUmjlB3YGS2GBy6QLhQxwxzJNSmarQ7ddyRyDqPRnu2itT/gBeJ4UPPvPvP+RrJ5baokMoqs0EmC8fYRHwAY5BiDveSY43+yD1zuIDEVpkPUadmS5T59ZvHGTQOF/kNv7RnA6cP9mBgVFyK1YDn4vR+ptc0/t2S9xTmiw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 12.22.5.238) smtp.rcpttodomain=dpdk.org smtp.mailfrom=nvidia.com; dmarc=pass (p=reject sp=reject pct=100) action=none header.from=nvidia.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=LvtuJ/c5hBE8s5OPHkJxDhICrt6qzlm8iGTwNz2YRhY=; b=UMHtzadlC3neLoCtOZGaGYz/uLHkrV42Whj2+VzDsj1mhCcdcU5VQYuc6dKQuItvwHbCDOLQqotR+hht3E5ZDfOID+T61+OUrElOJwYTQbvLCZPYsFKfOD4YJRT9DHQdUWLZL8s/26vAl+Z8MSScPViBix3uwuNpuSCEYc1ixRkF/Of1wo+wOT1U2b22//52wA83WU2FCY72XTq5eQ0ovv7cPQnCDYbiz4xHM1vomqZjvYiSA33XGibG4RgZxsZg5MbB1I1vypCXMFODjDGnNUjwtdrma10QzKiRUs4wzVIcZwcRgHBgSAMU4S33RPOkYd6BDN3/NOMoX0ibFvkBUQ== Received: from DM6PR21CA0030.namprd21.prod.outlook.com (2603:10b6:5:174::40) by DM4PR12MB5987.namprd12.prod.outlook.com (2603:10b6:8:6a::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5588.18; Thu, 8 Sep 2022 09:34:16 +0000 Received: from DM6NAM11FT065.eop-nam11.prod.protection.outlook.com (2603:10b6:5:174:cafe::27) by DM6PR21CA0030.outlook.office365.com (2603:10b6:5:174::40) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5632.6 via Frontend Transport; Thu, 8 Sep 2022 09:34:16 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 12.22.5.238) smtp.mailfrom=nvidia.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=nvidia.com; Received-SPF: Pass (protection.outlook.com: domain of nvidia.com designates 12.22.5.238 as permitted sender) receiver=protection.outlook.com; client-ip=12.22.5.238; helo=mail.nvidia.com; pr=C Received: from mail.nvidia.com (12.22.5.238) by DM6NAM11FT065.mail.protection.outlook.com (10.13.172.109) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.5612.13 via Frontend Transport; Thu, 8 Sep 2022 09:34:15 +0000 Received: from rnnvmail201.nvidia.com (10.129.68.8) by DRHQMAIL105.nvidia.com (10.27.9.14) with Microsoft SMTP Server (TLS) id 15.0.1497.38; Thu, 8 Sep 2022 09:34:15 +0000 Received: from rnnvmail201.nvidia.com (10.129.68.8) by rnnvmail201.nvidia.com (10.129.68.8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.29; Thu, 8 Sep 2022 02:34:14 -0700 Received: from nvidia.com (10.127.8.11) by mail.nvidia.com (10.129.68.8) with Microsoft SMTP Server id 15.2.986.29 via Frontend Transport; Thu, 8 Sep 2022 02:34:12 -0700 From: Dmitry Kozlyuk To: CC: Suanming Mou , Matan Azrad , Shahaf Shuler , Viacheslav Ovsiienko Subject: [PATCH 19.11] net/mlx5: cleanup Netlink interrupt handler Date: Thu, 8 Sep 2022 12:34:08 +0300 Message-ID: <20220908093408.2171090-1-dkozlyuk@nvidia.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DM6NAM11FT065:EE_|DM4PR12MB5987:EE_ X-MS-Office365-Filtering-Correlation-Id: a904bd2d-1369-41b2-427e-08da917d4c14 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: /rOYhqGG33vigRXJot6ik1TSo8Eqdpf9alFQtK3/JgXrueFc7rBME8bkJEXaQGM7tl/QOZ6+N+wnOaArzPVvx4rjgbKEZzznOhaVQnfomhRwUw73ny1JYH2A8sJSnwGONSbFN9JMu5VHHXwxzQP1E4LAdoL5kStAzZExRrYGgREhxddIROz/rER6ihrd+wEQ+Yahezx0k+3ujfN5vX02CoV3JOWZmybs/zclpPnXrxj3B++xcXOTHGOZuJmb4ssskzi+yYJXNc76jZXwTWBQaxvgkjOLe9+j4OziJDwXLGG2+DMBppXn3I5x7FtuJWwmCN/VMIlce3i5vOJ7PneLEi478J8Ka2Z0kSTae2I/xy6qeRsVb83/NbMynR6GV6RHNWpL8zkyMwo818FwrEEDwcRqo14jazZlMz44gMGmmH0A9E9TrXn+3CLezErVkijjqSmJFJeM+6tBrGBv3VrKUqZL4W0Hh3YzUY/lHq0Is7SpckSBKaQk0gqhrvrPhc0CJNOArA1Jjxi9mkNjLG/gYjnziw1Iz6uymPsQffr8gP/y2dHFgmh/2gV6DwVyqJVTYOPRQnflcRhEMIqh2uIvVfs5R+dFUBTc1k55KtTsW6gYQlK6K/ivmbmzK7/y0mFKNRm1P/h6eFr6Gt/7H6TI64xjU4wT//HIrHZPN6IjoKNVjNE+lJb3FwtRkROqBvCL36FkhkrVBAfmBqiGMYRN5QUnvLpedEBS61OTlNVMe2zIdZHwRD84Pp94aBG9S0f4eGTq5O2TGZon2W3ECUBcgPgT4YFR+hjnIX28yOZI9aY= X-Forefront-Antispam-Report: CIP:12.22.5.238; CTRY:US; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:mail.nvidia.com; PTR:InfoNoRecords; CAT:NONE; SFS:(13230016)(4636009)(396003)(136003)(39860400002)(346002)(376002)(40470700004)(36840700001)(46966006)(478600001)(54906003)(316002)(107886003)(6916009)(7696005)(40460700003)(6666004)(26005)(6286002)(55016003)(40480700001)(8936002)(36756003)(2906002)(82310400005)(86362001)(5660300002)(83380400001)(356005)(4326008)(70586007)(70206006)(82740400003)(36860700001)(8676002)(426003)(1076003)(81166007)(186003)(336012)(41300700001)(2616005)(47076005)(36900700001); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Sep 2022 09:34:15.8276 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: a904bd2d-1369-41b2-427e-08da917d4c14 X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a; Ip=[12.22.5.238]; Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: DM6NAM11FT065.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM4PR12MB5987 X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org [ 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 Acked-by: Suanming Mou --- 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