lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <b4a237a786dc46fab383aab3c26cac60@realtek.com>
Date:   Thu, 29 Dec 2022 09:39:24 +0000
From:   Ping-Ke Shih <pkshih@...ltek.com>
To:     Martin Blumenstingl <martin.blumenstingl@...glemail.com>,
        "linux-wireless@...r.kernel.org" <linux-wireless@...r.kernel.org>
CC:     "tony0620emma@...il.com" <tony0620emma@...il.com>,
        "kvalo@...nel.org" <kvalo@...nel.org>,
        "tehuang@...ltek.com" <tehuang@...ltek.com>,
        "s.hauer@...gutronix.de" <s.hauer@...gutronix.de>,
        "netdev@...r.kernel.org" <netdev@...r.kernel.org>,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: RE: [PATCH 4/4] rtw88: Use non-atomic rtw_iterate_stas() in rtw_ra_mask_info_update()



> -----Original Message-----
> From: Martin Blumenstingl <martin.blumenstingl@...glemail.com>
> Sent: Wednesday, December 28, 2022 9:36 PM
> To: linux-wireless@...r.kernel.org
> Cc: tony0620emma@...il.com; kvalo@...nel.org; Ping-Ke Shih <pkshih@...ltek.com>; tehuang@...ltek.com;
> s.hauer@...gutronix.de; netdev@...r.kernel.org; linux-kernel@...r.kernel.org; Martin Blumenstingl
> <martin.blumenstingl@...glemail.com>
> Subject: [PATCH 4/4] rtw88: Use non-atomic rtw_iterate_stas() in rtw_ra_mask_info_update()
> 
> USB and (upcoming) SDIO support may sleep in the read/write handlers.
> Use non-atomic rtw_iterate_stas() in rtw_ra_mask_info_update() because
> the iterator function rtw_ra_mask_info_update_iter() needs to read and
> write registers from within rtw_update_sta_info(). Using the non-atomic
> iterator ensures that we can sleep during USB and SDIO register reads
> and writes. This fixes "scheduling while atomic" or "Voluntary context
> switch within RCU read-side critical section!" warnings as seen by SDIO
> card users (but it also affects USB cards).
> 
> Fixes: 78d5bf925f30 ("wifi: rtw88: iterate over vif/sta list non-atomically")
> Suggested-by: Ping-Ke Shih <pkshih@...ltek.com>
> Signed-off-by: Martin Blumenstingl <martin.blumenstingl@...glemail.com>

Reviewed-by: Ping-Ke Shih <pkshih@...ltek.com>

> ---
>  drivers/net/wireless/realtek/rtw88/mac80211.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/net/wireless/realtek/rtw88/mac80211.c
> b/drivers/net/wireless/realtek/rtw88/mac80211.c
> index 776a9a9884b5..3b92ac611d3f 100644
> --- a/drivers/net/wireless/realtek/rtw88/mac80211.c
> +++ b/drivers/net/wireless/realtek/rtw88/mac80211.c
> @@ -737,7 +737,7 @@ static void rtw_ra_mask_info_update(struct rtw_dev *rtwdev,
>  	br_data.rtwdev = rtwdev;
>  	br_data.vif = vif;
>  	br_data.mask = mask;
> -	rtw_iterate_stas_atomic(rtwdev, rtw_ra_mask_info_update_iter, &br_data);
> +	rtw_iterate_stas(rtwdev, rtw_ra_mask_info_update_iter, &br_data);
>  }
> 
>  static int rtw_ops_set_bitrate_mask(struct ieee80211_hw *hw,
> @@ -746,7 +746,9 @@ static int rtw_ops_set_bitrate_mask(struct ieee80211_hw *hw,
>  {
>  	struct rtw_dev *rtwdev = hw->priv;
> 
> +	mutex_lock(&rtwdev->mutex);
>  	rtw_ra_mask_info_update(rtwdev, vif, mask);
> +	mutex_unlock(&rtwdev->mutex);
> 
>  	return 0;
>  }
> --
> 2.39.0

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ