From mboxrd@z Thu Jan 1 00:00:00 1970 From: David Miller Subject: Re: [PATCH] hv_netvsc: fix schedule in RCU context Date: Thu, 13 Sep 2018 10:30:55 -0700 (PDT) Message-ID: <20180913.103055.374831883600389403.davem@davemloft.net> References: <20180913150342.32101-1-sthemmin@microsoft.com> Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Cc: kys@microsoft.com, haiyangz@microsoft.com, netdev@vger.kernel.org, sthemmin@microsoft.com To: stephen@networkplumber.org Return-path: Received: from shards.monkeyblade.net ([23.128.96.9]:51404 "EHLO shards.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726821AbeIMWlY (ORCPT ); Thu, 13 Sep 2018 18:41:24 -0400 In-Reply-To: <20180913150342.32101-1-sthemmin@microsoft.com> Sender: netdev-owner@vger.kernel.org List-ID: From: Stephen Hemminger Date: Thu, 13 Sep 2018 08:03:43 -0700 > When netvsc device is removed it can call reschedule in RCU context. > This happens because canceling the subchannel setup work could (in theory) > cause a reschedule when manipulating the timer. > > To reproduce, run with lockdep enabled kernel and unbind > a network device from hv_netvsc (via sysfs). ... > Resolve this by getting RTNL earlier. This is safe because the subchannel > work queue does trylock on RTNL and will detect the race. > > Fixes: 7b2ee50c0cd5 ("hv_netvsc: common detach logic") > Signed-off-by: Stephen Hemminger Applied and queued up for -stable.