From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ido Schimmel Subject: Re: ipv6_addrconf: WARNING about suspicious RCU usage Date: Sat, 20 Jan 2018 15:37:53 +0200 Message-ID: <20180120133753.GA27861@splinter> References: Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="vtzGhvizbBRQ85DL" Cc: "netdev@vger.kernel.org" To: Heiner Kallweit Return-path: Received: from out1-smtp.messagingengine.com ([66.111.4.25]:43721 "EHLO out1-smtp.messagingengine.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751130AbeATNh4 (ORCPT ); Sat, 20 Jan 2018 08:37:56 -0500 Content-Disposition: inline In-Reply-To: Sender: netdev-owner@vger.kernel.org List-ID: --vtzGhvizbBRQ85DL Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Sat, Jan 20, 2018 at 12:57:01PM +0100, Heiner Kallweit wrote: > Since some time (didn't bisect it yet) I get the following warning. > Is it a known issue? [...] > [86220.126999] BUG: sleeping function called from invalid context at mm/slab.h:420 > [86220.127041] in_atomic(): 1, irqs_disabled(): 0, pid: 1003, name: kworker/0:2 > [86220.127082] 4 locks held by kworker/0:2/1003: > [86220.127107] #0: ((wq_completion)"%s"("ipv6_addrconf")){+.+.}, at: [<00000000da8e9b73>] process_one_work+0x1de/0x680 > [86220.127179] #1: ((addr_chk_work).work){+.+.}, at: [<00000000da8e9b73>] process_one_work+0x1de/0x680 > [86220.127242] #2: (rtnl_mutex){+.+.}, at: [<00000000b06d9510>] rtnl_lock+0x12/0x20 > [86220.127300] #3: (rcu_read_lock_bh){....}, at: [<00000000aef52299>] addrconf_verify_rtnl+0x1e/0x510 [ipv6] > [86220.127414] CPU: 0 PID: 1003 Comm: kworker/0:2 Not tainted 4.15.0-rc7-next-20180110+ #7 > [86220.127463] Hardware name: ZOTAC ZBOX-CI321NANO/ZBOX-CI321NANO, BIOS B246P105 06/01/2015 > [86220.127528] Workqueue: ipv6_addrconf addrconf_verify_work [ipv6] > [86220.127568] Call Trace: > [86220.127591] dump_stack+0x70/0x9e > [86220.127616] ___might_sleep+0x14d/0x240 > [86220.127644] __might_sleep+0x45/0x80 > [86220.127672] kmem_cache_alloc_trace+0x53/0x250 > [86220.127717] ? ipv6_add_addr+0xfe/0x6e0 [ipv6] > [86220.127762] ipv6_add_addr+0xfe/0x6e0 [ipv6] > [86220.127807] ipv6_create_tempaddr+0x24d/0x430 [ipv6] > [86220.127854] ? ipv6_create_tempaddr+0x24d/0x430 [ipv6] > [86220.127903] addrconf_verify_rtnl+0x339/0x510 [ipv6] > [86220.127950] ? addrconf_verify_rtnl+0x339/0x510 [ipv6] > [86220.127998] addrconf_verify_work+0xe/0x20 [ipv6] > [86220.128032] process_one_work+0x258/0x680 > [86220.128063] worker_thread+0x35/0x3f0 > [86220.128091] kthread+0x124/0x140 > [86220.128117] ? process_one_work+0x680/0x680 > [86220.128146] ? kthread_create_worker_on_cpu+0x40/0x40 > [86220.128180] ? umh_complete+0x40/0x40 > [86220.128207] ? call_usermodehelper_exec_async+0x12a/0x160 > [86220.128243] ret_from_fork+0x4b/0x60 Can you please try attached patch (untested)? --vtzGhvizbBRQ85DL Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="0001-ipv6-Do-not-sleep-in-RCU-read-side-critical-section.patch" >>From 70e4bc2a8fe08fb30251f786990a91d3ed2232e6 Mon Sep 17 00:00:00 2001 From: Ido Schimmel Date: Sat, 20 Jan 2018 15:29:33 +0200 Subject: [PATCH] ipv6: Do not sleep in RCU read-side critical section Signed-off-by: Ido Schimmel --- net/ipv6/addrconf.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/net/ipv6/addrconf.c b/net/ipv6/addrconf.c index ab99cb641b7c..9ad1365c91ca 100644 --- a/net/ipv6/addrconf.c +++ b/net/ipv6/addrconf.c @@ -4356,7 +4356,8 @@ static void addrconf_verify_rtnl(void) spin_lock(&ifpub->lock); ifpub->regen_count = 0; spin_unlock(&ifpub->lock); - ipv6_create_tempaddr(ifpub, ifp, true); + ipv6_create_tempaddr(ifpub, ifp, + false); in6_ifa_put(ifpub); in6_ifa_put(ifp); goto restart; -- 2.14.3 --vtzGhvizbBRQ85DL--