[PATCH 19.11] net/mlx5: cleanup Netlink interrupt handler

Ali Alnubani alialnu at nvidia.com
Wed Dec 7 13:46:52 CET 2022


> -----Original Message-----
> From: Dmitry Kozlyuk <dkozlyuk at nvidia.com>
> Sent: Thursday, September 8, 2022 12:34 PM
> To: stable at dpdk.org
> Cc: Suanming Mou <suanmingm at nvidia.com>; Matan Azrad
> <matan at nvidia.com>; Shahaf Shuler <shahafs at nvidia.com>; Slava
> Ovsiienko <viacheslavo at nvidia.com>
> Subject: [PATCH 19.11] net/mlx5: cleanup Netlink interrupt handler
> 
> [ 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 at nvidia.com>
> Acked-by: Suanming Mou <suanmingm at 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

Hi Christian,

Can you please help apply this patch to 19.11?

Thanks,
Ali


More information about the stable mailing list