Fix two possible NULL pointer dereferencing issues
Subsystems (2)
cover Fix two possible NULL pointer dereferencing issues
Lorenzo Bianconi (2):
mt76: fix possible NULL pointer dereferencing in mt76x2_ampdu_action()
mt76: fix possible NULL pointer dereferencing in
mt76x2_mac_write_txwi()
drivers/net/wireless/mediatek/mt76/mt76x2_mac.c | 2 +- drivers/net/wireless/mediatek/mt76/mt76x2_main.c | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-)
Signature · 1 line
2.13.6
PATCH 1/2 mt76: fix possible NULL pointer dereferencing in mt76x2_ampdu_action()
Initialize mt76_txq pointer after ieee80211_txq pointer check. Remove space after the pointer cast
--- drivers/net/wireless/mediatek/mt76/mt76x2_main.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/net/wireless/mediatek/mt76/mt76x2_main.c +3 -1
@@ -450,13 +450,15 @@ mt76x2_ampdu_action(struct ieee80211_hw *hw, struct ieee80211_vif *vif,struct mt76x2_dev *dev = hw->priv;struct mt76x2_sta *msta = (struct mt76x2_sta *) sta->drv_priv;struct ieee80211_txq *txq = sta->txq[params->tid]; -struct mt76_txq *mtxq = (struct mt76_txq *) txq->drv_priv;u16 tid = params->tid;u16 *ssn = ¶ms->ssn; +struct mt76_txq *mtxq;if (!txq)return -EINVAL ; + mtxq = (struct mt76_txq *)txq->drv_priv; +switch (action) {case IEEE80211_AMPDU_RX_START :mt76_set (dev,MT_WCID_ADDR (msta->wcid.idx) +4 ,BIT (16 + tid));
Signature · 1 line
2.13.6
Re: [1/2] mt76: fix possible NULL pointer dereferencing in mt76x2_ampdu_action()
Quoted 5 lines · Lorenzo Bianconi
Initialize
mt76_txqpointer afterieee80211_txqpointer check. Remove space after the pointer castFixes 7bc04215a66b ("mt76: add driver code for MT76x2e")Signed-off-by Lorenzo Bianconi <[email protected]>
What am I supposed to do with this and patch 2? Drop?
Signature · 3 lines
https://patchwork.kernel.org/patch/10111937/ https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches
A message that is not in the archive (sent off-list or not yet received): [email protected]
Re: [1/2] mt76: fix possible NULL pointer dereferencing in mt76x2_ampdu_action()
Quoted 9 lines
Quoted 5 lines · Lorenzo Bianconi
Initialize
mt76_txqpointer afterieee80211_txqpointer check. Remove space after the pointer castFixes 7bc04215a66b ("mt76: add driver code for MT76x2e")Signed-off-by Lorenzo Bianconi <[email protected]>What am I supposed to do with this and patch 2? Drop?
Hi Kalle,
What do you mean? Why drop?
Regards,
Lorenzo
Re: [1/2] mt76: fix possible NULL pointer dereferencing in mt76x2_ampdu_action()
Quoted 11 lines · Lorenzo Bianconi
Quoted 9 lines
Quoted 5 lines · Lorenzo Bianconi
Initialize
mt76_txqpointer afterieee80211_txqpointer check. Remove space after the pointer castFixes 7bc04215a66b ("mt76: add driver code for MT76x2e")Signed-off-by Lorenzo Bianconi <[email protected]>What am I supposed to do with this and patch 2? Drop?
What do you mean? Why drop?
I didn't see Felix's ack, at least not on patchwork.
Signature · 1 line
Kalle Valo
Re: [1/2] mt76: fix possible NULL pointer dereferencing in mt76x2_ampdu_action()
Quoted 10 lines
Quoted 8 lines · Lorenzo Bianconi
Quoted 8 lines
Quoted 5 lines · Lorenzo Bianconi
Initialize
mt76_txqpointer afterieee80211_txqpointer check. Remove space after the pointer castFixes 7bc04215a66b ("mt76: add driver code for MT76x2e")Signed-off-by Lorenzo Bianconi <[email protected]>
Quoted 8 lines
Quoted 3 lines
Quoted 1 line
What am I supposed to do with this and patch 2? Drop?
What do you mean? Why drop?
I didn't see Felix's ack, at least not on patchwork.
--
Kalle Valo
They should be fine since he merged them in mt76 github repo:
- https://github.com/openwrt/mt76/commit/ca5ca8c779932e7cab3224053377b29f139904b9
- https://github.com/openwrt/mt76/commit/2d4b8f57cc5e3101d45785ae9a9f1eb6fc229de9
Anyway we can wait for him, up to you.
Regards,
Lorenzo
Felix Fietkau
maintainerRe: [1/2] mt76: fix possible NULL pointer dereferencing in mt76x2_ampdu_action()
In reply to Kalle ValoQuoted 7 lines · Kalle Valo
Quoted 5 lines · Lorenzo Bianconi
Quoted 5 lines
Quoted 3 lines · Lorenzo Bianconi
Initialize
mt76_txqpointer afterieee80211_txqpointer check. Remove space after the pointer cast
Quoted 8 lines
Quoted 6 lines
Quoted 4 lines
Quoted 2 lines
Fixes 7bc04215a66b ("mt76: add driver code for MT76x2e")Signed-off-by Lorenzo Bianconi <[email protected]>What am I supposed to do with this and patch 2? Drop?
What do you mean? Why drop?
I didn't see Felix's ack, at least not on patchwork.
I sent my ack (for both patches) as a reply to 0/2 These patches should go in.
- Felix
Re: [1/2] mt76: fix possible NULL pointer dereferencing in mt76x2_ampdu_action()
Quoted 11 lines · Felix Fietkau
Quoted 10 lines · Kalle Valo
Quoted 8 lines · Lorenzo Bianconi
Quoted 8 lines
Quoted 5 lines · Lorenzo Bianconi
Initialize
mt76_txqpointer afterieee80211_txqpointer check. Remove space after the pointer castFixes 7bc04215a66b ("mt76: add driver code for MT76x2e")Signed-off-by Lorenzo Bianconi <[email protected]>
Quoted 7 lines
Quoted 5 lines
Quoted 3 lines
Quoted 1 line
What am I supposed to do with this and patch 2? Drop?
What do you mean? Why drop?
I didn't see Felix's ack, at least not on patchwork.
I sent my ack (for both patches) as a reply to 0/2
Ah. patchwork is annoying as it doesn't show the cover letter at all so I missed that.
Quoted 1 line
These patches should go in.
These two are applied now.
Signature · 1 line
Kalle Valo
Re: [1/2] mt76: fix possible NULL pointer dereferencing in mt76x2_ampdu_action()
On Mittwoch, 17. Januar 2018 16:50:23 CET Kalle Valo wrote:
[...]
Quoted 6 lines
Quoted 3 lines
Quoted 1 line
I didn't see Felix's ack, at least not on patchwork.
I sent my ack (for both patches) as a reply to 0/2
Ah. patchwork is annoying as it doesn't show the cover letter at all so I missed that.
Newer version at least can track the series and their cover letters. This is not completely what you want but at least there is hope. Here is an example:
https://patchwork.open-mesh.org/cover/17240/ (you can use "Related" to see all the patches in the series).
Kind regards,
Sven
Re: [1/2] mt76: fix possible NULL pointer dereferencing in mt76x2_ampdu_action()
Quoted 6 lines · Sven Eckelmann
On Mittwoch, 17. Januar 2018 16:50:23 CET Kalle Valo wrote:
[...]Quoted 4 lines
Quoted 3 lines
Quoted 1 line
I didn't see Felix's ack, at least not on patchwork.
I sent my ack (for both patches) as a reply to 0/2
Quoted 7 lines
Quoted 2 lines
Ah. patchwork is annoying as it doesn't show the cover letter at all so I missed that.
Newer version at least can track the series and their cover letters. This is not completely what you want but at least there is hope. Here is an example:
https://patchwork.open-mesh.org/cover/17240/ (you can use "Related" to see all the patches in the series).
Nice, looking forward to see that version in patchwork.kernel.org. My ultimate goal is that I could doo all my maintenance work via my patchwork script and not touch my email client at all. That's getting closer.
Signature · 1 line
Kalle Valo
Re: [1/2] mt76: fix possible NULL pointer dereferencing in mt76x2_ampdu_action()
In reply to Lorenzo BianconiQuoted 5 lines · Lorenzo Bianconi
Initialize
mt76_txqpointer afterieee80211_txqpointer check. Remove space after the pointer castFixes 7bc04215a66b ("mt76: add driver code for MT76x2e")Signed-off-by Lorenzo Bianconi <[email protected]>
2 patches applied to wireless-drivers-next.git, thanks.
99ac5327e902 mt76: fix possible NULL pointer dereferencing in mt76x2_ampdu_action() 98051872fd25 mt76: fix possible NULL pointer dereferencing in mt76x2_mac_write_txwi()
Signature · 3 lines
https://patchwork.kernel.org/patch/10111937/ https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches
PATCH 2/2 mt76: fix possible NULL pointer dereferencing in mt76x2_mac_write_txwi()
In reply to Lorenzo BianconiVerify wcid is not NULL before dereferencing the pointer to initialize txwi rate/power info
--- drivers/net/wireless/mediatek/mt76/mt76x2_mac.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/wireless/mediatek/mt76/mt76x2_mac.c +1 -1
@@ -185,7 +185,7 @@ void mt76x2_mac_write_txwi(struct mt76x2_dev *dev, struct mt76x2_txwi *txwi, txwi->pktid =1 ;spin_lock_bh (&dev->mt76.lock); -if (rate->idx <0 || !rate->count) { +if (wcid && (rate->idx <0 || !rate->count)) { txwi->rate = wcid->tx_rate; max_txpwr_adj = wcid->max_txpwr_adj; nss = wcid->tx_rate_nss;
Signature · 1 line
2.13.6
Quoted 4 lines · Lorenzo Bianconi
Lorenzo Bianconi (2):
mt76: fix possible NULL pointer dereferencing inmt76x2_ampdu_action()
mt76: fix possible NULL pointer dereferencing inmt76x2_mac_write_txwi()
For both patches: