datapath-windows: Solved BSOD when loading an activated extension
authorSorin Vinturis <svinturis@cloudbasesolutions.com>
Mon, 26 Jan 2015 19:00:40 +0000 (19:00 +0000)
committerBen Pfaff <blp@nicira.com>
Fri, 30 Jan 2015 21:26:57 +0000 (13:26 -0800)
commit448d667b7b9b1d7ebd9b4cb3338ffea33158c579
tree6e7ca1a356cfb2df7b4a799e83677124d9169188
parent7be0b8a0b0703719397763b3b588720f3b25ec13
datapath-windows: Solved BSOD when loading an activated extension

If the OVS extension was previously enabled and the driver unloaded,
when the driver is loaded again a BSOD is triggered.

This happens because the OVS extension registers its FilterXxx routines
to NDIS, by calling NdisFRegisterFilterDriver, before performing all
the necessary initialization. Because drivers that call
NdisFRegisterFilterDriver must be prepared for an immediate call to any
of their FilterXxx functions.

The BSOD is triggered because the FilterAttach routine, OvsExtAttach,
tries to acquire the control lock, when the lock is not yet initialized.
This happens because the FilterAttach is called before the driver
finishes initialization, in OvsInit().

The solution is to perform all necessary initialization before
registering OVS FilterXxx routines.

If device object creation fails, all allocated resources during init
phase are released by calling OvsCleanup and NdisFDeregisterFilterDriver
functions.

Signed-off-by: Sorin Vinturis <svinturis@cloudbasesolutions.com>
Reported-by: Sorin Vinturis <svinturis@cloudbasesolutions.com>
Reported-at: https://github.com/openvswitch/ovs-issues/issues/67
Acked-by: Nithin Raju <nithin@vmware.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
datapath-windows/ovsext/Datapath.c
datapath-windows/ovsext/Datapath.h
datapath-windows/ovsext/Driver.c