lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [day] [month] [year] [list]
Message-id: <9112929121291221repost@karneval.cz>
Date:	Fri, 22 Sep 2006 10:47:19 +0200 (CEST)
From:	Jiri Slaby <jirislaby@...il.com>
To:	Andrew Morton <akpm@...l.org>
Cc:	<linux-kernel@...r.kernel.org>
Subject: [PATCH -repost] isicom: correct firmware loading

isicom: correct firmware loading

Loading of firmware didn't fail when something went wrong (returned 0). Pointer
to frame was incremented only by sizeof(frame) excluding it's data contents --
bad idea. Tell the card we're ready just after checking is complete, not before.

Signed-off-by: Jiri Slaby <jirislaby@...il.com>

---
commit 7fa7a3e6bcd181bb25adacfc71dc8a386e347e9d
tree 00758e71b46c5de09d98c79cf00f187012b9ba35
parent ca8b00296c6ff25faf9db7fe4b11d1460b64c7d7
author Jiri Slaby <jirislaby@...il.com> Mon, 18 Sep 2006 22:57:06 +0200
committer Jiri Slaby <jirislaby@...il.com> Mon, 18 Sep 2006 22:57:06 +0200

 drivers/char/isicom.c |   35 +++++++++++++++++++----------------
 1 files changed, 19 insertions(+), 16 deletions(-)

diff --git a/drivers/char/isicom.c b/drivers/char/isicom.c
index 6cca4b2..ea2bbf8 100644
--- a/drivers/char/isicom.c
+++ b/drivers/char/isicom.c
@@ -1756,9 +1756,12 @@ static int __devinit load_firmware(struc
 	if (retval)
 		goto end;
 
+	retval = -EIO;
+
 	for (frame = (struct stframe *)fw->data;
 			frame < (struct stframe *)(fw->data + fw->size);
-			frame++) {
+			frame = (struct stframe *)((u8 *)(frame + 1) +
+				frame->count)) {
 		if (WaitTillCardIsFree(base))
 			goto errrelfw;
 
@@ -1797,23 +1800,12 @@ static int __devinit load_firmware(struc
 		}
  	}
 
-	retval = -EIO;
-
-	if (WaitTillCardIsFree(base))
-		goto errrelfw;
-
-	outw(0xf2, base);
-	outw(0x800, base);
-	outw(0x0, base);
-	outw(0x0, base);
-	InterruptTheCard(base);
-	outw(0x0, base + 0x4); /* for ISI4608 cards */
-
 /* XXX: should we test it by reading it back and comparing with original like
  * in load firmware package? */
-	for (frame = (struct stframe*)fw->data;
-			frame < (struct stframe*)(fw->data + fw->size);
-			frame++) {
+	for (frame = (struct stframe *)fw->data;
+			frame < (struct stframe *)(fw->data + fw->size);
+			frame = (struct stframe *)((u8 *)(frame + 1) +
+				frame->count)) {
 		if (WaitTillCardIsFree(base))
 			goto errrelfw;
 
@@ -1863,6 +1855,17 @@ static int __devinit load_firmware(struc
 		}
 	}
 
+	/* xfer ctrl */
+	if (WaitTillCardIsFree(base))
+		goto errrelfw;
+
+	outw(0xf2, base);
+	outw(0x800, base);
+	outw(0x0, base);
+	outw(0x0, base);
+	InterruptTheCard(base);
+	outw(0x0, base + 0x4); /* for ISI4608 cards */
+
 	board->status |= FIRMWARE_LOADED;
 	retval = 0;
 
-
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

Powered by Openwall GNU/*/Linux Powered by OpenVZ