[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <4A7C6795.7070200@gmail.com>
Date: Fri, 07 Aug 2009 19:42:45 +0200
From: Roel Kluin <roel.kluin@...il.com>
To: David Vrabel <david.vrabel@....com>
CC: drzeus@...eus.cx, LKML <linux-kernel@...r.kernel.org>,
Andrew Morton <akpm@...ux-foundation.org>
Subject: Re: [PATCH] sdio: Read buffer overflow
sdio: avoid buffer underrun when parsing an invalid CISTPL_VERS_1
Signed-off-by: Roel Kluin <roel.kluin@...il.com>
---
Thanks for comments,
diff --git a/drivers/mmc/core/sdio_cis.c b/drivers/mmc/core/sdio_cis.c
index 963f293..6636354 100644
--- a/drivers/mmc/core/sdio_cis.c
+++ b/drivers/mmc/core/sdio_cis.c
@@ -40,7 +40,7 @@ static int cistpl_vers_1(struct mmc_card *card, struct sdio_func *func,
nr_strings++;
}
- if (buf[i-1] != '\0') {
+ if (nr_strings < 4) {
printk(KERN_WARNING "SDIO: ignoring broken CISTPL_VERS_1\n");
return 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