]> git.baikalelectronics.ru Git - kernel.git/commit
[SCSI] libata: fix corruption induced by relaxed DMA alignment in SCSI
authorJames Bottomley <James.Bottomley@HansenPartnership.com>
Tue, 22 Jan 2008 19:43:48 +0000 (13:43 -0600)
committerJames Bottomley <James.Bottomley@HansenPartnership.com>
Wed, 23 Jan 2008 17:27:54 +0000 (11:27 -0600)
commit00f5c166320ae8850cc06c074bd24469c36e8bae
tree5aaecdc97e807dc9be911243604c9b9e0f22bde6
parent2cf9fcf74b18c57432fdef813b173736d8e84193
[SCSI] libata: fix corruption induced by relaxed DMA alignment in SCSI

Hugh Dickens noticed that SMART commands issued from user space can
end up corupting memory.  The problem occurs if the buffer used to
read data spans two pages.  The reason is that the PIO sector routines
in libata are expecting physically contiguous pages when they do
sector operations, so the left overs on the second page go into the
next physically adjacent page rather than the next page in the sg
mapping.

Fix this by enforcing strict 512 byte alignment on all buffers from
userspace.

Acked-by: Hugh Dickins <hugh@veritas.com>
Acked-by: Jeff Garzik <jeff@garzik.org>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
drivers/ata/libata-scsi.c