linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] mac80211: fix issue with possible txq NULL pointer
@ 2018-09-14 16:00 Erik Stromdahl
  2018-09-17  7:40 ` Johannes Berg
  0 siblings, 1 reply; 2+ messages in thread
From: Erik Stromdahl @ 2018-09-14 16:00 UTC (permalink / raw)
  To: johannes, davem, linux-wireless, linux-kernel; +Cc: Erik Stromdahl

Drivers that do not have the BUFF_MMPDU_TXQ flag set will not have a
TXQ for the special TID = 16.

In this case, the last member in the *struct ieee80211_sta* txq array
will be NULL.

We must check this in order not to get a NULL pointer dereference when
iterating the txq array.

Signed-off-by: Erik Stromdahl <erik.stromdahl@gmail.com>
---
 net/mac80211/util.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/net/mac80211/util.c b/net/mac80211/util.c
index 36a3c2ada515..ef5d1f60a63b 100644
--- a/net/mac80211/util.c
+++ b/net/mac80211/util.c
@@ -264,6 +264,9 @@ static void __ieee80211_wake_txqs(struct ieee80211_sub_if_data *sdata, int ac)
 		for (i = 0; i < ARRAY_SIZE(sta->sta.txq); i++) {
 			struct ieee80211_txq *txq = sta->sta.txq[i];
 
+			if (!txq)
+				continue;
+
 			txqi = to_txq_info(txq);
 
 			if (ac != txq->ac)
-- 
2.18.0


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] mac80211: fix issue with possible txq NULL pointer
  2018-09-14 16:00 [PATCH] mac80211: fix issue with possible txq NULL pointer Erik Stromdahl
@ 2018-09-17  7:40 ` Johannes Berg
  0 siblings, 0 replies; 2+ messages in thread
From: Johannes Berg @ 2018-09-17  7:40 UTC (permalink / raw)
  To: Erik Stromdahl, davem, linux-wireless, linux-kernel

On Fri, 2018-09-14 at 18:00 +0200, Erik Stromdahl wrote:
> Drivers that do not have the BUFF_MMPDU_TXQ flag set will not have a
> TXQ for the special TID = 16.
> 
> In this case, the last member in the *struct ieee80211_sta* txq array
> will be NULL.
> 
> We must check this in order not to get a NULL pointer dereference when
> iterating the txq array.

Uh, yes, thanks. This is my fault - I merged the overlapping patches
closely together.

johannes

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2018-09-17  7:41 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-09-14 16:00 [PATCH] mac80211: fix issue with possible txq NULL pointer Erik Stromdahl
2018-09-17  7:40 ` Johannes Berg

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).