public inbox for linux-mmc@vger.kernel.org
 help / color / mirror / Atom feed
* [patch 077/232] sdio: fix read buffer overflow
@ 2009-09-22 23:45 akpm
  2009-10-01 10:08 ` Jonathan Cameron
  0 siblings, 1 reply; 6+ messages in thread
From: akpm @ 2009-09-22 23:45 UTC (permalink / raw)
  To: torvalds; +Cc: akpm, roel.kluin, david.vrabel, linux-mmc

From: Roel Kluin <roel.kluin@gmail.com>

Avoid buffer underrun when parsing an invalid CISTPL_VERS_1.

Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
Cc: David Vrabel <david.vrabel@csr.com>
Cc: <linux-mmc@vger.kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---

 drivers/mmc/core/sdio_cis.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff -puN drivers/mmc/core/sdio_cis.c~sdio-fix-read-buffer-overflow drivers/mmc/core/sdio_cis.c
--- a/drivers/mmc/core/sdio_cis.c~sdio-fix-read-buffer-overflow
+++ a/drivers/mmc/core/sdio_cis.c
@@ -40,7 +40,7 @@ static int cistpl_vers_1(struct mmc_card
 			nr_strings++;
 	}
 
-	if (buf[i-1] != '\0') {
+	if (nr_strings < 4) {
 		printk(KERN_WARNING "SDIO: ignoring broken CISTPL_VERS_1\n");
 		return 0;
 	}
_

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2009-10-06 21:55 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-09-22 23:45 [patch 077/232] sdio: fix read buffer overflow akpm
2009-10-01 10:08 ` Jonathan Cameron
2009-10-01 11:12   ` David Vrabel
2009-10-01 11:16     ` David Vrabel
2009-10-01 14:11       ` Jonathan Cameron
2009-10-06 21:49         ` Bing Zhao

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox