Linux wireless drivers development
 help / color / mirror / Atom feed
From: Dan Carpenter <dan.carpenter@oracle.com>
To: lorenzo.bianconi83@gmail.com
Cc: linux-wireless@vger.kernel.org
Subject: re: mac80211: add rate mask logic for vht rates
Date: Tue, 18 Aug 2015 22:47:20 +0300	[thread overview]
Message-ID: <20150818194720.GB2606@mwanda> (raw)

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

             reply	other threads:[~2015-08-18 19:47 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-08-18 19:47 Dan Carpenter [this message]
2015-08-19 20:16 ` mac80211: add rate mask logic for vht rates Lorenzo Bianconi

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20150818194720.GB2606@mwanda \
    --to=dan.carpenter@oracle.com \
    --cc=linux-wireless@vger.kernel.org \
    --cc=lorenzo.bianconi83@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox