[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-Id: <20071015.013647.95041541.davem@davemloft.net>
Date: Mon, 15 Oct 2007 01:36:47 -0700 (PDT)
From: David Miller <davem@...emloft.net>
To: bunk@...nel.org
Cc: davem@...set.davemloft.net, jgarzik@...ox.com,
netdev@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: drivers/net/niu.c: possible array overflows
From: Adrian Bunk <bunk@...nel.org>
Date: Sun, 14 Oct 2007 19:50:24 +0200
> The Coverity checker spotted the following in drivers/net/niu.c:
Thanks for the report Adrian, I'll fix it like this:
commit 503211a947ab13fb44d920f78f1e19057efc277f
Author: David S. Miller <davem@...set.davemloft.net>
Date: Mon Oct 15 01:36:24 2007 -0700
[NIU]: Fix write past end of array in niu_pci_probe_sprom().
Noticed by Coverity checker and reported by Adrian Bunk.
Signed-off-by: David S. Miller <davem@...emloft.net>
diff --git a/drivers/net/niu.c b/drivers/net/niu.c
index 43bfe7e..54166bd 100644
--- a/drivers/net/niu.c
+++ b/drivers/net/niu.c
@@ -6213,7 +6213,7 @@ static int __devinit niu_pci_probe_sprom(struct niu *np)
val = nr64(ESPC_MOD_STR_LEN);
niudbg(PROBE, "SPROM: MOD_STR_LEN[%llu]\n",
(unsigned long long) val);
- if (val > 8 * 4)
+ if (val >= 8 * 4)
return -EINVAL;
for (i = 0; i < val; i += 4) {
@@ -6229,7 +6229,7 @@ static int __devinit niu_pci_probe_sprom(struct niu *np)
val = nr64(ESPC_BD_MOD_STR_LEN);
niudbg(PROBE, "SPROM: BD_MOD_STR_LEN[%llu]\n",
(unsigned long long) val);
- if (val > 4 * 4)
+ if (val >= 4 * 4)
return -EINVAL;
for (i = 0; i < val; i += 4) {
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists