Skip to contentSkip to conversation

ath9k: Add concurrent WLAN and BT tx support for MCI based chips

ath9k-devel Dan Carpenter 2 participants 3 messages Nov 26, 2012 – Nov 27, 2012

lore
Share & tools
lore
#0 lore raw

Hello Rajkumar Manoharan,

The patch db60428b1af1: "ath9k: Add concurrent WLAN and BT tx support for MCI based chips" from Oct 12, 2012, leads to the following warning:
drivers/net/wireless/ath/ath9k/btcoex.c:414
ath9k_hw_btcoex_set_concur_txprio()
error: buffer overflow 'stomp_txprio' 4 <= 4

stomp_txprio has 4 elements.

	u8 stomp_txprio[] = { 0, 0, 0, 0 }; /* all, low, none, low_ftp */

drivers/net/wireless/ath/ath9k/btcoex.c
408 void ath9k_hw_btcoex_set_concur_txprio(struct ath_hw *ah, u8 *stomp_txprio) 409 {
410 struct ath_btcoex_hw *btcoex = &ah->btcoex_hw;
411 int i;
412
413 for (i = 0; i < ATH_BTCOEX_STOMP_MAX; i++)

                                ^^^^^^^^^^^^^^^^^^^^

This is 5.

   414                  btcoex->tx_prio[i] = stomp_txprio[i];
                                             ^^^^^^^^^^^^^^

We are reading one positition past the end of the array.

415 }

Possibly we need to add some code to handle ATH_BTCOEX_STOMP_AUDIO which was added recently in 2884561a "ath9k: stomp audio profiles on weak signal strength."

regards,
dan carpenter

#1 lore raw
Quoted 9 lines · Dan Carpenter

Hello Rajkumar Manoharan,

The patch db60428b1af1: "ath9k: Add concurrent WLAN and BT tx support for MCI based chips" from Oct 12, 2012, leads to the following warning:
drivers/net/wireless/ath/ath9k/btcoex.c:414
ath9k_hw_btcoex_set_concur_txprio()
error: buffer overflow 'stomp_txprio' 4 <= 4

Dan,

Thanks a lot. Is there a way to enable all checks while building smatch tool?

-Rajkumar

#2 lore raw
Quoted 10 lines · Rajkumar Manoharan
Quoted 9 lines · Dan Carpenter

Hello Rajkumar Manoharan,

The patch db60428b1af1: "ath9k: Add concurrent WLAN and BT tx support for MCI based chips" from Oct 12, 2012, leads to the following warning:
drivers/net/wireless/ath/ath9k/btcoex.c:414
ath9k_hw_btcoex_set_concur_txprio()
error: buffer overflow 'stomp_txprio' 4 <= 4

Quoted 4 lines

Dan,

Thanks a lot. Is there a way to enable all checks while building smatch tool?

This one requires the sqlite database to get the cross function info. It's a two compile process, the first builds the db and the next does the test. Replace the path names as appropriate:

~/progs/smatch/devel/smatch_scripts/build_kernel_data.sh ~/progs/smatch/devel/smatch_scripts/test_kernel.sh

regards,
dan carpenter