vhost.c (712cba5d87a6c0e980ee5fad45734e189c4d7151) vhost.c (cbbd26b8b1a6af9c02e2b6523e12bd50cc765059)
1/* Copyright (C) 2009 Red Hat, Inc.
2 * Copyright (C) 2006 Rusty Russell IBM Corporation
3 *
4 * Author: Michael S. Tsirkin <mst@redhat.com>
5 *
6 * Inspiration, some code, and most witty comments come from
7 * Documentation/virtual/lguest/lguest.c, by Rusty Russell
8 *

--- 1848 unchanged lines hidden (view full) ---

1857 do {
1858 unsigned iov_count = *in_num + *out_num;
1859 if (unlikely(++found > count)) {
1860 vq_err(vq, "Loop detected: last one at %u "
1861 "indirect size %u\n",
1862 i, count);
1863 return -EINVAL;
1864 }
1/* Copyright (C) 2009 Red Hat, Inc.
2 * Copyright (C) 2006 Rusty Russell IBM Corporation
3 *
4 * Author: Michael S. Tsirkin <mst@redhat.com>
5 *
6 * Inspiration, some code, and most witty comments come from
7 * Documentation/virtual/lguest/lguest.c, by Rusty Russell
8 *

--- 1848 unchanged lines hidden (view full) ---

1857 do {
1858 unsigned iov_count = *in_num + *out_num;
1859 if (unlikely(++found > count)) {
1860 vq_err(vq, "Loop detected: last one at %u "
1861 "indirect size %u\n",
1862 i, count);
1863 return -EINVAL;
1864 }
1865 if (unlikely(copy_from_iter(&desc, sizeof(desc), &from) !=
1866 sizeof(desc))) {
1865 if (unlikely(!copy_from_iter_full(&desc, sizeof(desc), &from))) {
1867 vq_err(vq, "Failed indirect descriptor: idx %d, %zx\n",
1868 i, (size_t)vhost64_to_cpu(vq, indirect->addr) + i * sizeof desc);
1869 return -EINVAL;
1870 }
1871 if (unlikely(desc.flags & cpu_to_vhost16(vq, VRING_DESC_F_INDIRECT))) {
1872 vq_err(vq, "Nested indirect descriptor: idx %d, %zx\n",
1873 i, (size_t)vhost64_to_cpu(vq, indirect->addr) + i * sizeof desc);
1874 return -EINVAL;

--- 474 unchanged lines hidden ---
1866 vq_err(vq, "Failed indirect descriptor: idx %d, %zx\n",
1867 i, (size_t)vhost64_to_cpu(vq, indirect->addr) + i * sizeof desc);
1868 return -EINVAL;
1869 }
1870 if (unlikely(desc.flags & cpu_to_vhost16(vq, VRING_DESC_F_INDIRECT))) {
1871 vq_err(vq, "Nested indirect descriptor: idx %d, %zx\n",
1872 i, (size_t)vhost64_to_cpu(vq, indirect->addr) + i * sizeof desc);
1873 return -EINVAL;

--- 474 unchanged lines hidden ---