Message ID | 20230808093521.1468929-1-vladbu@nvidia.com (mailing list archive) |
---|---|
State | Accepted |
Commit | 718cb09aaa6fa78cc8124e9517efbc6c92665384 |
Delegated to: | Netdev Maintainers |
Headers | show |
Series | [net,v2] vlan: Fix VLAN 0 memory leak | expand |
Hello: This patch was applied to netdev/net.git (main) by Jakub Kicinski <kuba@kernel.org>: On Tue, 8 Aug 2023 11:35:21 +0200 you wrote: > The referenced commit intended to fix memleak of VLAN 0 that is implicitly > created on devices with NETIF_F_HW_VLAN_CTAG_FILTER feature. However, it > doesn't take into account that the feature can be re-set during the > netdevice lifetime which will cause memory leak if feature is disabled > during the device deletion as illustrated by [0]. Fix the leak by > unconditionally deleting VLAN 0 on NETDEV_DOWN event. > > [...] Here is the summary with links: - [net,v2] vlan: Fix VLAN 0 memory leak https://git.kernel.org/netdev/net/c/718cb09aaa6f You are awesome, thank you!
diff --git a/net/8021q/vlan.c b/net/8021q/vlan.c index e40aa3e3641c..b3662119ddbc 100644 --- a/net/8021q/vlan.c +++ b/net/8021q/vlan.c @@ -384,8 +384,7 @@ static int vlan_device_event(struct notifier_block *unused, unsigned long event, dev->name); vlan_vid_add(dev, htons(ETH_P_8021Q), 0); } - if (event == NETDEV_DOWN && - (dev->features & NETIF_F_HW_VLAN_CTAG_FILTER)) + if (event == NETDEV_DOWN) vlan_vid_del(dev, htons(ETH_P_8021Q), 0); vlan_info = rtnl_dereference(dev->vlan_info);