diff options
author | Pavel Emelyanov <xemul@openvz.org> | 2007-12-11 05:41:25 -0500 |
---|---|---|
committer | David S. Miller <davem@sunset.davemloft.net> | 2007-12-11 05:45:32 -0500 |
commit | 3f03e387893ffa07a4d5dac96772f9db3221a185 (patch) | |
tree | 0b9296bdf891f0d7a8dec09d113a986cebac989f | |
parent | d59b54b150b3b69b721f1e161efd42ecb7619897 (diff) |
[VLAN]: Fix potential race in vlan_cleanup_module vs vlan_ioctl_handler.
The vlan module cleanup function starts with
vlan_netlink_fini();
vlan_ioctl_set(NULL);
The first call removes all the vlan devices and
the second one closes the vlan ioctl.
AFAIS there's a tiny race window between these two
calls - after rtnl unregistered all the vlans, but
the ioctl handler isn't set to NULL yet, user can
manage to call this ioctl and create one vlan device,
and that this function will later BUG_ON seeing
non-emply hashes.
I think, that we must first close the vlan ioctl
and only after this remove all the vlans with the
vlan_netlink_fini() call.
Signed-off-by: Pavel Emelyanov <xemul@openvz.org>
Acked-by: Patrick McHardy <kaber@trash.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r-- | net/8021q/vlan.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/net/8021q/vlan.c b/net/8021q/vlan.c index 5b183156307a..4add9bd4bc8d 100644 --- a/net/8021q/vlan.c +++ b/net/8021q/vlan.c | |||
@@ -124,8 +124,8 @@ static void __exit vlan_cleanup_module(void) | |||
124 | { | 124 | { |
125 | int i; | 125 | int i; |
126 | 126 | ||
127 | vlan_netlink_fini(); | ||
128 | vlan_ioctl_set(NULL); | 127 | vlan_ioctl_set(NULL); |
128 | vlan_netlink_fini(); | ||
129 | 129 | ||
130 | /* Un-register us from receiving netdevice events */ | 130 | /* Un-register us from receiving netdevice events */ |
131 | unregister_netdevice_notifier(&vlan_notifier_block); | 131 | unregister_netdevice_notifier(&vlan_notifier_block); |