Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp3558042pxb; Mon, 24 Jan 2022 12:10:52 -0800 (PST) X-Google-Smtp-Source: ABdhPJzGVkwGDLvPFXe21cB1bXbtvuG6/OFdaMAWaSrJACMzj/dTk72L6v2QPaXOC5xfEQNT749i X-Received: by 2002:a63:360c:: with SMTP id d12mr12586245pga.395.1643055051814; Mon, 24 Jan 2022 12:10:51 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643055051; cv=none; d=google.com; s=arc-20160816; b=PmsbWsyOC/WTUgiM6qBsRxG70FRbqJnRag0AXb/21BnZeR+Vph5tujHa0ox6FjTRrt pfVN+Lg02AiULvXqI9NlsKa2pRXuhgQD+MD4hAAtprMh3QLY1IkBMr+vj2Zhr5k2Sc8M 6p+qDXp3nH/HhfbhQX7Ianyd61zRu9h/IloFuWJgnmDlQMYISLA9njWVs0yDdW5/9qcY Wmy44TucX6yCYBdJYVwPrC29lujd6+HH3dIMMcNleRil2DIFdf+tt9b9DHj6js+MhIFo K5tImkuIJeXNvBb00D1P7bnl+vvikyvOwiq9WGxUE9N+M4ChG6Tj5YDN3jivf6ogcQGa CwxA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=P0oMFyu+7leE0+rIH22kD5WtLngox0oFIWvBCQdYRFk=; b=PAkfU21a0Boabz4a3f0Bmb/+hwmY14jWk2VoD6E9Tsf5ylVg1p8OZclqpBCQOsd0ek 89RzTFMQS/tMbmteWo+uCkO8tg5Ja/C+By358NJKlcShRDLERgsM9DSAxk1cRLUAv3rD Xsw2L0p1nzbkDhjFVnpceZBCgj06vqkZF6SUD9z+OsLx/tLimXwDvhi2cZdxXBig1H+A NcuErNOGCLYWUV6Fnm1j1BcX2C6ASpBDHhZcv9aWOWLy0jdIApM9rJWNR5zR8tpFvVAU wRYBSMB9BtViMnRoAd4iYFnMug47tEfUnmSO7iPyiXm8nzEf4Mt14vQRAVu9IYJFN5nJ rUHQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=bhlRyYdR; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id gb22si259734pjb.28.2022.01.24.12.10.38; Mon, 24 Jan 2022 12:10:51 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=bhlRyYdR; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344304AbiAXTMF (ORCPT + 99 others); Mon, 24 Jan 2022 14:12:05 -0500 Received: from dfw.source.kernel.org ([139.178.84.217]:56912 "EHLO dfw.source.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1345178AbiAXTCu (ORCPT ); Mon, 24 Jan 2022 14:02:50 -0500 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 55F9360BAC; Mon, 24 Jan 2022 19:02:50 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 35337C340E5; Mon, 24 Jan 2022 19:02:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1643050969; bh=S+oUhieKCUVWkr3cNVSk7UFZZl4vLzAmix0sjkOrXIc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=bhlRyYdR5mIvU7RtyLzAMW1xI7L/0dHjsPVM5h+7PUc6itsHhiMcfxCccpHjF1sKu zA90sL+irKBnxyXBKMuTbgujs4bslbpmXYPmbfsEKGuU5Ht2H7hIv6k6e/K6LEJUXr EwMD6svhJb76IJaHJIx+CVKtxoqwGyg/kUxObjCE= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, syzbot+cce1ee31614c171f5595@syzkaller.appspotmail.com, Larry Finger , Kalle Valo Subject: [PATCH 4.14 013/186] rtlwifi: rtl8192cu: Fix WARNING when calling local_irq_restore() with interrupts enabled Date: Mon, 24 Jan 2022 19:41:28 +0100 Message-Id: <20220124183937.537903618@linuxfoundation.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220124183937.101330125@linuxfoundation.org> References: <20220124183937.101330125@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Larry Finger commit 8b144dedb928e4e2f433a328d58f44c3c098d63e upstream. Syzbot reports the following WARNING: [200~raw_local_irq_restore() called with IRQs enabled WARNING: CPU: 1 PID: 1206 at kernel/locking/irqflag-debug.c:10 warn_bogus_irq_restore+0x1d/0x20 kernel/locking/irqflag-debug.c:10 Hardware initialization for the rtl8188cu can run for as long as 350 ms, and the routine may be called with interrupts disabled. To avoid locking the machine for this long, the current routine saves the interrupt flags and enables local interrupts. The problem is that it restores the flags at the end without disabling local interrupts first. This patch fixes commit a53268be0cb9 ("rtlwifi: rtl8192cu: Fix too long disable of IRQs"). Reported-by: syzbot+cce1ee31614c171f5595@syzkaller.appspotmail.com Cc: stable@vger.kernel.org Fixes: a53268be0cb9 ("rtlwifi: rtl8192cu: Fix too long disable of IRQs") Signed-off-by: Larry Finger Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20211215171105.20623-1-Larry.Finger@lwfinger.net Signed-off-by: Greg Kroah-Hartman --- drivers/net/wireless/realtek/rtlwifi/rtl8192cu/hw.c | 1 + 1 file changed, 1 insertion(+) --- a/drivers/net/wireless/realtek/rtlwifi/rtl8192cu/hw.c +++ b/drivers/net/wireless/realtek/rtlwifi/rtl8192cu/hw.c @@ -1020,6 +1020,7 @@ int rtl92cu_hw_init(struct ieee80211_hw _InitPABias(hw); rtl92c_dm_init(hw); exit: + local_irq_disable(); local_irq_restore(flags); return err; }