* [PATCH RESEND] wifi: mt76: mt7996: fix NULL pointer dereference in mt7996_mcu_sta_bfer_he
@ 2024-09-03 1:39 Ma Ke
2024-09-03 4:55 ` Greg KH
0 siblings, 1 reply; 4+ messages in thread
From: Ma Ke @ 2024-09-03 1:39 UTC (permalink / raw)
To: nbd, lorenzo, ryder.lee, shayne.chen, sean.wang, kvalo,
matthias.bgg, angelogioacchino.delregno, chui-hao.chiu,
howard-yh.hsu, StanleyYP.Wang, benjamin-jw.lin, allen.ye,
chank.chen, meichia.chiu, Money.Wang, Bo.Jiao, akpm
Cc: linux-wireless, linux-kernel, linux-arm-kernel, linux-mediatek,
Ma Ke, stable
Fix the NULL pointer dereference in mt7996_mcu_sta_bfer_he
routine adding an sta interface to the mt7996 driver.
Found by code review.
Cc: stable@vger.kernel.org
Fixes: 98686cd21624 ("wifi: mt76: mt7996: add driver for MediaTek Wi-Fi 7 (802.11be) devices")
Signed-off-by: Ma Ke <make24@iscas.ac.cn>
---
drivers/net/wireless/mediatek/mt76/mt7996/mcu.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/drivers/net/wireless/mediatek/mt76/mt7996/mcu.c b/drivers/net/wireless/mediatek/mt76/mt7996/mcu.c
index 2e4fa9f48dfb..cba28d8d5562 100644
--- a/drivers/net/wireless/mediatek/mt76/mt7996/mcu.c
+++ b/drivers/net/wireless/mediatek/mt76/mt7996/mcu.c
@@ -1544,6 +1544,9 @@ mt7996_mcu_sta_bfer_he(struct ieee80211_sta *sta, struct ieee80211_vif *vif,
u8 nss_mcs = mt7996_mcu_get_sta_nss(mcs_map);
u8 snd_dim, sts;
+ if (!vc)
+ return;
+
bf->tx_mode = MT_PHY_TYPE_HE_SU;
mt7996_mcu_sta_sounding_rate(bf);
--
2.25.1
^ permalink raw reply related [flat|nested] 4+ messages in thread* Re: [PATCH RESEND] wifi: mt76: mt7996: fix NULL pointer dereference in mt7996_mcu_sta_bfer_he
2024-09-03 1:39 [PATCH RESEND] wifi: mt76: mt7996: fix NULL pointer dereference in mt7996_mcu_sta_bfer_he Ma Ke
@ 2024-09-03 4:55 ` Greg KH
0 siblings, 0 replies; 4+ messages in thread
From: Greg KH @ 2024-09-03 4:55 UTC (permalink / raw)
To: Ma Ke
Cc: nbd, lorenzo, ryder.lee, shayne.chen, sean.wang, kvalo,
matthias.bgg, angelogioacchino.delregno, chui-hao.chiu,
howard-yh.hsu, StanleyYP.Wang, benjamin-jw.lin, allen.ye,
chank.chen, meichia.chiu, Money.Wang, Bo.Jiao, akpm,
linux-wireless, linux-kernel, linux-arm-kernel, linux-mediatek,
stable
On Tue, Sep 03, 2024 at 09:39:13AM +0800, Ma Ke wrote:
> Fix the NULL pointer dereference in mt7996_mcu_sta_bfer_he
> routine adding an sta interface to the mt7996 driver.
>
> Found by code review.
>
> Cc: stable@vger.kernel.org
> Fixes: 98686cd21624 ("wifi: mt76: mt7996: add driver for MediaTek Wi-Fi 7 (802.11be) devices")
> Signed-off-by: Ma Ke <make24@iscas.ac.cn>
> ---
> drivers/net/wireless/mediatek/mt76/mt7996/mcu.c | 3 +++
> 1 file changed, 3 insertions(+)
>
> diff --git a/drivers/net/wireless/mediatek/mt76/mt7996/mcu.c b/drivers/net/wireless/mediatek/mt76/mt7996/mcu.c
> index 2e4fa9f48dfb..cba28d8d5562 100644
> --- a/drivers/net/wireless/mediatek/mt76/mt7996/mcu.c
> +++ b/drivers/net/wireless/mediatek/mt76/mt7996/mcu.c
> @@ -1544,6 +1544,9 @@ mt7996_mcu_sta_bfer_he(struct ieee80211_sta *sta, struct ieee80211_vif *vif,
> u8 nss_mcs = mt7996_mcu_get_sta_nss(mcs_map);
> u8 snd_dim, sts;
>
> + if (!vc)
> + return;
Why is this the only place you are checking the return value of
mt76_connac_get_he_phy_cap()? Either fix them all in this driver or
none as obviously it can not fail :(
thanks,
greg k-h
^ permalink raw reply [flat|nested] 4+ messages in thread
* [PATCH RESEND] wifi: mt76: mt7996: fix NULL pointer dereference in mt7996_mcu_sta_bfer_he
@ 2024-08-26 5:18 Ma Ke
0 siblings, 0 replies; 4+ messages in thread
From: Ma Ke @ 2024-08-26 5:18 UTC (permalink / raw)
To: nbd, lorenzo, ryder.lee, shayne.chen, sean.wang, kvalo,
matthias.bgg, angelogioacchino.delregno, chui-hao.chiu,
howard-yh.hsu, StanleyYP.Wang, benjamin-jw.lin, allen.ye,
chank.chen, meichia.chiu, Bo.Jiao, Money.Wang, akpm
Cc: linux-wireless, linux-kernel, linux-arm-kernel, linux-mediatek,
Ma Ke, stable
Fix the NULL pointer dereference in mt7996_mcu_sta_bfer_he
routine adding an sta interface to the mt7996 driver.
Found by code review.
Cc: stable@vger.kernel.org
Fixes: 98686cd21624 ("wifi: mt76: mt7996: add driver for MediaTek Wi-Fi 7 (802.11be) devices")
Signed-off-by: Ma Ke <make24@iscas.ac.cn>
---
drivers/net/wireless/mediatek/mt76/mt7996/mcu.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/drivers/net/wireless/mediatek/mt76/mt7996/mcu.c b/drivers/net/wireless/mediatek/mt76/mt7996/mcu.c
index 2e4fa9f48dfb..cba28d8d5562 100644
--- a/drivers/net/wireless/mediatek/mt76/mt7996/mcu.c
+++ b/drivers/net/wireless/mediatek/mt76/mt7996/mcu.c
@@ -1544,6 +1544,9 @@ mt7996_mcu_sta_bfer_he(struct ieee80211_sta *sta, struct ieee80211_vif *vif,
u8 nss_mcs = mt7996_mcu_get_sta_nss(mcs_map);
u8 snd_dim, sts;
+ if (!vc)
+ return;
+
bf->tx_mode = MT_PHY_TYPE_HE_SU;
mt7996_mcu_sta_sounding_rate(bf);
--
2.25.1
^ permalink raw reply related [flat|nested] 4+ messages in thread* [PATCH RESEND] wifi: mt76: mt7996: fix NULL pointer dereference in mt7996_mcu_sta_bfer_he
@ 2024-08-19 8:54 Ma Ke
0 siblings, 0 replies; 4+ messages in thread
From: Ma Ke @ 2024-08-19 8:54 UTC (permalink / raw)
To: nbd, lorenzo, ryder.lee, shayne.chen, sean.wang, kvalo,
matthias.bgg, angelogioacchino.delregno, chui-hao.chiu,
howard-yh.hsu, StanleyYP.Wang, benjamin-jw.lin, allen.ye,
chank.chen, meichia.chiu, Bo.Jiao, evelyn.tsai, Money.Wang, akpm
Cc: linux-wireless, linux-kernel, linux-arm-kernel, linux-mediatek,
Ma Ke, stable
Fix the NULL pointer dereference in mt7996_mcu_sta_bfer_he
routine adding an sta interface to the mt7996 driver.
Found by code review.
Cc: stable@vger.kernel.org
Fixes: 98686cd21624 ("wifi: mt76: mt7996: add driver for MediaTek Wi-Fi 7 (802.11be) devices")
Signed-off-by: Ma Ke <make24@iscas.ac.cn>
---
drivers/net/wireless/mediatek/mt76/mt7996/mcu.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/drivers/net/wireless/mediatek/mt76/mt7996/mcu.c b/drivers/net/wireless/mediatek/mt76/mt7996/mcu.c
index 2e4fa9f48dfb..cba28d8d5562 100644
--- a/drivers/net/wireless/mediatek/mt76/mt7996/mcu.c
+++ b/drivers/net/wireless/mediatek/mt76/mt7996/mcu.c
@@ -1544,6 +1544,9 @@ mt7996_mcu_sta_bfer_he(struct ieee80211_sta *sta, struct ieee80211_vif *vif,
u8 nss_mcs = mt7996_mcu_get_sta_nss(mcs_map);
u8 snd_dim, sts;
+ if (!vc)
+ return;
+
bf->tx_mode = MT_PHY_TYPE_HE_SU;
mt7996_mcu_sta_sounding_rate(bf);
--
2.25.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
end of thread, other threads:[~2024-09-03 4:57 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-09-03 1:39 [PATCH RESEND] wifi: mt76: mt7996: fix NULL pointer dereference in mt7996_mcu_sta_bfer_he Ma Ke
2024-09-03 4:55 ` Greg KH
-- strict thread matches above, loose matches on Subject: below --
2024-08-26 5:18 Ma Ke
2024-08-19 8:54 Ma Ke
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox