]> git.hungrycats.org Git - linux/commit
[PATCH] Fix DMA boundary overflow bug
authorJeremy Higdon <jeremy@sgi.com>
Sat, 28 Aug 2004 15:02:49 +0000 (11:02 -0400)
committerBartlomiej Zolnierkiewicz <bzolnier@elka.pw.edu.pl>
Sat, 28 Aug 2004 15:02:49 +0000 (11:02 -0400)
commit5b5e59f8d576dc2d3d54289448558db3172ceec9
treeb82463e987b48f450b9bbd9d61f2e0371af0bc7f
parent2ac5f852bd0634c585a6cf55c78bc457f451dcdf
[PATCH] Fix DMA boundary overflow bug

We seem to have found an overflow problem in libata-core.c.
We were trying to DMA to the address range 0xffff8000-0xffffbfff.

In the original version of the code, given that address and
count (0xffff8000 and 0x4000), the variable "boundary" would be
set to 0, causing len to be set to 0x8000 (which is greater than
sg_len).  Then at the bottom of the loop, sg_len would be set
to 0xffffc000 (0x4000 - 0x8000), which would then cause the
loop never to terminate (until much of memory was scribbled
over or the kernel died).

The code below should be functionally identical, but not be
subject to the same overflow problem (boundary needs to be a
u33).

Signed-off-by: jeremy@sgi.com
===== drivers/scsi/libata-core.c 1.94 vs edited =====
drivers/scsi/libata-core.c