Skip to content

Commit

Permalink
Merge tag 'vfio-for-v3.8-rc5' of git://github.com/awilliam/linux-vfio
Browse files Browse the repository at this point in the history
Pull vfio fix from Alex Williamson.
 "vfio-pci: Fix buffer overfill"

* tag 'vfio-for-v3.8-rc5' of git://github.com/awilliam/linux-vfio:
  vfio-pci: Fix buffer overfill
  • Loading branch information
Linus Torvalds committed Jan 22, 2013
2 parents d26d452 + ec1287e commit 3c2a9f8
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/vfio/pci/vfio_pci_rdwr.c
Original file line number Diff line number Diff line change
Expand Up @@ -240,17 +240,17 @@ ssize_t vfio_pci_mem_readwrite(struct vfio_pci_device *vdev, char __user *buf,
filled = 1;
} else {
/* Drop writes, fill reads with FF */
filled = min((size_t)(x_end - pos), count);
if (!iswrite) {
char val = 0xFF;
size_t i;

for (i = 0; i < x_end - pos; i++) {
for (i = 0; i < filled; i++) {
if (put_user(val, buf + i))
goto out;
}
}

filled = x_end - pos;
}

count -= filled;
Expand Down

0 comments on commit 3c2a9f8

Please sign in to comment.