From: akpm@linux-foundation.org Subject: [patch 07/15] scsi/eata: fix buffer overflow Date: Fri, 18 Sep 2009 12:58:18 -0700 Message-ID: <200909181958.n8IJwI2H004311@imap1.linux-foundation.org> Mime-Version: 1.0 Content-Type: text/plain; charset=ANSI_X3.4-1968 Content-Transfer-Encoding: 8bit Return-path: Received: from smtp1.linux-foundation.org ([140.211.169.13]:39853 "EHLO smtp1.linux-foundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1758127AbZIRUCJ (ORCPT ); Fri, 18 Sep 2009 16:02:09 -0400 Sender: linux-scsi-owner@vger.kernel.org List-Id: linux-scsi@vger.kernel.org To: James.Bottomley@HansenPartnership.com Cc: linux-scsi@vger.kernel.org, akpm@linux-foundation.org, roel.kluin@gmail.com, ballabio_dario@emc.com, mike@i-Connect.Net From: Roel Kluin Allows i == MAX_INT_PARAM, which is out of range. Signed-off-by: Roel Kluin Cc: Michael Neuffer Cc: Dario Ballabio Cc: James E.J. Bottomley Signed-off-by: Andrew Morton --- drivers/scsi/eata.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff -puN drivers/scsi/eata.c~scsi-eata-fix-buffer-overflow drivers/scsi/eata.c --- a/drivers/scsi/eata.c~scsi-eata-fix-buffer-overflow +++ a/drivers/scsi/eata.c @@ -1509,7 +1509,7 @@ static int option_setup(char *str) char *cur = str; int i = 1; - while (cur && isdigit(*cur) && i <= MAX_INT_PARAM) { + while (cur && isdigit(*cur) && i < MAX_INT_PARAM) { ints[i++] = simple_strtoul(cur, NULL, 0); if ((cur = strchr(cur, ',')) != NULL) _