Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp2696084ybl; Thu, 29 Aug 2019 11:35:55 -0700 (PDT) X-Google-Smtp-Source: APXvYqxrKCijDlVHTFqp1/dT4Q87BCz+UEOzyW4M1DNiS/jLPHoPIQ6sArCSDGGz2S4vsKz9mfOE X-Received: by 2002:a17:90a:e392:: with SMTP id b18mr11040492pjz.140.1567103755753; Thu, 29 Aug 2019 11:35:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1567103755; cv=none; d=google.com; s=arc-20160816; b=tvZk25TfliAwIQClWEdwjPaaDiRSDzvs8tJ1hJ9gVl7K8KJxtC4ajX2Om2uC+O60gF A0Y+gaSlxuKxq87qQzBPrLj+p2BmsL7sKMYvuW8VV9r12/BNhpJQptfTKUNLoW6O7kRP 8RJzKc+bEm37dt/bJ5U4k0o5+ZVP7FzXi+GDgcJ+UnDntATdJ6BEO1pNDYsC/+xQpTtL vbiAtkgH0ObUWnm2rL47PIqUe/oLCmIaGDqrS0OC82YJsSND7Hlmqr1814sRcS4yrIpI P5q4xW7k84T24ONjB0w2iBC7z3zvOXKSoDdilZf99wnksyjepQlJMosp+sK5ZrZqTqVt Kn8A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=z4J/TW3hB2e6PC8spnbqFFmdSekd1Zc4YvBnRI4piHg=; b=vrqafzFjexaWW/ZDwcC1ee6wco6fB6vm0qqcOVSXos/jTRgEPoe2AIFqDAlfRsdloF REksAptgzt6r/TGrAdqHO2fyeKIsxuVY1jYt6veKXEaMz8a0UAxgvTvB4gxLyQQRWAxQ HANL+t43I3A4AtiwLFr1GJ+z4FsOLkNP4fJGwAXUCE3P7WM2+P627OWX9hPaOhXHf2JW a+9lMp/rAZWCyd+3TXCgt5TdfGfC/s/tl9pCbFHgn9Aub2uJqD3V2PCpfaJhNgSKZ4bN vY+NzcBjy93SJ+1O9hMDZkQeaM0mq3dTG4TxluF9ptqzXM1Y7IvLG1xkzlgfxLGOOdeG w+Zw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=NZ3xDZIv; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id az10si2565432plb.383.2019.08.29.11.35.40; Thu, 29 Aug 2019 11:35:55 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=NZ3xDZIv; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729182AbfH2Sdf (ORCPT + 99 others); Thu, 29 Aug 2019 14:33:35 -0400 Received: from mail.kernel.org ([198.145.29.99]:55424 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728468AbfH2SNo (ORCPT ); Thu, 29 Aug 2019 14:13:44 -0400 Received: from sasha-vm.mshome.net (c-73-47-72-35.hsd1.nh.comcast.net [73.47.72.35]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 2B7692189D; Thu, 29 Aug 2019 18:13:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1567102423; bh=UpQsW1BGMX/sSqWtk8tg+B0ZE33BOytp6YJxphMj69k=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=NZ3xDZIvGgO4sAvxAnaGbMvljZTMUmb1eRSY/PvoWcwDiiBeRs/9XzblNq2QBeDl9 ac17zDL4W14TvIWmOqK9G66UshU3w9QLy4paxlTstwfEBPGN3HOnp05qdLzfl4CroU g+JK7uqT2ozFpralsP0FGfWAKjNGvzMR9wO0hcQ8= From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Taehee Yoo , Andrew Bowers , Jeff Kirsher , "David S . Miller" , Sasha Levin , netdev@vger.kernel.org Subject: [PATCH AUTOSEL 5.2 15/76] ixgbe: fix possible deadlock in ixgbe_service_task() Date: Thu, 29 Aug 2019 14:12:10 -0400 Message-Id: <20190829181311.7562-15-sashal@kernel.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190829181311.7562-1-sashal@kernel.org> References: <20190829181311.7562-1-sashal@kernel.org> MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Taehee Yoo [ Upstream commit 8b6381600d59871fbe44d36522272f961ab42410 ] ixgbe_service_task() calls unregister_netdev() under rtnl_lock(). But unregister_netdev() internally calls rtnl_lock(). So deadlock would occur. Fixes: 59dd45d550c5 ("ixgbe: firmware recovery mode") Signed-off-by: Taehee Yoo Tested-by: Andrew Bowers Signed-off-by: Jeff Kirsher Signed-off-by: David S. Miller Signed-off-by: Sasha Levin --- drivers/net/ethernet/intel/ixgbe/ixgbe_main.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c index 57fd9ee6de665..f7c049559c1a5 100644 --- a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c +++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c @@ -7893,11 +7893,8 @@ static void ixgbe_service_task(struct work_struct *work) return; } if (ixgbe_check_fw_error(adapter)) { - if (!test_bit(__IXGBE_DOWN, &adapter->state)) { - rtnl_lock(); + if (!test_bit(__IXGBE_DOWN, &adapter->state)) unregister_netdev(adapter->netdev); - rtnl_unlock(); - } ixgbe_service_event_complete(adapter); return; } -- 2.20.1