diff mbox series

[net] Revert "vlan: Fix VLAN 0 memory leak"

Message ID 20230811154523.1877590-1-vladbu@nvidia.com (mailing list archive)
State Accepted
Commit ace0ab3a4b54205a01d3f4a0fd9bdb4616cfb60b
Delegated to: Netdev Maintainers
Headers show
Series [net] Revert "vlan: Fix VLAN 0 memory leak" | expand

Checks

Context Check Description
netdev/series_format success Single patches do not need cover letters
netdev/tree_selection success Clearly marked for net
netdev/fixes_present success Fixes tag present in non-next series
netdev/header_inline success No static functions without inline keyword in header files
netdev/build_32bit success Errors and warnings before: 1328 this patch: 1328
netdev/cc_maintainers fail 1 blamed authors not CCed: idosch@nvidia.com; 1 maintainers not CCed: idosch@nvidia.com
netdev/build_clang success Errors and warnings before: 1351 this patch: 1351
netdev/verify_signedoff success Signed-off-by tag matches author and committer
netdev/deprecated_api success None detected
netdev/check_selftest success No net selftest shell script
netdev/verify_fixes success Fixes tag looks correct
netdev/build_allmodconfig_warn success Errors and warnings before: 1351 this patch: 1351
netdev/checkpatch success total: 0 errors, 0 warnings, 0 checks, 9 lines checked
netdev/kdoc success Errors and warnings before: 0 this patch: 0
netdev/source_inline success Was 0 now: 0

Commit Message

Vlad Buslov Aug. 11, 2023, 3:45 p.m. UTC
This reverts commit 718cb09aaa6fa78cc8124e9517efbc6c92665384.

The commit triggers multiple syzbot issues, probably due to possibility of
manually creating VLAN 0 on netdevice which will cause the code to delete
it since it can't distinguish such VLAN from implicit VLAN 0 automatically
created for devices with NETIF_F_HW_VLAN_CTAG_FILTER feature.

Reported-by: syzbot+662f783a5cdf3add2719@syzkaller.appspotmail.com
Closes: https://lore.kernel.org/all/00000000000090196d0602a6167d@google.com/
Reported-by: syzbot+4b4f06495414e92701d5@syzkaller.appspotmail.com
Closes: https://lore.kernel.org/all/00000000000096ae870602a61602@google.com/
Reported-by: syzbot+d810d3cd45ed1848c3f7@syzkaller.appspotmail.com
Closes: https://lore.kernel.org/all/0000000000009f0f9c0602a616ce@google.com/
Fixes: 718cb09aaa6f ("vlan: Fix VLAN 0 memory leak")
Signed-off-by: Vlad Buslov <vladbu@nvidia.com>
---
 net/8021q/vlan.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Comments

Ido Schimmel Aug. 13, 2023, 7:39 a.m. UTC | #1
On Fri, Aug 11, 2023 at 05:45:23PM +0200, Vlad Buslov wrote:
> This reverts commit 718cb09aaa6fa78cc8124e9517efbc6c92665384.
> 
> The commit triggers multiple syzbot issues, probably due to possibility of
> manually creating VLAN 0 on netdevice which will cause the code to delete
> it since it can't distinguish such VLAN from implicit VLAN 0 automatically
> created for devices with NETIF_F_HW_VLAN_CTAG_FILTER feature.
> 
> Reported-by: syzbot+662f783a5cdf3add2719@syzkaller.appspotmail.com
> Closes: https://lore.kernel.org/all/00000000000090196d0602a6167d@google.com/
> Reported-by: syzbot+4b4f06495414e92701d5@syzkaller.appspotmail.com
> Closes: https://lore.kernel.org/all/00000000000096ae870602a61602@google.com/
> Reported-by: syzbot+d810d3cd45ed1848c3f7@syzkaller.appspotmail.com
> Closes: https://lore.kernel.org/all/0000000000009f0f9c0602a616ce@google.com/
> Fixes: 718cb09aaa6f ("vlan: Fix VLAN 0 memory leak")
> Signed-off-by: Vlad Buslov <vladbu@nvidia.com>

Reviewed-by: Ido Schimmel <idosch@nvidia.com>
patchwork-bot+netdevbpf@kernel.org Aug. 14, 2023, 7:20 a.m. UTC | #2
Hello:

This patch was applied to netdev/net.git (main)
by David S. Miller <davem@davemloft.net>:

On Fri, 11 Aug 2023 17:45:23 +0200 you wrote:
> This reverts commit 718cb09aaa6fa78cc8124e9517efbc6c92665384.
> 
> The commit triggers multiple syzbot issues, probably due to possibility of
> manually creating VLAN 0 on netdevice which will cause the code to delete
> it since it can't distinguish such VLAN from implicit VLAN 0 automatically
> created for devices with NETIF_F_HW_VLAN_CTAG_FILTER feature.
> 
> [...]

Here is the summary with links:
  - [net] Revert "vlan: Fix VLAN 0 memory leak"
    https://git.kernel.org/netdev/net/c/ace0ab3a4b54

You are awesome, thank you!
diff mbox series

Patch

diff --git a/net/8021q/vlan.c b/net/8021q/vlan.c
index b3662119ddbc..e40aa3e3641c 100644
--- a/net/8021q/vlan.c
+++ b/net/8021q/vlan.c
@@ -384,7 +384,8 @@  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)
+	if (event == NETDEV_DOWN &&
+	    (dev->features & NETIF_F_HW_VLAN_CTAG_FILTER))
 		vlan_vid_del(dev, htons(ETH_P_8021Q), 0);
 
 	vlan_info = rtnl_dereference(dev->vlan_info);