diff options
| author | Pavel Tikhomirov <ptikhomirov@virtuozzo.com> | 2018-12-13 17:53:50 +0300 | 
|---|---|---|
| committer | Michael S. Tsirkin <mst@redhat.com> | 2019-01-15 04:28:07 +0300 | 
| commit | 74ad7419489ddade8044e3c9ab064ad656520306 (patch) | |
| tree | 6cb0e71ecb649c2b8061d85550d0c84098162e94 /lib/dynamic_queue_limits.c | |
| parent | bf4dc0b2beebfd9338df7c0bcf473b356f67cf66 (diff) | |
| download | linux-74ad7419489ddade8044e3c9ab064ad656520306.tar.xz | |
vhost: return EINVAL if iovecs size does not match the message size
We've failed to copy and process vhost_iotlb_msg so let userspace at
least know about it. For instance before these patch the code below runs
without any error:
int main()
{
  struct vhost_msg msg;
  struct iovec iov;
  int fd;
  fd = open("/dev/vhost-net", O_RDWR);
  if (fd == -1) {
    perror("open");
    return 1;
  }
  iov.iov_base = &msg;
  iov.iov_len = sizeof(msg)-4;
  if (writev(fd, &iov,1) == -1) {
    perror("writev");
    return 1;
  }
  return 0;
}
Signed-off-by: Pavel Tikhomirov <ptikhomirov@virtuozzo.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Diffstat (limited to 'lib/dynamic_queue_limits.c')
0 files changed, 0 insertions, 0 deletions
