[PATCH 3/4] BUG_ON on kernel misbehavior on A100U2W driver

!MAILaRCHIVE_VOTE_RePLACE
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: <torvalds@...>
Cc: <linux-scsi@...>, <linux-kernel@...>
Date: Tuesday, July 15, 2008 - 5:18 pm

With broken Sparc64 IOMMU accounting, the kernel submits larger requests then
allowed. Better to crash on BUG than corrupt memory.

Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
---
 drivers/scsi/a100u2w.c |    1 +
 1 file changed, 1 insertion(+)

Index: linux-2.6.26-devel/drivers/scsi/a100u2w.c
===================================================================
--- linux-2.6.26-devel.orig/drivers/scsi/a100u2w.c	2008-07-14 20:03:43.000000000 +0200
+++ linux-2.6.26-devel/drivers/scsi/a100u2w.c	2008-07-15 00:46:02.000000000 +0200
@@ -866,6 +866,7 @@ static void inia100_build_scb(struct orc
 
 	count_sg = scsi_dma_map(cmd);
 	BUG_ON(count_sg < 0);
+	BUG_ON(count_sg > TOTAL_SG_ENTRY);
 
 	/* Build the scatter gather lists */
 	if (count_sg) {
--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[PATCH 1/4] Fix endianity in A100U2W SCSI driver, Mikulas Patocka, (Tue Jul 15, 10:11 am)
Re: [PATCH 1/4] Fix endianity in A100U2W SCSI driver, Linus Torvalds, (Tue Jul 15, 1:23 pm)
[PATCH 1/4] Fix endianity in A100U2W SCSI driver, Mikulas Patocka, (Tue Jul 15, 5:15 pm)
[PATCH 2/4] Add udelay to A100U2W SCSI driver, Mikulas Patocka, (Tue Jul 15, 10:12 am)
[PATCH 2/4] Add udelay to A100U2W SCSI driver, Mikulas Patocka, (Tue Jul 15, 5:16 pm)
[PATCH 3/4] BUG_ON on kernel misbehavior on A100U2W driver, Mikulas Patocka, (Tue Jul 15, 10:14 am)
[PATCH 3/4] BUG_ON on kernel misbehavior on A100U2W driver, Mikulas Patocka, (Tue Jul 15, 5:18 pm)
[PATCH 4/4] Don't crash on IOMMU overflow in A100U2W driver, Mikulas Patocka, (Tue Jul 15, 10:15 am)
[PATCH 4/4] Don't crash on IOMMU overflow in A100U2W driver, Mikulas Patocka, (Tue Jul 15, 5:19 pm)