Date: Wed, 21 Aug 2013 07:50:53 GMT From: Daria <dariaz@mellanox.com> To: freebsd-gnats-submit@FreeBSD.org Subject: amd64/181448: Using sysctl for mlxen stats might crash the kernel. Message-ID: <201308210750.r7L7orbK043609@oldred.freebsd.org> Resent-Message-ID: <201308210800.r7L802Fo083123@freefall.freebsd.org>
next in thread | raw e-mail | index | archive | help
>Number: 181448 >Category: amd64 >Synopsis: Using sysctl for mlxen stats might crash the kernel. >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-amd64 >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Wed Aug 21 08:00:02 UTC 2013 >Closed-Date: >Last-Modified: >Originator: Daria >Release: 9.1 >Organization: Mellanox >Environment: FreeBSD 9.1-RELEASE FreeBSD 9.1-RELEASE root@farrell.cse.buffalo.edu:/usr/obj/usr/src/sys/GENERIC amd64 >Description: When reloading mlxen there are messages in the logs: can't re-use a leaf (various leaf names)! then, when trying to read these leafs - the kernel crashes. >How-To-Repeat: reload mlxen then try sysctl -a or a certain problematic leaf. >Fix: The order of releasing resources in mlxen needed to be corrected. Index: sys/ofed/drivers/net/mlx4/en_netdev.c =================================================================== --- sys/ofed/drivers/net/mlx4/en_netdev.c (revision 254594) +++ sys/ofed/drivers/net/mlx4/en_netdev.c (working copy) @@ -924,9 +924,6 @@ void mlx4_en_destroy_netdev(struct net_device *dev if (priv->allocated) mlx4_free_hwq_res(mdev->dev, &priv->res, MLX4_EN_PAGE_SIZE); - if (priv->sysctl) - sysctl_ctx_free(&priv->conf_ctx); - cancel_delayed_work(&priv->stats_task); /* flush any pending task for this netdev */ flush_workqueue(mdev->workqueue); @@ -937,6 +934,10 @@ void mlx4_en_destroy_netdev(struct net_device *dev mutex_unlock(&mdev->state_lock); mlx4_en_free_resources(priv); + + if (priv->sysctl) + sysctl_ctx_free(&priv->conf_ctx); + mtx_destroy(&priv->stats_lock.m); mtx_destroy(&priv->vlan_lock.m); kfree(priv); >Release-Note: >Audit-Trail: >Unformatted:
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201308210750.r7L7orbK043609>