[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1519048631.2870.25.camel@redhat.com>
Date: Mon, 19 Feb 2018 14:57:11 +0100
From: Paolo Abeni <pabeni@...hat.com>
To: Jon Maloy <jon.maloy@...csson.com>,
Kirill Tkhai <ktkhai@...tuozzo.com>,
Dmitry Vyukov <dvyukov@...gle.com>,
syzbot <syzbot+749d9d87c294c00ca856@...kaller.appspotmail.com>,
Ying Xue <ying.xue@...driver.com>
Cc: Andrei Vagin <avagin@...tuozzo.com>,
David Miller <davem@...emloft.net>,
"Eric W. Biederman" <ebiederm@...ssion.com>,
Florian Westphal <fw@...len.de>,
LKML <linux-kernel@...r.kernel.org>,
netdev <netdev@...r.kernel.org>,
Nicolas Dichtel <nicolas.dichtel@...nd.com>,
"roman.kapl@...go.com" <roman.kapl@...go.com>,
"syzkaller-bugs@...glegroups.com" <syzkaller-bugs@...glegroups.com>,
"tipc-discussion@...ts.sourceforge.net"
<tipc-discussion@...ts.sourceforge.net>
Subject: Re: BUG: sleeping function called from invalid context at
net/core/sock.c:LINE (3)
On Mon, 2018-02-19 at 13:23 +0000, Jon Maloy wrote:
> I don't understand this one. tipc_topsrv_stop() can only be trigged
> from a user doing rmmod(), and I double checked that this is running
> in user mode.
> How does the call chain you are reporting occur?
tipc_topsrv_stop() is called also at net namespace destruction time:
static void __net_exit tipc_exit_net(struct net *net)
{
tipc_topsrv_stop(net);
#...
I *think* the following should fix the issue, but I'm unsure if it's
safe.
#syz test: git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next.git master
---
diff --git a/net/tipc/topsrv.c b/net/tipc/topsrv.c
index 02013e00f287..63f35eae7236 100644
--- a/net/tipc/topsrv.c
+++ b/net/tipc/topsrv.c
@@ -693,9 +693,9 @@ void tipc_topsrv_stop(struct net *net)
}
__module_get(lsock->ops->owner);
__module_get(lsock->sk->sk_prot_creator->owner);
- sock_release(lsock);
srv->listener = NULL;
spin_unlock_bh(&srv->idr_lock);
+ sock_release(lsock);
tipc_topsrv_work_stop(srv);
idr_destroy(&srv->conn_idr);
kfree(srv);
Powered by blists - more mailing lists