Skip to contentSkip to conversation

ath9k_hw: Fix possible OOB array indexing in gen_timer_index[] on 64-bit

PATCH New Vasanthakumar Thiagarajan 2 participants 5 messages Nov 13, 2009 – Nov 16, 2009 Qualcomm Atheros ATH9K wireless driver

lore
Share & tools
lore
#0 lore raw

PATCH 1/2 ath9k_hw: Fix possible OOB array indexing in gen_timer_index[] on 64-bit

---
 drivers/net/wireless/ath/ath9k/hw.h |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/net/wireless/ath/ath9k/hw.h +1 -1
index 6d3e314..abaa2f0 100644
@@ -432,7 +432,7 @@ struct ath9k_hw_version {
  * Using de Bruijin sequence to to look up 1's index in a 32 bit number
  * debruijn32 = 0000 0111 0111 1100 1011 0101 0011 0001
  */
-#define debruijn32 0x077CB531UL
+#define debruijn32 0x077CB531U
 
 struct ath_gen_timer_configuration {
 	u32 next_addr;
Signature · 1 line
1.5.5.1
#1 lore raw

PATCH 2/2 ath9k_hw: Fix AR_GPIO_INPUT_EN_VAL_BT_PRIORITY_BB and its shift value in 0x4054

The bit value of AR_GPIO_INPUT_EN_VAL_BT_PRIORITY_BB is wrong, it should be 0x400 and the number of bits to be right shifted is 10. Having this wrong value in 0x4054 sometimes affects bt quality on btcoex environment.

---
 drivers/net/wireless/ath/ath9k/reg.h |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
drivers/net/wireless/ath/ath9k/reg.h +2 -2
index 061e12c..49ec25f 100644
@@ -971,10 +971,10 @@ enum {
 #define AR_GPIO_INPUT_EN_VAL_BT_ACTIVE_S         4
 #define AR_GPIO_INPUT_EN_VAL_RFSILENT_DEF        0x00000080
 #define AR_GPIO_INPUT_EN_VAL_RFSILENT_DEF_S      7
+#define AR_GPIO_INPUT_EN_VAL_BT_PRIORITY_BB      0x00000400
+#define AR_GPIO_INPUT_EN_VAL_BT_PRIORITY_BB_S    10
 #define AR_GPIO_INPUT_EN_VAL_BT_ACTIVE_BB        0x00001000
 #define AR_GPIO_INPUT_EN_VAL_BT_ACTIVE_BB_S      12
-#define AR_GPIO_INPUT_EN_VAL_BT_PRIORITY_BB      0x00001000
-#define AR_GPIO_INPUT_EN_VAL_BT_PRIORITY_BB_S    1
 #define AR_GPIO_INPUT_EN_VAL_RFSILENT_BB         0x00008000
 #define AR_GPIO_INPUT_EN_VAL_RFSILENT_BB_S       15
 #define AR_GPIO_RTC_RESET_OVERRIDE_ENABLE        0x00010000
Signature · 1 line
1.5.5.1
#2 lore raw

PATCH 2/2 ath9k_hw: Fix AR_GPIO_INPUT_EN_VAL_BT_PRIORITY_BB and its shift value in 0x4054

Quoted 5 lines · Vasanth Thiagarajan

The bit value of AR_GPIO_INPUT_EN_VAL_BT_PRIORITY_BB is wrong, it should be 0x400 and the number of bits to be right shifted is 10. Having this wrong value in 0x4054 sometimes affects bt quality on btcoex environment.

These both seem small enough and reasonable for stable fixes no? Although I didn't get the impact of the first one..

Luis

#3 lore raw

PATCH 2/2 ath9k_hw: Fix AR_GPIO_INPUT_EN_VAL_BT_PRIORITY_BB and its shift value in 0x4054

Quoted 8 lines · Luis Rodriguez
Quoted 5 lines · Vasanth Thiagarajan

The bit value of AR_GPIO_INPUT_EN_VAL_BT_PRIORITY_BB is wrong, it should be 0x400 and the number of bits to be right shifted is 10. Having this wrong value in 0x4054 sometimes affects bt quality on btcoex environment.

These both seem small enough and reasonable for stable fixes no?

yeah, I'll resend them CC'ing stable.

Quoted 1 line

Although I didn't get the impact of the first one..

debruijn32 (0x077CB531UL) is used to find the index of the geric timer which generated the interrupt. On a 64-bit environment, 0x077CB531UL will result in indexing more than 32 in gen_timer_index[] which has memory allocated only for 32 u32.

Vasanth

#4 lore raw

PATCH 2/2 ath9k_hw: Fix AR_GPIO_INPUT_EN_VAL_BT_PRIORITY_BB and its shift value in 0x4054

Quoted 10 lines · Vasanth Thiagarajan
Quoted 8 lines · Luis Rodriguez
Quoted 5 lines · Vasanth Thiagarajan

The bit value of AR_GPIO_INPUT_EN_VAL_BT_PRIORITY_BB is wrong, it should be 0x400 and the number of bits to be right shifted is 10. Having this wrong value in 0x4054 sometimes affects bt quality on btcoex environment.

These both seem small enough and reasonable for stable fixes no?

Quoted 8 lines

yeah, I'll resend them CC'ing stable.

Quoted 1 line

Although I didn't get the impact of the first one..

debruijn32 (0x077CB531UL) is used to find the index of the geric timer which generated the interrupt. On a 64-bit environment, 0x077CB531UL will result in indexing more than 32 in gen_timer_index[] which has memory allocated only for 32 u32.

Can this be added to the commit log?

Luis