All of lore.kernel.org
 help / color / mirror / Atom feed
From: Dan Carpenter <error27@gmail.com>
To: ath9k-devel@lists.ath9k.org
Subject: [ath9k-devel] [patch 2/9] ath9k: range checking issues in htc_hst.c
Date: Mon, 10 May 2010 12:23:19 +0200	[thread overview]
Message-ID: <20100510102319.GV27064@bicker> (raw)
In-Reply-To: <19431.36216.198492.247202@gargle.gargle.HOWL>


On Mon, May 10, 2010 at 10:07:12AM +0530, Sujith wrote:
> Dan Carpenter wrote:
> > The original code had ENDPOINT_MAX and HST_ENDPOINT_MAX switched.
> 
> Hm, no.
> 

I'm afraid I don't understand.  ENDPOINT_MAX is 22 and HST_ENDPOINT_MAX
is 8.  The htc_target struct is defined as having 8 endpoints.

drivers/net/wireless/ath/ath9k/htc_hst.h
   137  struct htc_target {
   138          void *hif_dev;
   139          struct ath9k_htc_priv *drv_priv;
   140          struct device *dev;
   141          struct ath9k_htc_hif *hif;
   142          struct htc_endpoint endpoint[HST_ENDPOINT_MAX];
                                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^

So in the original code:
drivers/net/wireless/ath/ath9k/htc_hst.c
   119                  for (tepid = ENDPOINT_MAX; tepid > ENDPOINT0; tepid--) {
   120                          tmp_endpoint = &target->endpoint[tepid];
                                               ^^^^^^^^^^^^^^^^^^^^^^^^^

	We are past the end of the array here.  22 vs 7.

Perhaps the htc_target struct should be changed to ENDPOINT_MAX?

regards,
dan carpenter

WARNING: multiple messages have this Message-ID (diff)
From: Dan Carpenter <error27@gmail.com>
To: Sujith <Sujith.Manoharan@atheros.com>
Cc: Luis Rodriguez <Luis.Rodriguez@Atheros.com>,
	Jouni Malinen <Jouni.Malinen@Atheros.com>,
	Vasanth Thiagarajan <Vasanth.Thiagarajan@Atheros.com>,
	Senthilkumar Balasubramanian
	<Senthilkumar.Balasubramanian@Atheros.com>,
	"John W. Linville" <linville@tuxdriver.com>,
	Ming Lei <tom.leiming@gmail.com>,
	"linux-wireless@vger.kernel.org" <linux-wireless@vger.kernel.org>,
	"ath9k-devel@lists.ath9k.org" <ath9k-devel@lists.ath9k.org>
Subject: Re: [patch 2/9] ath9k: range checking issues in htc_hst.c
Date: Mon, 10 May 2010 12:23:19 +0200	[thread overview]
Message-ID: <20100510102319.GV27064@bicker> (raw)
In-Reply-To: <19431.36216.198492.247202@gargle.gargle.HOWL>


On Mon, May 10, 2010 at 10:07:12AM +0530, Sujith wrote:
> Dan Carpenter wrote:
> > The original code had ENDPOINT_MAX and HST_ENDPOINT_MAX switched.
> 
> Hm, no.
> 

I'm afraid I don't understand.  ENDPOINT_MAX is 22 and HST_ENDPOINT_MAX
is 8.  The htc_target struct is defined as having 8 endpoints.

drivers/net/wireless/ath/ath9k/htc_hst.h
   137  struct htc_target {
   138          void *hif_dev;
   139          struct ath9k_htc_priv *drv_priv;
   140          struct device *dev;
   141          struct ath9k_htc_hif *hif;
   142          struct htc_endpoint endpoint[HST_ENDPOINT_MAX];
                                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^

So in the original code:
drivers/net/wireless/ath/ath9k/htc_hst.c
   119                  for (tepid = ENDPOINT_MAX; tepid > ENDPOINT0; tepid--) {
   120                          tmp_endpoint = &target->endpoint[tepid];
                                               ^^^^^^^^^^^^^^^^^^^^^^^^^

	We are past the end of the array here.  22 vs 7.

Perhaps the htc_target struct should be changed to ENDPOINT_MAX?

regards,
dan carpenter

  reply	other threads:[~2010-05-10 10:23 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-05-08 16:22 [ath9k-devel] [patch 2/9] ath9k: range checking issues in htc_hst.c Dan Carpenter
2010-05-08 16:22 ` Dan Carpenter
2010-05-10  4:37 ` [ath9k-devel] " Sujith
2010-05-10  4:37   ` Sujith
2010-05-10 10:23   ` Dan Carpenter [this message]
2010-05-10 10:23     ` Dan Carpenter
2010-05-10 10:50     ` [ath9k-devel] " Sujith
2010-05-10 10:50       ` Sujith
2010-05-10 12:17       ` [ath9k-devel] " Pavel Roskin
2010-05-10 12:17         ` Pavel Roskin
2010-05-11  5:50 ` Sujith.Manoharan at atheros.com
2010-05-11  5:50   ` Sujith.Manoharan
2010-05-11  9:29   ` [ath9k-devel] " Dan Carpenter
2010-05-11  9:29     ` Dan Carpenter

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=20100510102319.GV27064@bicker \
    --to=error27@gmail.com \
    --cc=ath9k-devel@lists.ath9k.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.