From: Mark Haverkamp Date: Thu, 1 Sep 2005 15:19:23 +0000 (-0700) Subject: [PATCH] aacraid: 2.6.13 aacraid bad BUG_ON fix X-Git-Tag: v2.6.13.1~9 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=7a8ad840d817bda420f89963d9650a6f053eeea1;p=karo-tx-linux.git [PATCH] aacraid: 2.6.13 aacraid bad BUG_ON fix This was noticed by Doug Bazamic and the fix found by Mark Salyzyn at Adaptec. There was an error in the BUG_ON() statement that validated the calculated fib size which can cause the driver to panic. Signed-off-by: Mark Haverkamp Acked-by: James Bottomley Signed-off-by: Chris Wright Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/scsi/aacraid/aachba.c b/drivers/scsi/aacraid/aachba.c index ccdf440021fb..60ca3b23e4b1 100644 --- a/drivers/scsi/aacraid/aachba.c +++ b/drivers/scsi/aacraid/aachba.c @@ -968,7 +968,7 @@ static int aac_read(struct scsi_cmnd * scsicmd, int cid) fibsize = sizeof(struct aac_read64) + ((le32_to_cpu(readcmd->sg.count) - 1) * sizeof (struct sgentry64)); - BUG_ON (fibsize > (sizeof(struct hw_fib) - + BUG_ON (fibsize > (dev->max_fib_size - sizeof(struct aac_fibhdr))); /* * Now send the Fib to the adapter