Thanks to visit codestin.com
Credit goes to github.com

Skip to content
This repository was archived by the owner on Sep 24, 2020. It is now read-only.

Commit 901b9f4

Browse files
dziedjangregkh
authored andcommitted
mac80211: fix divide by zero when NOA update
commit 519ee69 upstream. In case of one shot NOA the interval can be 0, catch that instead of potentially (depending on the driver) crashing like this: divide error: 0000 [#1] SMP [...] Call Trace: <IRQ> [<ffffffffc08e891c>] ieee80211_extend_absent_time+0x6c/0xb0 [mac80211] [<ffffffffc08e8a17>] ieee80211_update_p2p_noa+0xb7/0xe0 [mac80211] [<ffffffffc069cc30>] ath9k_p2p_ps_timer+0x170/0x190 [ath9k] [<ffffffffc070adf8>] ath_gen_timer_isr+0xc8/0xf0 [ath9k_hw] [<ffffffffc0691156>] ath9k_tasklet+0x296/0x2f0 [ath9k] [<ffffffff8107ad65>] tasklet_action+0xe5/0xf0 [...] Signed-off-by: Janusz Dziedzic <[email protected]> Signed-off-by: Johannes Berg <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent db96a3c commit 901b9f4

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

net/mac80211/util.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2951,6 +2951,13 @@ ieee80211_extend_noa_desc(struct ieee80211_noa_data *data, u32 tsf, int i)
29512951
if (end > 0)
29522952
return false;
29532953

2954+
/* One shot NOA */
2955+
if (data->count[i] == 1)
2956+
return false;
2957+
2958+
if (data->desc[i].interval == 0)
2959+
return false;
2960+
29542961
/* End time is in the past, check for repetitions */
29552962
skip = DIV_ROUND_UP(-end, data->desc[i].interval);
29562963
if (data->count[i] < 255) {

0 commit comments

Comments
 (0)