* [PATCH 2/2] ath9k: index out of bounds
@ 2011-04-10 19:09 ` roel
0 siblings, 0 replies; 6+ messages in thread
From: roel @ 2011-04-10 19:09 UTC (permalink / raw)
To: Luis R. Rodriguez, Jouni Malinen, Vasanthakumar Thiagarajan,
Senthil Balasubramanian, linux-wireless, ath9k-devel,
Andrew Morton, LKML
Check whether index is within bounds before testing the element
Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
---
drivers/net/wireless/ath/ath9k/rc.c | 3 +--
1 files changed, 1 insertions(+), 2 deletions(-)
diff --git a/drivers/net/wireless/ath/ath9k/rc.c b/drivers/net/wireless/ath/ath9k/rc.c
index 4c0d36a..1809409 100644
--- a/drivers/net/wireless/ath/ath9k/rc.c
+++ b/drivers/net/wireless/ath/ath9k/rc.c
@@ -1092,8 +1092,7 @@ static int ath_rc_get_rateindex(const struct ath_rate_table *rate_table,
if (!(rate->flags & IEEE80211_TX_RC_MCS))
return rate->idx;
- while (rate->idx > mcs_rix_off[i] &&
- i < ARRAY_SIZE(mcs_rix_off)) {
+ while (i < ARRAY_SIZE(mcs_rix_off) && rate->idx > mcs_rix_off[i]) {
rix++; i++;
}
^ permalink raw reply related [flat|nested] 6+ messages in thread* [PATCH 2/2] ath9k: index out of bounds
@ 2011-04-10 19:09 ` roel
0 siblings, 0 replies; 6+ messages in thread
From: roel @ 2011-04-10 19:09 UTC (permalink / raw)
To: Luis R. Rodriguez, Jouni Malinen, Vasanthakumar Thiagarajan,
Senthil Balasubramanian, linux-wireless, ath9k-devel,
Andrew Morton, LKML
Check whether index is within bounds before testing the element
Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
---
drivers/net/wireless/ath/ath9k/rc.c | 3 +--
1 files changed, 1 insertions(+), 2 deletions(-)
diff --git a/drivers/net/wireless/ath/ath9k/rc.c b/drivers/net/wireless/ath/ath9k/rc.c
index 4c0d36a..1809409 100644
--- a/drivers/net/wireless/ath/ath9k/rc.c
+++ b/drivers/net/wireless/ath/ath9k/rc.c
@@ -1092,8 +1092,7 @@ static int ath_rc_get_rateindex(const struct ath_rate_table *rate_table,
if (!(rate->flags & IEEE80211_TX_RC_MCS))
return rate->idx;
- while (rate->idx > mcs_rix_off[i] &&
- i < ARRAY_SIZE(mcs_rix_off)) {
+ while (i < ARRAY_SIZE(mcs_rix_off) && rate->idx > mcs_rix_off[i]) {
rix++; i++;
}
^ permalink raw reply related [flat|nested] 6+ messages in thread* [ath9k-devel] [PATCH 2/2] ath9k: index out of bounds
2011-04-10 19:09 ` roel
(?)
@ 2011-04-11 5:30 ` Mohammed Shafi
-1 siblings, 0 replies; 6+ messages in thread
From: Mohammed Shafi @ 2011-04-11 5:30 UTC (permalink / raw)
To: ath9k-devel
On Mon, Apr 11, 2011 at 12:39 AM, roel <roel.kluin@gmail.com> wrote:
> Check whether index is within bounds before testing the element
>
> Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
> ---
> ?drivers/net/wireless/ath/ath9k/rc.c | ? ?3 +--
> ?1 files changed, 1 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/net/wireless/ath/ath9k/rc.c b/drivers/net/wireless/ath/ath9k/rc.c
> index 4c0d36a..1809409 100644
> --- a/drivers/net/wireless/ath/ath9k/rc.c
> +++ b/drivers/net/wireless/ath/ath9k/rc.c
> @@ -1092,8 +1092,7 @@ static int ath_rc_get_rateindex(const struct ath_rate_table *rate_table,
> ? ? ? ?if (!(rate->flags & IEEE80211_TX_RC_MCS))
> ? ? ? ? ? ? ? ?return rate->idx;
>
> - ? ? ? while (rate->idx > mcs_rix_off[i] &&
> - ? ? ? ? ? ? ?i < ARRAY_SIZE(mcs_rix_off)) {
> + ? ? ? while (i < ARRAY_SIZE(mcs_rix_off) && rate->idx > mcs_rix_off[i]) {
> ? ? ? ? ? ? ? ?rix++; i++;
> ? ? ? ?}
>
hi,
This looks correct. with the current ath9k rate control, the MCS
index never exceeded 23 and thats why the out of bounds problem never
came.
thanks,
shafi
> _______________________________________________
> ath9k-devel mailing list
> ath9k-devel at lists.ath9k.org
> https://lists.ath9k.org/mailman/listinfo/ath9k-devel
>
^ permalink raw reply [flat|nested] 6+ messages in thread* Re: [ath9k-devel] [PATCH 2/2] ath9k: index out of bounds
@ 2011-04-11 5:30 ` Mohammed Shafi
0 siblings, 0 replies; 6+ messages in thread
From: Mohammed Shafi @ 2011-04-11 5:30 UTC (permalink / raw)
To: roel
Cc: Luis R. Rodriguez, Jouni Malinen, Vasanthakumar Thiagarajan,
Senthil Balasubramanian, linux-wireless, ath9k-devel,
Andrew Morton, LKML
On Mon, Apr 11, 2011 at 12:39 AM, roel <roel.kluin@gmail.com> wrote:
> Check whether index is within bounds before testing the element
>
> Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
> ---
> drivers/net/wireless/ath/ath9k/rc.c | 3 +--
> 1 files changed, 1 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/net/wireless/ath/ath9k/rc.c b/drivers/net/wireless/ath/ath9k/rc.c
> index 4c0d36a..1809409 100644
> --- a/drivers/net/wireless/ath/ath9k/rc.c
> +++ b/drivers/net/wireless/ath/ath9k/rc.c
> @@ -1092,8 +1092,7 @@ static int ath_rc_get_rateindex(const struct ath_rate_table *rate_table,
> if (!(rate->flags & IEEE80211_TX_RC_MCS))
> return rate->idx;
>
> - while (rate->idx > mcs_rix_off[i] &&
> - i < ARRAY_SIZE(mcs_rix_off)) {
> + while (i < ARRAY_SIZE(mcs_rix_off) && rate->idx > mcs_rix_off[i]) {
> rix++; i++;
> }
>
hi,
This looks correct. with the current ath9k rate control, the MCS
index never exceeded 23 and thats why the out of bounds problem never
came.
thanks,
shafi
> _______________________________________________
> ath9k-devel mailing list
> ath9k-devel@lists.ath9k.org
> https://lists.ath9k.org/mailman/listinfo/ath9k-devel
>
^ permalink raw reply [flat|nested] 6+ messages in thread* Re: [ath9k-devel] [PATCH 2/2] ath9k: index out of bounds
@ 2011-04-11 5:30 ` Mohammed Shafi
0 siblings, 0 replies; 6+ messages in thread
From: Mohammed Shafi @ 2011-04-11 5:30 UTC (permalink / raw)
To: roel
Cc: Luis R. Rodriguez, Jouni Malinen, Vasanthakumar Thiagarajan,
Senthil Balasubramanian, linux-wireless, ath9k-devel,
Andrew Morton, LKML
On Mon, Apr 11, 2011 at 12:39 AM, roel <roel.kluin@gmail.com> wrote:
> Check whether index is within bounds before testing the element
>
> Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
> ---
> drivers/net/wireless/ath/ath9k/rc.c | 3 +--
> 1 files changed, 1 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/net/wireless/ath/ath9k/rc.c b/drivers/net/wireless/ath/ath9k/rc.c
> index 4c0d36a..1809409 100644
> --- a/drivers/net/wireless/ath/ath9k/rc.c
> +++ b/drivers/net/wireless/ath/ath9k/rc.c
> @@ -1092,8 +1092,7 @@ static int ath_rc_get_rateindex(const struct ath_rate_table *rate_table,
> if (!(rate->flags & IEEE80211_TX_RC_MCS))
> return rate->idx;
>
> - while (rate->idx > mcs_rix_off[i] &&
> - i < ARRAY_SIZE(mcs_rix_off)) {
> + while (i < ARRAY_SIZE(mcs_rix_off) && rate->idx > mcs_rix_off[i]) {
> rix++; i++;
> }
>
hi,
This looks correct. with the current ath9k rate control, the MCS
index never exceeded 23 and thats why the out of bounds problem never
came.
thanks,
shafi
> _______________________________________________
> ath9k-devel mailing list
> ath9k-devel@lists.ath9k.org
> https://lists.ath9k.org/mailman/listinfo/ath9k-devel
>
^ permalink raw reply [flat|nested] 6+ messages in thread