summaryrefslogtreecommitdiff
path: root/drivers/scsi/scsi_transport_fc.c
diff options
context:
space:
mode:
authorDavid Jeffery <dhjeffery@gmail.com>2012-04-11 12:14:25 -0400
committerJames Bottomley <JBottomley@Parallels.com>2012-05-10 08:32:34 +0100
commit7c018a901c3fef2af9d713ba849e8e52eb82dde1 (patch)
treed247f779ca728f9bc2753f78c027ba599626ed5c /drivers/scsi/scsi_transport_fc.c
parentad07b4a89602be57ec738eff462237ba52abe965 (diff)
downloadlwn-7c018a901c3fef2af9d713ba849e8e52eb82dde1.tar.gz
lwn-7c018a901c3fef2af9d713ba849e8e52eb82dde1.zip
[SCSI] st: fix memory leak with >1MB tape I/O
There is a memory leak in the st driver when sending large enough reads or writes using st's direct I/O path. As part of mapping the application's memory, a buffer to hold page pointers is allocated and the count of mapped pages is stored in field do_dio. A non-zero do_dio marks that direct I/O is in use. But do_dio is only 1 byte in size. Mapping 256 4k pages overflows do_dio and causes it to be set to 0, like direct I/O option was not used. When the I/O completes, the buffer to hold the page pointers is not freed, and the page counts of the mapped pages are not reduced. Every I/O of this size then leaks memory. The size of do_dio needs to be increased to prevent it wrapping around. Signed-off-by: David Jeffery <djeffery@redhat.com> Acked-by: Kai Mäkisara <kai.makisara@kolumbus.fi> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
Diffstat (limited to 'drivers/scsi/scsi_transport_fc.c')
0 files changed, 0 insertions, 0 deletions