Linux wireless drivers development
 help / color / mirror / Atom feed
* re: mac80211: add rate mask logic for vht rates
@ 2015-08-18 19:47 Dan Carpenter
  2015-08-19 20:16 ` Lorenzo Bianconi
  0 siblings, 1 reply; 2+ messages in thread
From: Dan Carpenter @ 2015-08-18 19:47 UTC (permalink / raw)
  To: lorenzo.bianconi83; +Cc: linux-wireless

Hello Lorenzo Bianconi,

The patch b119ad6e726c: "mac80211: add rate mask logic for vht rates"
from Aug 6, 2015, leads to the following static checker warning:

	net/mac80211/cfg.c:2520 ieee80211_set_bitrate_mask()
	error: buffer overflow 'sdata->rc_rateidx_vht_mcs_mask[i]' 8 <= 9

net/mac80211/cfg.c
  2516                  for (j = 0; j < IEEE80211_HT_MCS_MASK_LEN; j++) {
                                        ^^^^^^^^^^^^^^^^^^^^^^^^^
This is 10.

  2517                          if (~sdata->rc_rateidx_mcs_mask[i][j])
  2518                                  sdata->rc_has_mcs_mask[i] = true;
  2519  
  2520                          if (~sdata->rc_rateidx_vht_mcs_mask[i][j])
                                            ^^^^^^^^^^^^^^^^^^^^^^^^^^
This only has 8 elements.

  2521                                  sdata->rc_has_vht_mcs_mask[i] = true;
  2522  
  2523                          if (sdata->rc_has_mcs_mask[i] &&
  2524                              sdata->rc_has_vht_mcs_mask[i])
  2525                                  break;

Maybe we always break out before we get to the last two iterations?

  2526                  }

regards,
dan carpenter

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

end of thread, other threads:[~2015-08-19 20:16 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-08-18 19:47 mac80211: add rate mask logic for vht rates Dan Carpenter
2015-08-19 20:16 ` Lorenzo Bianconi

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox