ports/169565: [patch] emulators/virtualbox-ose-kmod vboxnetadp kernel panic on unload
Thomas Eberhardt
sneakywumpus at googlemail.com
Sat Jun 30 09:40:11 UTC 2012
>Number: 169565
>Category: ports
>Synopsis: [patch] emulators/virtualbox-ose-kmod vboxnetadp kernel panic on unload
>Confidential: no
>Severity: serious
>Priority: medium
>Responsible: freebsd-ports-bugs
>State: open
>Quarter:
>Keywords:
>Date-Required:
>Class: sw-bug
>Submitter-Id: current-users
>Arrival-Date: Sat Jun 30 09:40:10 UTC 2012
>Closed-Date:
>Last-Modified:
>Originator: Thomas Eberhardt
>Release: FreeBSD 9.0-STABLE amd64
>Organization:
>Environment:
FreeBSD clarence.ocp.lan 9.0-STABLE FreeBSD 9.0-STABLE #0 r237835M: Sat Jun 30 10:51:44 CEST 2012 thomas at clarence.ocp.lan:/usr/obj/usr/src/sys/CLARENCE amd64
>Description:
I'm getting consistent kernel panics on unload of vboxnetadp. Started at around beginning of May 2012.
>How-To-Repeat:
kldload vboxnetadp
kldunload vboxnetadp
>Fix:
Looking at patch-src-VBox-HostDrivers-VBoxNetAdp-freebsd-VBoxNetAdp-freebsd.c in the port, i found something fishy:
@@ -286,7 +304,9 @@ void vboxNetAdpOsDestroy(PVBOXNETADP pTh
{
struct ifnet *ifp;
+ VBOXCURVNET_SET(ifp->if_vnet);
ifp = pThis->u.s.ifp;
ether_ifdetach(ifp);
if_free(ifp);
+ VBOXCURVNET_RESTORE();
}
looks like ifp is being used uninitialized. I changed this part of the patch to:
@@ -286,7 +304,8 @@ void vboxNetAdpOsDestroy(PVBOXNETADP pTh
{
- struct ifnet *ifp;
+ struct ifnet *ifp = pThis->u.s.ifp;
- ifp = pThis->u.s.ifp;
+ VBOXCURVNET_SET(ifp->if_vnet);
ether_ifdetach(ifp);
if_free(ifp);
+ VBOXCURVNET_RESTORE();
}
After this change the kernel panics stopped.
>Release-Note:
>Audit-Trail:
>Unformatted:
More information about the freebsd-ports-bugs
mailing list