netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Bernard Pidoux <f6bvp@free.fr>
To: kuba@kernel.org
Cc: davem@davemloft.net, duoming@zju.edu.cn, edumazet@google.com,
	f6bvp@free.fr, linux-hams@vger.kernel.org,
	linux-kernel@vger.kernel.org, netdev@vger.kernel.org,
	pabeni@redhat.com, ralf@linux-mips.org
Subject: [PATCH 1/1] [PATCH] net: rose: fix unregistered netdevice: waiting for rose0 to become free
Date: Tue, 26 Jul 2022 20:25:18 +0200	[thread overview]
Message-ID: <20220726182518.47047-1-f6bvp@free.fr> (raw)
In-Reply-To: <20220722103750.1938776d@kernel.org>

Here is the context.

This patch adds dev_put(dev) in order to allow removal of rose module
after use of AX25 and ROSE via rose0 device.

Otherwise when trying to remove rose module via rmmod rose an infinite
loop message was displayed on all consoles with xx being a random number.

unregistered_netdevice: waiting for rose0 to become free. Usage count = xx

unregistered_netdevice: waiting for rose0 to become free. Usage count = xx

...

With the patch it is ok to rmmod rose.

This bug appeared with kernel 4.10 and has been only partially repaired by adding two dev_put(dev).

Signed-off-by: Bernard Pidoux <f6bvp@free.fr>

---
 net/rose/af_rose.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/net/rose/af_rose.c b/net/rose/af_rose.c
index bf2d986a6bc3..4163171ce3a6 100644
--- a/net/rose/af_rose.c
+++ b/net/rose/af_rose.c
@@ -711,6 +711,8 @@ static int rose_bind(struct socket *sock, struct sockaddr *uaddr, int addr_len)
 	rose_insert_socket(sk);
 
 	sock_reset_flag(sk, SOCK_ZAPPED);
+	
+	dev_put(dev);
 
 	return 0;
 }
-- 
2.34.1

[master da21d19e920d] [PATCH] net: rose: fix unregistered netdevice: waiting for rose0 to become free
 Date: Mon Jul 18 16:23:54 2022 +0200
 1 file changed, 2 insertions(+)


  reply	other threads:[~2022-07-26 18:25 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-07-11  1:31 [PATCH net v6] net: rose: fix null-ptr-deref caused by rose_kill_by_neigh Duoming Zhou
2022-07-12 11:00 ` Paolo Abeni
2022-07-13  7:50   ` duoming
2022-07-13  8:33     ` Paolo Abeni
2022-07-13  9:03       ` duoming
2022-07-14 14:11         ` Bernard f6bvp
2022-07-14 14:23           ` Dan Carpenter
     [not found]           ` <ab0eac7b-3041-6772-21dd-273e1b8fc43e@free.fr>
2022-07-15 22:43             ` [PATCH] net: rose: fix unregistered netdevice: waiting for rose0 to become free Jakub Kicinski
2022-07-22 16:41               ` Bernard f6bvp
2022-07-22 17:05                 ` Eric Dumazet
2022-07-23  9:55                   ` Bernard f6bvp
2022-07-23 11:21                   ` Bernard F6BVP
2022-07-26 13:44                     ` Eric Dumazet
2022-07-22 17:37                 ` Jakub Kicinski
2022-07-26 18:25                   ` Bernard Pidoux [this message]
2022-07-27  9:06                     ` [PATCH 1/1] " Eric Dumazet
2022-09-04 22:48                       ` f6bvp

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=20220726182518.47047-1-f6bvp@free.fr \
    --to=f6bvp@free.fr \
    --cc=davem@davemloft.net \
    --cc=duoming@zju.edu.cn \
    --cc=edumazet@google.com \
    --cc=kuba@kernel.org \
    --cc=linux-hams@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=ralf@linux-mips.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).