Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp2770771ybt; Mon, 22 Jun 2020 06:40:10 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzl4g2FigGLMxVFc3jZ5/EDAQ6+qJkrDHN3c1PGwZe3Vo0y6wHzKFE0IydXTVhotbOwV2ou X-Received: by 2002:a17:906:2656:: with SMTP id i22mr15032684ejc.397.1592833210451; Mon, 22 Jun 2020 06:40:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1592833210; cv=none; d=google.com; s=arc-20160816; b=uKKsNXjLzf65r3cFv32lsxxaXx2MBXwCxAX9eVkC5AFnMjCw0lam1RPg6lnxkaSgdJ Y/uQmX/PB/7xB4XBL5gYcK1U0L6tyNuCR5Brs8/mQoExYWAiUVTkuvd9AnHXrBwwZwa1 xayPLjBMFjn8DgOiyiE5NHHloHS1DCO5khmxBjC8poNED4CsVhKqlO3xhTBgBQPj6Fv0 ZY8MJqCYyzm4klBrUm/bML362jYVlmHgKl5P/fYbP0VVIKB/rPMXK0uqK/rd1bPFpotx YndJU/v6cCaiS4cd3MMo8iXwXp6pIuW2TN963BL+j4v8G841p2cHWcEX6dYZJYEdVf54 TA3Q== 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; bh=T5xMLeLDbT3eZsd+/7xg0zNPwNz7IrE+83YEp/G10gI=; b=KK9DdFJ8sjm7nqjhVdn3dWS8CTX4OWw5N2kREJ0529wUfTW4vCnTdqo2Hj5hAMGD56 0aXuWxPVV0e6NrqXlNkh565hrfhopNid7l4RiSxwf4vpe35AA+AlAKLN6JnkXZUr9coq zP48q+bjGsO5nnx9udY+SJd360xuuPXG43cXNBq1tBKVGfFmVquSpXe7CKOK+Rp9sKBq GWf9xKs0n7Z3YKTG+Jz3Wja1LuAuTdkUFHAZzxyGT5lx2jtASpw4p9CKQpfkccPb4PM5 CQ7/qQnTQVqExkYUW3LPoSMc+iQKCypShEA7Qxw2KVyVJBGMe7w377rXEiDAjRrgGxqd c/vg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id y25si9663397edm.63.2020.06.22.06.39.47; Mon, 22 Jun 2020 06:40:10 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728951AbgFVNjl (ORCPT + 99 others); Mon, 22 Jun 2020 09:39:41 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49330 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728212AbgFVNjl (ORCPT ); Mon, 22 Jun 2020 09:39:41 -0400 Received: from mxout014.mail.hostpoint.ch (mxout014.mail.hostpoint.ch [IPv6:2a00:d70:0:e::314]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D13ADC061573 for ; Mon, 22 Jun 2020 06:39:40 -0700 (PDT) Received: from [10.0.2.46] (helo=asmtp013.mail.hostpoint.ch) by mxout014.mail.hostpoint.ch with esmtp (Exim 4.92.3 (FreeBSD)) (envelope-from ) id 1jnMPP-000Hxu-Ke; Mon, 22 Jun 2020 15:22:47 +0200 Received: from [2a02:168:6182:1:4840:f038:bf12:aa10] (helo=ryzen2700.dss.husqvarnagroup.com) by asmtp013.mail.hostpoint.ch with esmtpsa (TLSv1.3:TLS_AES_256_GCM_SHA384:256) (Exim 4.92.3 (FreeBSD)) (envelope-from ) id 1jnMPP-0006GV-F3; Mon, 22 Jun 2020 15:22:47 +0200 X-Authenticated-Sender-Id: reto-schneider@reto-schneider.ch From: Reto Schneider To: linux-wireless@vger.kernel.org Cc: Larry.Finger@lwfinger.net, Reto Schneider Subject: [PATCH 1/3] rtl8192cu: Fix deadlock Date: Mon, 22 Jun 2020 15:21:11 +0200 Message-Id: <20200622132113.14508-2-code@reto-schneider.ch> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200622132113.14508-1-code@reto-schneider.ch> References: <20200622132113.14508-1-code@reto-schneider.ch> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org Prevent code from calling itself indirectly, causing the driver to hang and consume 100% CPU. Without this fix, the following script can bring down a single CPU system: ``` while true; do rmmod rtl8192cu modprobe rtl8192cu done ``` Signed-off-by: Reto Schneider --- drivers/net/wireless/realtek/rtlwifi/usb.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/net/wireless/realtek/rtlwifi/usb.c b/drivers/net/wireless/realtek/rtlwifi/usb.c index c66c6dc00378..d3bbfc0171f6 100644 --- a/drivers/net/wireless/realtek/rtlwifi/usb.c +++ b/drivers/net/wireless/realtek/rtlwifi/usb.c @@ -680,8 +680,10 @@ static void _rtl_usb_cleanup_rx(struct ieee80211_hw *hw) tasklet_kill(&rtlusb->rx_work_tasklet); cancel_work_sync(&rtlpriv->works.lps_change_work); - flush_workqueue(rtlpriv->works.rtl_wq); - destroy_workqueue(rtlpriv->works.rtl_wq); + if (rtlpriv->works.rtl_wq) { + destroy_workqueue(rtlpriv->works.rtl_wq); + rtlpriv->works.rtl_wq = NULL; + } skb_queue_purge(&rtlusb->rx_queue); -- 2.20.1