amd64/181448: Using sysctl for mlxen stats might crash the kernel.

Daria dariaz at mellanox.com
Wed Aug 21 08:00:03 UTC 2013


>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 at 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:


More information about the freebsd-amd64 mailing list