• Jeremy Higdon's avatar
    [PATCH] Fix DMA boundary overflow bug · 5b5e59f8
    Jeremy Higdon authored
    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 =====
    5b5e59f8
libata-core.c 82.4 KB