Hi Philipp,
thanks for the report and its reproducer!
I assumed the interfaces - at least in the case of 'real' hardware CAN
interfaces - to me moved back to the root name space ... well.
I'll take a look at it.
Best regards,
Oliver
On 16.07.20 18:46, Philipp Lehmann wrote:
If a SocketCAN Interface (Tested with a PCAN-USB adapter) is moved into a network-namespace and the network namespace is deleted afterwards, without moving the device out of the namespace prior to the deletion. The device could not be found in any of the network namespaces afterwards, only a reboot of the system fixes this. If the device is instead removed from the USB-Bus without a restart, a kernel panic is the result.
Output of uname -r [Linux cpc4x 5.4.0-40-generic #44-Ubuntu SMP Tue Jun 23 00:01:04 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux]
The bug could be reproduced with the following steps:
1. Connect the (USB)-SocketCAN device to the host
2. Add a new network namespace [sudo ip netns add test]
3. Move the CAN-interface to the network name-space [sudo ip link set dev can0 netns test]
4. Delete the namespace [sudo ip netns delete test]
5. Remove the adapter from the USB-Bus. In most cases this should result in a kernel panic