From patchwork Sat Jul 25 22:40:59 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: roel kluin X-Patchwork-Id: 30233 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming@bilbo.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from ozlabs.org (ozlabs.org [203.10.76.45]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "mx.ozlabs.org", Issuer "CA Cert Signing Authority" (verified OK)) by bilbo.ozlabs.org (Postfix) with ESMTPS id 545ECB708B for ; Sun, 26 Jul 2009 08:38:34 +1000 (EST) Received: by ozlabs.org (Postfix) id 43411DDD1B; Sun, 26 Jul 2009 08:38:34 +1000 (EST) Delivered-To: patchwork-incoming@ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by ozlabs.org (Postfix) with ESMTP id D2930DDD0C for ; Sun, 26 Jul 2009 08:38:33 +1000 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752531AbZGYWiZ (ORCPT ); Sat, 25 Jul 2009 18:38:25 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1752348AbZGYWiZ (ORCPT ); Sat, 25 Jul 2009 18:38:25 -0400 Received: from ey-out-2122.google.com ([74.125.78.24]:65026 "EHLO ey-out-2122.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752110AbZGYWiY (ORCPT ); Sat, 25 Jul 2009 18:38:24 -0400 Received: by ey-out-2122.google.com with SMTP id 9so641950eyd.37 for ; Sat, 25 Jul 2009 15:38:23 -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=LGpoxy54xxVuIr6JqZRcQL7iYBwLGWbGz9I/FKWnFYo=; b=T34Ls9wKo/pkxcz4mm6jn8PhEKY9yTb2jpKtYHodkZgTa8WlKp6GIot34lzx1oXVCe PtrTBGl+yZl1bTcjUFtv1MTXOZRet7lEiFIkSxezegizrHjJCujECjMBVfA0wEuSJJ0g +tRwUIbPpAVOsHwBbfnI60Yjj5ybW00AiB98k= 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=m9p1AjLiJKPBxzMTdBpp9Q/SLqrbUAN41HwBVwQIbvoj197iPdDVjkF8SBlHPW70OJ AjYe4CQRpwk5PGD+Ne/AzWWW9HZMxRlxBnkCmeY6nm7i9q0dP/L7bbNsiWUO85KXxWyw b0kaz6q2LoBGxjCMPYvZIYt8twWl1sq0tee/w= Received: by 10.211.199.11 with SMTP id b11mr6208089ebq.68.1248561503659; Sat, 25 Jul 2009 15:38:23 -0700 (PDT) Received: from zoinx.mars (d133062.upc-d.chello.nl [213.46.133.62]) by mx.google.com with ESMTPS id 10sm64610eyd.22.2009.07.25.15.38.22 (version=SSLv3 cipher=RC4-MD5); Sat, 25 Jul 2009 15:38:23 -0700 (PDT) Message-ID: <4A6B89FB.8020103@gmail.com> Date: Sun, 26 Jul 2009 00:40:59 +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: "David S. Miller" , netdev , Andrew Morton Subject: [PATCH] eepro: Read buffer overflow Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org io[i] is read before the bounds check on i, order should be reversed Signed-off-by: Roel Kluin --- break; -- To unsubscribe from this list: send the line "unsubscribe netdev" 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/eepro.c b/drivers/net/eepro.c index cc2ab64..4f70034 100644 --- a/drivers/net/eepro.c +++ b/drivers/net/eepro.c @@ -1784,7 +1784,7 @@ int __init init_module(void) printk(KERN_INFO "eepro_init_module: Auto-detecting boards (May God protect us...) "); } - for (i = 0; io[i] != -1 && i < MAX_EEPRO; i++) { + for (i = 0; i < MAX_EEPRO && io[i] != -1; i++) { dev = alloc_etherdev(sizeof(struct eepro_local)); if (!dev)