Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp3552368pxb; Mon, 24 Jan 2022 12:03:40 -0800 (PST) X-Google-Smtp-Source: ABdhPJwRjvGQsUUM9quQU5V6BdkQCXMvYQlu8cmsEjzx73VdU3cH418lXr7fjRqwU+JWX+NXLLaG X-Received: by 2002:a63:f962:: with SMTP id q34mr7255572pgk.86.1643054620158; Mon, 24 Jan 2022 12:03:40 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643054620; cv=none; d=google.com; s=arc-20160816; b=KSkN/uwEl+yeLnLBJWlw8Q4io5Q3O5ngSPpU+71i2LfsE0PvMsiC7T2JNtJP/rkj+g s55EgECGGg6a3qRyPYVMKBZjCrOlILEIogo7ltdAdWZklBxq4TZ4Xwh7Bch8JubcIR2C Cm0FXkD/w2DaLPYrJeRwb0MOxXAuSdULcUpYqRgGZjLUC2/nKXjfAeY8rp44TzyTgPgT s2fEkKXDMfOijaTVeCxM0XYzRQSQ2Gd7WnYZJ609SkMLRLMdnUrW2n8cfYpiVNZF1nj8 +/1T1097VA75N1TVNuV1qNX01Rm8DSHwA1AfVQTC8NmsmJxkDUzB5hAyAgr4yYvkYyK1 Yayg== 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=MI5hTcQrTOCCzO9+N054sR0Cz2NvMTUYjtlPvqMSDLw=; b=ggOKiTwKnLbNAgthieT7UY0al9Ml4cw8JQCt1F99Gs1HHrSc/e8iSrVBAhpeeH2xHf fc9Zy1TQePC2sKAPmzq6LV1OhQWKuP/kDcUlvWC024HN8mYVs9Gjk0F3tyv18puSPxGe q+GGIkLjRjOO4Yr+bUhbygnCMm2kSP6MbljgyhtxU8h0vnBVJzLkwzphoQMCp8YxmFZj BkWu+mE1jqFR1iewlwMSbEZzaCnIFHK2JQy7pJWp9DYUgBj4atM9B0VnK3p1ydP++MmR BCWT+z3xNoBhSx47xlpwJvfxPNjpA+BRJod4t9Cw2gqVlZDuRnkHs365oYitfV5PtOJ7 QTdA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=gDA3qoz1; 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 j9si14885569pfu.84.2022.01.24.12.03.27; Mon, 24 Jan 2022 12:03:40 -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=gDA3qoz1; 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 S1345208AbiAXTDD (ORCPT + 99 others); Mon, 24 Jan 2022 14:03:03 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44638 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1344678AbiAXS6z (ORCPT ); Mon, 24 Jan 2022 13:58:55 -0500 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EE6C0C0612B2; Mon, 24 Jan 2022 10:56:12 -0800 (PST) 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 ams.source.kernel.org (Postfix) with ESMTPS id 933E1B81227; Mon, 24 Jan 2022 18:56:12 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id B5E31C340E5; Mon, 24 Jan 2022 18:56:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1643050571; bh=szx3KHnAGqYPCIQSnKc2YO2cne5YMw4r5dPOGfee4w8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=gDA3qoz1BCSoPeI7kQzY9xiO/MZKav2tbhtPnwK4mVJy0jld8g8oVWFZi8OkSKqMI EkcPNyxjNd3H8oD2CNPmFhSGEI0pfXBlxRbTJFZ/Dbfj2BcvQLcUMjd/RAfNS/e08z CfySvCJdHsUEQrJVHQYkz/t8Y9AUu27STFUrQq4M= 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.9 012/157] rtlwifi: rtl8192cu: Fix WARNING when calling local_irq_restore() with interrupts enabled Date: Mon, 24 Jan 2022 19:41:42 +0100 Message-Id: <20220124183933.183700115@linuxfoundation.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220124183932.787526760@linuxfoundation.org> References: <20220124183932.787526760@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 @@ -1037,6 +1037,7 @@ int rtl92cu_hw_init(struct ieee80211_hw _InitPABias(hw); rtl92c_dm_init(hw); exit: + local_irq_disable(); local_irq_restore(flags); return err; }