linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Malcolm Priestley <tvboxspy@gmail.com>
To: gregkh@linuxfoundation.org
Cc: linux-wireless@vger.kernel.org,
	Malcolm Priestley <tvboxspy@gmail.com>,
	Dan Carpenter <dan.carpenter@oracle.com>
Subject: [PATCH 5/6] staging: vt6655: Fix RFbSetPower() error: buffer overflow 'priv->abyCCKPwrTbl' 15 <= 56
Date: Thu,  4 Dec 2014 22:12:46 +0000	[thread overview]
Message-ID: <1417731167-3231-5-git-send-email-tvboxspy@gmail.com> (raw)
In-Reply-To: <1417731167-3231-1-git-send-email-tvboxspy@gmail.com>

Check uCH is not more than CB_MAX_CHANNEL_24G(14) on rates RATE_1M to RATE_11M

Return false as the call is invalid as these rates do not exist
above channel 14.

Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Cc: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com>
---
 drivers/staging/vt6655/rf.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/staging/vt6655/rf.c b/drivers/staging/vt6655/rf.c
index 27841aa..a6eabde 100644
--- a/drivers/staging/vt6655/rf.c
+++ b/drivers/staging/vt6655/rf.c
@@ -788,6 +788,9 @@ bool RFbSetPower(
 	case RATE_2M:
 	case RATE_5M:
 	case RATE_11M:
+		if (uCH > CB_MAX_CHANNEL_24G)
+			return false;
+
 		byPwr = priv->abyCCKPwrTbl[uCH];
 		byPwrdBm = priv->abyCCKDefaultPwr[uCH];
 		break;
-- 
2.1.0


  parent reply	other threads:[~2014-12-04 22:14 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-12-04 22:12 [PATCH 1/6] staging: vt6655: set_channel replace parameter with ieee80211_channel Malcolm Priestley
2014-12-04 22:12 ` [PATCH 2/6] staging: vt6655: common variable size channel numbers to ieee80211_channel->hw_value Malcolm Priestley
2014-12-04 22:12 ` [PATCH 3/6] staging: vt6655: remove antenna diversity functions Malcolm Priestley
2014-12-04 22:12 ` [PATCH 4/6] staging: vt6655: device_init_registers alway set initial antenna mode Malcolm Priestley
2014-12-04 22:12 ` Malcolm Priestley [this message]
2014-12-04 22:12 ` [PATCH 6/6] staging: vt6655: RFbSetPower remove unused variable byPwrdBm Malcolm Priestley
2014-12-17 23:16 ` [PATCH 1/6] staging: vt6655: set_channel replace parameter with ieee80211_channel Malcolm Priestley
2015-01-13  3:32   ` Greg KH
  -- strict thread matches above, loose matches on Subject: below --
2015-01-19 18:24 Malcolm Priestley
2015-01-19 18:24 ` [PATCH 5/6] staging: vt6655: Fix RFbSetPower() error: buffer overflow 'priv->abyCCKPwrTbl' 15 <= 56 Malcolm Priestley

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=1417731167-3231-5-git-send-email-tvboxspy@gmail.com \
    --to=tvboxspy@gmail.com \
    --cc=dan.carpenter@oracle.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-wireless@vger.kernel.org \
    /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;
as well as URLs for NNTP newsgroup(s).