浏览代码

BUG_ON on kernel misbehavior on A100U2W driver

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>
Acked-by: James Bottomley <James.Bottomley@HansenPartnership.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Mikulas Patocka 17 年之前
父节点
当前提交
a5db33411a
共有 1 个文件被更改,包括 1 次插入0 次删除
  1. 1 0
      drivers/scsi/a100u2w.c

+ 1 - 0
drivers/scsi/a100u2w.c

@@ -866,6 +866,7 @@ static void inia100_build_scb(struct orc_host * host, struct orc_scb * scb, stru
 
 	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) {