From patchwork Sat Jul 25 21:21:22 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Roel Kluin X-Patchwork-Id: 37365 Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by demeter.kernel.org (8.14.2/8.14.2) with ESMTP id n6PLIt2O029833 for ; Sat, 25 Jul 2009 21:18:55 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752753AbZGYVSu (ORCPT ); Sat, 25 Jul 2009 17:18:50 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1752856AbZGYVSu (ORCPT ); Sat, 25 Jul 2009 17:18:50 -0400 Received: from mail-ew0-f226.google.com ([209.85.219.226]:48321 "EHLO mail-ew0-f226.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752414AbZGYVSt (ORCPT ); Sat, 25 Jul 2009 17:18:49 -0400 Received: by ewy26 with SMTP id 26so2433113ewy.37 for ; Sat, 25 Jul 2009 14:18:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from :user-agent:mime-version:to:subject:content-type :content-transfer-encoding; bh=j7+0hL2hjL3GGl9Ca3fXhEsIeM/PHQpnAgcAX6WEFek=; b=t17z+Nj7rqnwl8IchtvgnCXaaHwPkk7e3uKH4JsOVwvwIXbo7/FhAFoqV4m12ju0TH BLh1HSEjxiL0QtYjlfZ7dhY99wXTQcIpBRmUuoF5CjgAm6GPmi8+gnIVawixWigTaa4U pP2vm4/76RWRuZ7sMsn/mMqW6Z3TTjsixRplA= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:user-agent:mime-version:to:subject :content-type:content-transfer-encoding; b=P5PzZJGt7knIOTCuo0iAWvZWLGkxvg9A/EQf26gIPcEINaKVeoqO1lAtJGBqlAnFmV IyA7myLc99cVT41tRwa/YP+ZjGx4cN0gGyVDqmMewO0PhlbT2p4GlU0E+1JkYETpWnKn t/gwF6VyHqbnjb7yr1xaCvePtpQnX+1bIV+iQ= Received: by 10.210.102.12 with SMTP id z12mr6048550ebb.89.1248556727004; Sat, 25 Jul 2009 14:18:47 -0700 (PDT) Received: from zoinx.mars (d133062.upc-d.chello.nl [213.46.133.62]) by mx.google.com with ESMTPS id 5sm2122338eyf.44.2009.07.25.14.18.46 (version=SSLv3 cipher=RC4-MD5); Sat, 25 Jul 2009 14:18:46 -0700 (PDT) Message-ID: <4A6B7752.1080405@gmail.com> Date: Sat, 25 Jul 2009 23:21:22 +0200 From: Roel Kluin User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1b3pre) Gecko/20090513 Fedora/3.0-2.3.beta2.fc11 Thunderbird/3.0b2 MIME-Version: 1.0 To: lrodriguez@atheros.com, linux-wireless@vger.kernel.org, ath9k-devel@venema.h4ckr.net, Andrew Morton Subject: [PATCH] ath9k: Read outside array bounds Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org Incorrect limits leads to reads outside array bounds. Signed-off-by: Roel Kluin Acked-by: Luis R. Rodriguez --- -- To unsubscribe from this list: send the line "unsubscribe linux-wireless" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/drivers/net/wireless/ath/ath9k/eeprom.c b/drivers/net/wireless/ath/ath9k/eeprom.c index a2fda70..ce0e86c 100644 --- a/drivers/net/wireless/ath/ath9k/eeprom.c +++ b/drivers/net/wireless/ath/ath9k/eeprom.c @@ -460,7 +460,7 @@ static int ath9k_hw_4k_check_eeprom(struct ath_hw *ah) integer = swab32(eep->modalHeader.antCtrlCommon); eep->modalHeader.antCtrlCommon = integer; - for (i = 0; i < AR5416_MAX_CHAINS; i++) { + for (i = 0; i < AR5416_EEP4K_MAX_CHAINS; i++) { integer = swab32(eep->modalHeader.antCtrlChain[i]); eep->modalHeader.antCtrlChain[i] = integer; } @@ -914,7 +914,7 @@ static void ath9k_hw_set_4k_power_per_rate_table(struct ath_hw *ah, ctlMode, numCtlModes, isHt40CtlMode, (pCtlMode[ctlMode] & EXT_ADDITIVE)); - for (i = 0; (i < AR5416_NUM_CTLS) && + for (i = 0; (i < AR5416_EEP4K_NUM_CTLS) && pEepData->ctlIndex[i]; i++) { DPRINTF(ah->ah_sc, ATH_DBG_EEPROM, " LOOP-Ctlidx %d: cfgCtl 0x%2.2x "