openvswitch: properly refcount vport-vxlan module
Subsystems (3)
Paolo Abeni
maintainerPATCH 1/1 openvswitch: properly refcount vport-vxlan module
After 614732eaa12d, no refcount is mainteined for the vport-vxlan module. This allows the userspace to remove such module while vport-vxlan devices still exist, which lead to later oops, i.e. when
the openvswitch module is removed.
--- net/openvswitch/vport-vxlan.c | 1 + 1 file changed, 1 insertion(+)
net/openvswitch/vport-vxlan.c +1 -0
@@ -152,6 +152,7 @@ static struct vport_ops ovs_vxlan_netdev_vport_ops = { .destroy = ovs_netdev_tunnel_destroy, .get_options = vxlan_get_options, .send = dev_queue_xmit, + .owner = THIS_MODULE, };static int __init ovs_vxlan_tnl_init (void )
Signature · 1 line
1.8.3.1
David Miller
maintainerFrom: Paolo Abeni <[email protected]>
Date: Wed, 25 Nov 2015 18:05:27 +0100
Quoted 8 lines
After
614732eaa12d, no refcount is mainteined for the vport-vxlan module. This allows the userspace to remove such module while vport-vxlan devices still exist, which lead to later oops, i.e. when
the openvswitch module is removed.Fixes 614732eaa12d ("openvswitch: Use regular VXLAN net_device device")Signed-off-by Paolo Abeni <[email protected]>
This is so error prone, with some vport_ops needing to mark the module and some don't (because they are in the main openvswitch driver).
Fix this properly, by making the vport_ops register function be a macro that sets THIS_MODULE in the vport_ops before passing it on down to the real registry function.