vlan: unable to rmmod 8021q due to netdevice reference leak

Bug #2046793 reported by Olivier Matz
10
This bug affects 1 person
Affects Status Importance Assigned to Milestone
linux (Ubuntu)
New
Undecided
Unassigned

Bug Description

[Impact]

In some conditions, is not possible to remove the vlan module due to a netdevice reference leak.

The problem has been fixed in linux v5.17 with commit d6ff94afd90b ("vlan: move dev_put into vlan_dev_uninit").
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=d6ff94afd90b

This commit has been backported in linux 5.15.142:
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=02caa78cbc22

To avoid conflict, the following commit was also backported right before:
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=842801181864

[Test Case]

As described in the commit, it is simple to reproduce the issue. Simply create a dummy, a vlan on top of it, and a vlan on top of the previously created vlan, then try to remove the 8021q module.

ip link add dummy0 type dummy
ip link add link dummy0 name dummy0.1 type vlan id 1
ip link add link dummy0.1 name dummy0.1.2 type vlan id 2
rmmod 8021q
[freeze]
unregister_netdevice: waiting for dummy0.1 to become free. Usage count = 1

[Regression Potential]

These 2 patches are quite simple. They have been backported in the official 5.15 stable. The risk of regression should be contained.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.