From patchwork Tue Oct 27 13:49:25 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 312579 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-12.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id D730FC55179 for ; Tue, 27 Oct 2020 15:33:57 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 8D57B22282 for ; Tue, 27 Oct 2020 15:33:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1603812837; bh=+4H4WFq6iqLkSP8MU5R91dl1aEP8ONEACrLwNZUsAag=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=XhzvoE7IypHtd9oPp83rhhBym69fYVBW2CWqH0fdi5prQBzGRFkPnWVe2sAZ5innM DnP5Vc/CE1gzvmlzKfTzadntq3PqoU6uJgx8pijglzEo62xTrhjbvf8EuxN7VxFW5i vPa0gcC2xDC7/6vvTuq81JcvcqIglJdjhi8sgW7o= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1799895AbgJ0Pd4 (ORCPT ); Tue, 27 Oct 2020 11:33:56 -0400 Received: from mail.kernel.org ([198.145.29.99]:51604 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1799888AbgJ0Pd4 (ORCPT ); Tue, 27 Oct 2020 11:33:56 -0400 Received: from localhost (83-86-74-64.cable.dynamic.v4.ziggo.nl [83.86.74.64]) (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 843692225E; Tue, 27 Oct 2020 15:33:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1603812835; bh=+4H4WFq6iqLkSP8MU5R91dl1aEP8ONEACrLwNZUsAag=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=RClo11j7oMK4Y+yJYzK/6jmrMzM7DDmzkhOlb3OQ3o5jjfHsDs2jQVvipH3YUu6qM u36zrcJsVpY/wHcRXLHy14gpL7kja28CnVJRz4eUBCJPTB+Eb2EoEQFfOZ/vfYhzQl +rhcnsgmhLGWsiVYaU7yCCOfYTJxTqaPWO/0MElw= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Lorenzo Bianconi , Felix Fietkau , Sasha Levin Subject: [PATCH 5.9 315/757] mt76: mt7615: hold mt76 lock queueing wd in mt7615_queue_key_update Date: Tue, 27 Oct 2020 14:49:25 +0100 Message-Id: <20201027135505.316423767@linuxfoundation.org> X-Mailer: git-send-email 2.29.1 In-Reply-To: <20201027135450.497324313@linuxfoundation.org> References: <20201027135450.497324313@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Lorenzo Bianconi [ Upstream commit cddaaa56375615c256eb6960d3092ddb8a7a9154 ] wq queue is always updated holding mt76 spinlock. Grab mt76 lock in mt7615_queue_key_update() before putting a new element at the end of the queue. Fixes: eb99cc95c3b65 ("mt76: mt7615: introduce mt7663u support") Signed-off-by: Lorenzo Bianconi Signed-off-by: Felix Fietkau Signed-off-by: Sasha Levin --- drivers/net/wireless/mediatek/mt76/mt7615/main.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/net/wireless/mediatek/mt76/mt7615/main.c b/drivers/net/wireless/mediatek/mt76/mt7615/main.c index 2d0b1f49fdbcf..bafe2bdeb5eb4 100644 --- a/drivers/net/wireless/mediatek/mt76/mt7615/main.c +++ b/drivers/net/wireless/mediatek/mt76/mt7615/main.c @@ -361,7 +361,10 @@ mt7615_queue_key_update(struct mt7615_dev *dev, enum set_key_cmd cmd, wd->key.keylen = key->keylen; wd->key.cmd = cmd; + spin_lock_bh(&dev->mt76.lock); list_add_tail(&wd->node, &dev->wd_head); + spin_unlock_bh(&dev->mt76.lock); + queue_work(dev->mt76.wq, &dev->wtbl_work); return 0;