Patch "wifi: mt76: mt7615: fix possible race in mt7615_mac_sta_poll" has been added to the 5.10-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a note to let you know that I've just added the patch titled

    wifi: mt76: mt7615: fix possible race in mt7615_mac_sta_poll

to the 5.10-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     wifi-mt76-mt7615-fix-possible-race-in-mt7615_mac_sta.patch
and it can be found in the queue-5.10 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.



commit fcc1b510ab19fd0a02a1ef01cc6eeb5c0a26759f
Author: Lorenzo Bianconi <lorenzo@xxxxxxxxxx>
Date:   Wed May 24 16:39:32 2023 +0200

    wifi: mt76: mt7615: fix possible race in mt7615_mac_sta_poll
    
    [ Upstream commit 30bc32c7c1f975cc3c14e1c7dc437266311282cf ]
    
    Grab sta_poll_lock spinlock in mt7615_mac_sta_poll routine in order to
    avoid possible races with mt7615_mac_add_txs() or mt7615_mac_fill_rx()
    removing msta pointer from sta_poll_list.
    
    Fixes: a621372a04ac ("mt76: mt7615: rework mt7615_mac_sta_poll for usb code")
    Signed-off-by: Lorenzo Bianconi <lorenzo@xxxxxxxxxx>
    Signed-off-by: Kalle Valo <kvalo@xxxxxxxxxx>
    Link: https://lore.kernel.org/r/48b23404b759de4f1db2ef85975c72a4aeb1097c.1684938695.git.lorenzo@xxxxxxxxxx
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/drivers/net/wireless/mediatek/mt76/mt7615/mac.c b/drivers/net/wireless/mediatek/mt76/mt7615/mac.c
index b26617026e831..4364f73b501da 100644
--- a/drivers/net/wireless/mediatek/mt76/mt7615/mac.c
+++ b/drivers/net/wireless/mediatek/mt76/mt7615/mac.c
@@ -779,7 +779,10 @@ void mt7615_mac_sta_poll(struct mt7615_dev *dev)
 
 		msta = list_first_entry(&sta_poll_list, struct mt7615_sta,
 					poll_list);
+
+		spin_lock_bh(&dev->sta_poll_lock);
 		list_del_init(&msta->poll_list);
+		spin_unlock_bh(&dev->sta_poll_lock);
 
 		addr = mt7615_mac_wtbl_addr(dev, msta->wcid.idx) + 19 * 4;
 



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux