Received: by 2002:a5b:505:0:0:0:0:0 with SMTP id o5csp2073595ybp; Thu, 10 Oct 2019 01:42:23 -0700 (PDT) X-Google-Smtp-Source: APXvYqyjNXnZtHTZ6MV7C+qyokarN6qECFL+IMTFRRr4CL37BGqu/qcyDmdaFt0+hFOlsOUOuROG X-Received: by 2002:aa7:c616:: with SMTP id h22mr6933194edq.296.1570696943590; Thu, 10 Oct 2019 01:42:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1570696943; cv=none; d=google.com; s=arc-20160816; b=XFjZqll86Oj4Er3EEHBpBKUdu8P++4B9+kS8Qvks48iIpv4zeQ1ACNcZwwhwPscaxr ryhByDU+y1sEyD69aCZWrhJOGA9Tv6C3eh7RHrQ4XmJ8Z51ndr0nc/Thfv6I6aGr8hG6 Wowtx5RNvVDtzvCXQNwn3SvLbn4dx8r9EBvUz1rGf1+GdGIbI25i2rU1Jd4y0PkRBVWN lhPynpmWfUK3NUcAKE8S9XL/NBlPDEZ4mxrYgWGbf/zeLnIU+QNboibNkYIh8UJeViII 5z6AOr6aBJJ1MKaBCnM1UntCXuv4DY+I2CLT9H+NYE4rI88bPNw9uYLsvbGyVtKHk0F0 pSTA== 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 :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=cUh/BaYcPA5SNcUWyW0a0N5WnJgiNKZanNUG3XaG5AA=; b=k6iePtyPLIT5IKZIGessIJlvtUdgMpk9ttfY4Oe5ecawBLGTzGUs9BxSKVrghxOtAU o8l/nO8yPa5tv3qqoQpw0SOuO0Ca5/vvb3H+FenqsHNRhT4uy2se1izW5ak8yhiuG9RY N3FGVa7B3tPv5w2hx0zYYYpTdrcDHymXz5qhgwyNQmNtvyEg3LGTufRLnN4bSo01C8vu BQJndgZ5TQ4nAc8sz4mAORW+8KASFuwqLyA+8k/j9qAJ1f7S4NyDxdJTsFrCE6d1V4bu CW4QEsrh5UZwhNjKQaDcf6uuy0qXwdEkixmgYJtNztj2bdpDHbsJF5yJYBKQzQokkv3+ JFTg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=GpNh+JMB; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id t4si2582109ejd.328.2019.10.10.01.42.00; Thu, 10 Oct 2019 01:42:23 -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=GpNh+JMB; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388198AbfJJIkv (ORCPT + 99 others); Thu, 10 Oct 2019 04:40:51 -0400 Received: from mail.kernel.org ([198.145.29.99]:44968 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2387576AbfJJIkt (ORCPT ); Thu, 10 Oct 2019 04:40:49 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id CA83420B7C; Thu, 10 Oct 2019 08:40:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1570696849; bh=U7gRGV/O4IvB29cLMdvtxm+jQ0J8p2tK9b/FYOCtQDw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=GpNh+JMBon3ubE7i29mMMoEqt2MoETxx49L12acv5kbLp9fg58ndv2OKJuJwQTh0X 1sHZk/gPZ6DJnlBgSX/63X/V/UjTFbLuFPxmGmyj389RLFjwxNd4Yu3kcd1HHp5V1i K7Gh6V85sTXIx3XRZ3G/zELfHK6m/A9j8j5IrlKM= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Aaron Hill , Lukas Redlinger , Oleksii Shevchuk , =?UTF-8?q?Toke=20H=C3=B8iland-J=C3=B8rgensen?= , Johannes Berg , Jiri Kosina Subject: [PATCH 5.3 073/148] mac80211: keep BHs disabled while calling drv_tx_wake_queue() Date: Thu, 10 Oct 2019 10:35:34 +0200 Message-Id: <20191010083615.810908484@linuxfoundation.org> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20191010083609.660878383@linuxfoundation.org> References: <20191010083609.660878383@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Johannes Berg commit d8dec42b5c2d2b273bc30b0e073cfbe832d69902 upstream. Drivers typically expect this, as it's the case for almost all cases where this is called (i.e. from the TX path). Also, the code in mac80211 itself (if the driver calls ieee80211_tx_dequeue()) expects this as it uses this_cpu_ptr() without additional protection. This should fix various reports of the problem: https://bugzilla.kernel.org/show_bug.cgi?id=204127 https://lore.kernel.org/linux-wireless/CAN5HydrWb3o_FE6A1XDnP1E+xS66d5kiEuhHfiGKkLNQokx13Q@mail.gmail.com/ https://lore.kernel.org/lkml/nycvar.YFH.7.76.1909111238470.473@cbobk.fhfr.pm/ Cc: stable@vger.kernel.org Reported-and-tested-by: Jiri Kosina Reported-by: Aaron Hill Reported-by: Lukas Redlinger Reported-by: Oleksii Shevchuk Fixes: 21a5d4c3a45c ("mac80211: add stop/start logic for software TXQs") Link: https://lore.kernel.org/r/1569928763-I3e8838c5ecad878e59d4a94eb069a90f6641461a@changeid Reviewed-by: Toke Høiland-Jørgensen Signed-off-by: Johannes Berg Signed-off-by: Greg Kroah-Hartman --- net/mac80211/util.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) --- a/net/mac80211/util.c +++ b/net/mac80211/util.c @@ -247,7 +247,8 @@ static void __ieee80211_wake_txqs(struct struct sta_info *sta; int i; - spin_lock_bh(&fq->lock); + local_bh_disable(); + spin_lock(&fq->lock); if (sdata->vif.type == NL80211_IFTYPE_AP) ps = &sdata->bss->ps; @@ -273,9 +274,9 @@ static void __ieee80211_wake_txqs(struct &txqi->flags)) continue; - spin_unlock_bh(&fq->lock); + spin_unlock(&fq->lock); drv_wake_tx_queue(local, txqi); - spin_lock_bh(&fq->lock); + spin_lock(&fq->lock); } } @@ -288,12 +289,14 @@ static void __ieee80211_wake_txqs(struct (ps && atomic_read(&ps->num_sta_ps)) || ac != vif->txq->ac) goto out; - spin_unlock_bh(&fq->lock); + spin_unlock(&fq->lock); drv_wake_tx_queue(local, txqi); + local_bh_enable(); return; out: - spin_unlock_bh(&fq->lock); + spin_unlock(&fq->lock); + local_bh_enable(); } static void