From patchwork Tue Aug 11 18:40:30 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Roel Kluin X-Patchwork-Id: 40722 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 n7BIaeOl003802 for ; Tue, 11 Aug 2009 18:36:40 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752067AbZHKSgh (ORCPT ); Tue, 11 Aug 2009 14:36:37 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1753065AbZHKSgh (ORCPT ); Tue, 11 Aug 2009 14:36:37 -0400 Received: from mail-ew0-f214.google.com ([209.85.219.214]:34952 "EHLO mail-ew0-f214.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751705AbZHKSgh (ORCPT ); Tue, 11 Aug 2009 14:36:37 -0400 Received: by ewy10 with SMTP id 10so4005359ewy.37 for ; Tue, 11 Aug 2009 11:36:36 -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=2vEFVf+zoGwd7ENzanonRr8D83vK1SLXGJrPP7qKiRY=; b=NHUftAEOo+lIAqXg3W4xWWG05SFkwlre6uaAILSE3YHlr0j8Og467wPqMxa/wEDLik cQP7wM2PVkaB6MyLF8uPpcTjBuhTb/1CxWJ4DCPiwcV4dW4sArHEAJPa+P4QY47oabRd xstZAVSQ3xBqkYvgnmkaszRLQmjH/fjjG/WrI= 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=CiEidLLiYdwceNJsgXmfyuiMkGpX2o6cnxwMNNO0Ehwg9WTRgq0b9tdOScMOnSkWkE e1Os7lnJbKwAqL4kDRobpSuiMLNymjt1guNH27fYaTCDwGDzIJok366M7pDCiYKf+166 exQU1kNRkeXFkzt2UpJBOtZX0yArp4rhg5HB8= Received: by 10.211.180.19 with SMTP id h19mr1327224ebp.35.1250015794840; Tue, 11 Aug 2009 11:36:34 -0700 (PDT) Received: from zoinx.mars (d133062.upc-d.chello.nl [213.46.133.62]) by mx.google.com with ESMTPS id 7sm458412eyb.20.2009.08.11.11.36.33 (version=SSLv3 cipher=RC4-MD5); Tue, 11 Aug 2009 11:36:34 -0700 (PDT) Message-ID: <4A81BB1E.6040904@gmail.com> Date: Tue, 11 Aug 2009 20:40:30 +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: "Luis R. Rodriguez" , linux-wireless@vger.kernel.org, ath9k-devel@venema.h4ckr.net, Andrew Morton Subject: [PATCH] ath9k: Prevent read buffer overflow Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org Prevent a read from valid_rate_index[] with a negative index Signed-off-by: Roel Kluin --- Maybe we should add this? -- 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/rc.c b/drivers/net/wireless/ath/ath9k/rc.c index ba06e78..a67b7f6 100644 --- a/drivers/net/wireless/ath/ath9k/rc.c +++ b/drivers/net/wireless/ath/ath9k/rc.c @@ -1458,7 +1458,7 @@ static void ath_rc_init(struct ath_softc *sc, ath_rc_priv->rate_max_phy = ath_rc_priv->valid_phy_rateidx[i][j-1]; } ASSERT(ath_rc_priv->rate_table_size <= RATE_TABLE_SIZE); - ASSERT(k <= RATE_TABLE_SIZE); + ASSERT(k <= RATE_TABLE_SIZE && k >= 4); ath_rc_priv->max_valid_rate = k; ath_rc_sort_validrates(rate_table, ath_rc_priv);