All of lore.kernel.org
 help / color / mirror / Atom feed
From: Philipp Lehmann <leph1016@hs-karlsruhe.de>
To: "wg@grandegger.com" <wg@grandegger.com>,
	"mkl@pengutronix.de" <mkl@pengutronix.de>,
	"socketcan@hartkopp.net" <socketcan@hartkopp.net>
Cc: "linux-can@vger.kernel.org" <linux-can@vger.kernel.org>,
	"christian.sauer.w@sew-eurodrive.de"
	<christian.sauer.w@sew-eurodrive.de>
Subject: [Bug] Kernel Panic on Deletion of the network-namespace containing the SocketCAN interface
Date: Thu, 16 Jul 2020 16:46:30 +0000	[thread overview]
Message-ID: <20ea6d4c00dc4d5f99cd004677280369@hs-karlsruhe.de> (raw)

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

             reply	other threads:[~2020-07-16 16:46 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-07-16 16:46 Philipp Lehmann [this message]
2020-07-16 18:37 ` [Bug] Kernel Panic on Deletion of the network-namespace containing the SocketCAN interface Oliver Hartkopp
2020-07-17  7:55   ` Stéphane Grosjean
2020-07-17 11:02     ` Oliver Hartkopp
2020-07-17 11:32       ` Oliver Hartkopp
2020-07-17 14:55         ` Stéphane Grosjean

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20ea6d4c00dc4d5f99cd004677280369@hs-karlsruhe.de \
    --to=leph1016@hs-karlsruhe.de \
    --cc=christian.sauer.w@sew-eurodrive.de \
    --cc=linux-can@vger.kernel.org \
    --cc=mkl@pengutronix.de \
    --cc=socketcan@hartkopp.net \
    --cc=wg@grandegger.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.