<feed xmlns='http://www.w3.org/2005/Atom'>
<title>user/sven/linux.git/drivers/vhost, branch v5.10.154</title>
<subtitle>Linux Kernel
</subtitle>
<id>https://git.stealer.net/cgit.cgi/user/sven/linux.git/atom?h=v5.10.154</id>
<link rel='self' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/atom?h=v5.10.154'/>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/'/>
<updated>2022-10-26T11:25:22Z</updated>
<entry>
<title>vhost/vsock: Use kvmalloc/kvfree for larger packets.</title>
<updated>2022-10-26T11:25:22Z</updated>
<author>
<name>Junichi Uekawa</name>
<email>uekawa@chromium.org</email>
</author>
<published>2022-09-28T06:45:38Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=b4a5905fd2ef841cd61e969ea692c213c2e5c1f7'/>
<id>urn:sha1:b4a5905fd2ef841cd61e969ea692c213c2e5c1f7</id>
<content type='text'>
[ Upstream commit 0e3f72931fc47bb81686020cc643cde5d9cd0bb8 ]

When copying a large file over sftp over vsock, data size is usually 32kB,
and kmalloc seems to fail to try to allocate 32 32kB regions.

 vhost-5837: page allocation failure: order:4, mode:0x24040c0
 Call Trace:
  [&lt;ffffffffb6a0df64&gt;] dump_stack+0x97/0xdb
  [&lt;ffffffffb68d6aed&gt;] warn_alloc_failed+0x10f/0x138
  [&lt;ffffffffb68d868a&gt;] ? __alloc_pages_direct_compact+0x38/0xc8
  [&lt;ffffffffb664619f&gt;] __alloc_pages_nodemask+0x84c/0x90d
  [&lt;ffffffffb6646e56&gt;] alloc_kmem_pages+0x17/0x19
  [&lt;ffffffffb6653a26&gt;] kmalloc_order_trace+0x2b/0xdb
  [&lt;ffffffffb66682f3&gt;] __kmalloc+0x177/0x1f7
  [&lt;ffffffffb66e0d94&gt;] ? copy_from_iter+0x8d/0x31d
  [&lt;ffffffffc0689ab7&gt;] vhost_vsock_handle_tx_kick+0x1fa/0x301 [vhost_vsock]
  [&lt;ffffffffc06828d9&gt;] vhost_worker+0xf7/0x157 [vhost]
  [&lt;ffffffffb683ddce&gt;] kthread+0xfd/0x105
  [&lt;ffffffffc06827e2&gt;] ? vhost_dev_set_owner+0x22e/0x22e [vhost]
  [&lt;ffffffffb683dcd1&gt;] ? flush_kthread_worker+0xf3/0xf3
  [&lt;ffffffffb6eb332e&gt;] ret_from_fork+0x4e/0x80
  [&lt;ffffffffb683dcd1&gt;] ? flush_kthread_worker+0xf3/0xf3

Work around by doing kvmalloc instead.

Fixes: 433fc58e6bf2 ("VSOCK: Introduce vhost_vsock.ko")
Signed-off-by: Junichi Uekawa &lt;uekawa@chromium.org&gt;
Reviewed-by: Stefano Garzarella &lt;sgarzare@redhat.com&gt;
Acked-by: Michael S. Tsirkin &lt;mst@redhat.com&gt;
Link: https://lore.kernel.org/r/20220928064538.667678-1-uekawa@chromium.org
Signed-off-by: Jakub Kicinski &lt;kuba@kernel.org&gt;
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
</entry>
<entry>
<title>vringh: Fix loop descriptors check in the indirect cases</title>
<updated>2022-06-14T16:32:45Z</updated>
<author>
<name>Xie Yongji</name>
<email>xieyongji@bytedance.com</email>
</author>
<published>2022-05-05T10:09:10Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=b6ea26873edbd9ca3c0c338c9de856de7f1fcede'/>
<id>urn:sha1:b6ea26873edbd9ca3c0c338c9de856de7f1fcede</id>
<content type='text'>
[ Upstream commit dbd29e0752286af74243cf891accf472b2f3edd8 ]

We should use size of descriptor chain to test loop condition
in the indirect case. And another statistical count is also introduced
for indirect descriptors to avoid conflict with the statistical count
of direct descriptors.

Fixes: f87d0fbb5798 ("vringh: host-side implementation of virtio rings.")
Signed-off-by: Xie Yongji &lt;xieyongji@bytedance.com&gt;
Signed-off-by: Fam Zheng &lt;fam.zheng@bytedance.com&gt;
Message-Id: &lt;20220505100910.137-1-xieyongji@bytedance.com&gt;
Signed-off-by: Michael S. Tsirkin &lt;mst@redhat.com&gt;
Acked-by: Jason Wang &lt;jasowang@redhat.com&gt;
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
</entry>
<entry>
<title>Fix double fget() in vhost_net_set_backend()</title>
<updated>2022-05-25T07:17:55Z</updated>
<author>
<name>Al Viro</name>
<email>viro@zeniv.linux.org.uk</email>
</author>
<published>2022-05-16T08:42:13Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=ec0d801d1a44d9259377142c6218885ecd685e41'/>
<id>urn:sha1:ec0d801d1a44d9259377142c6218885ecd685e41</id>
<content type='text'>
commit fb4554c2232e44d595920f4d5c66cf8f7d13f9bc upstream.

Descriptor table is a shared resource; two fget() on the same descriptor
may return different struct file references.  get_tap_ptr_ring() is
called after we'd found (and pinned) the socket we'll be using and it
tries to find the private tun/tap data structures associated with it.
Redoing the lookup by the same file descriptor we'd used to get the
socket is racy - we need to same struct file.

Thanks to Jason for spotting a braino in the original variant of patch -
I'd missed the use of fd == -1 for disabling backend, and in that case
we can end up with sock == NULL and sock != oldsock.

Cc: stable@kernel.org
Acked-by: Michael S. Tsirkin &lt;mst@redhat.com&gt;
Signed-off-by: Jason Wang &lt;jasowang@redhat.com&gt;
Signed-off-by: Al Viro &lt;viro@zeniv.linux.org.uk&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>vhost_vdpa: don't setup irq offloading when irq_num &lt; 0</title>
<updated>2022-05-25T07:17:53Z</updated>
<author>
<name>Zhu Lingshan</name>
<email>lingshan.zhu@intel.com</email>
</author>
<published>2022-02-22T11:54:25Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=5a4cbcb3df45be164bdf9257ea7e0dd89e447cf3'/>
<id>urn:sha1:5a4cbcb3df45be164bdf9257ea7e0dd89e447cf3</id>
<content type='text'>
[ Upstream commit cce0ab2b2a39072d81f98017f7b076f3410ef740 ]

When irq number is negative(e.g., -EINVAL), the virtqueue
may be disabled or the virtqueues are sharing a device irq.
In such case, we should not setup irq offloading for a virtqueue.

Signed-off-by: Zhu Lingshan &lt;lingshan.zhu@intel.com&gt;
Link: https://lore.kernel.org/r/20220222115428.998334-3-lingshan.zhu@intel.com
Signed-off-by: Michael S. Tsirkin &lt;mst@redhat.com&gt;
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
</entry>
<entry>
<title>tuntap: add sanity checks about msg_controllen in sendmsg</title>
<updated>2022-04-13T19:00:59Z</updated>
<author>
<name>Harold Huang</name>
<email>baymaxhuang@gmail.com</email>
</author>
<published>2022-03-03T02:24:40Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=647b35aaf454271d68067d4bf05154095fe63f93'/>
<id>urn:sha1:647b35aaf454271d68067d4bf05154095fe63f93</id>
<content type='text'>
[ Upstream commit 74a335a07a17d131b9263bfdbdcb5e40673ca9ca ]

In patch [1], tun_msg_ctl was added to allow pass batched xdp buffers to
tun_sendmsg. Although we donot use msg_controllen in this path, we should
check msg_controllen to make sure the caller pass a valid msg_ctl.

[1]: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=fe8dd45bb7556246c6b76277b1ba4296c91c2505

Reported-by: Eric Dumazet &lt;eric.dumazet@gmail.com&gt;
Suggested-by: Jason Wang &lt;jasowang@redhat.com&gt;
Signed-off-by: Harold Huang &lt;baymaxhuang@gmail.com&gt;
Acked-by: Jason Wang &lt;jasowang@redhat.com&gt;
Link: https://lore.kernel.org/r/20220303022441.383865-1-baymaxhuang@gmail.com
Signed-off-by: Jakub Kicinski &lt;kuba@kernel.org&gt;
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
</entry>
<entry>
<title>vsock: each transport cycles only on its own sockets</title>
<updated>2022-03-23T08:13:27Z</updated>
<author>
<name>Jiyong Park</name>
<email>jiyong@google.com</email>
</author>
<published>2022-03-11T02:00:16Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=d9fe590970c463163098d7ecca902690b2ad9467'/>
<id>urn:sha1:d9fe590970c463163098d7ecca902690b2ad9467</id>
<content type='text'>
[ Upstream commit 8e6ed963763fe21429eabfc76c69ce2b0163a3dd ]

When iterating over sockets using vsock_for_each_connected_socket, make
sure that a transport filters out sockets that don't belong to the
transport.

There actually was an issue caused by this; in a nested VM
configuration, destroying the nested VM (which often involves the
closing of /dev/vhost-vsock if there was h2g connections to the nested
VM) kills not only the h2g connections, but also all existing g2h
connections to the (outmost) host which are totally unrelated.

Tested: Executed the following steps on Cuttlefish (Android running on a
VM) [1]: (1) Enter into an `adb shell` session - to have a g2h
connection inside the VM, (2) open and then close /dev/vhost-vsock by
`exec 3&lt; /dev/vhost-vsock &amp;&amp; exec 3&lt;&amp;-`, (3) observe that the adb
session is not reset.

[1] https://android.googlesource.com/device/google/cuttlefish/

Fixes: c0cfa2d8a788 ("vsock: add multi-transports support")
Reviewed-by: Stefano Garzarella &lt;sgarzare@redhat.com&gt;
Acked-by: Michael S. Tsirkin &lt;mst@redhat.com&gt;
Signed-off-by: Jiyong Park &lt;jiyong@google.com&gt;
Link: https://lore.kernel.org/r/20220311020017.1509316-1-jiyong@google.com
Signed-off-by: Jakub Kicinski &lt;kuba@kernel.org&gt;
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
</entry>
<entry>
<title>vhost/vsock: don't check owner in vhost_vsock_stop() while releasing</title>
<updated>2022-03-02T10:42:46Z</updated>
<author>
<name>Stefano Garzarella</name>
<email>sgarzare@redhat.com</email>
</author>
<published>2022-02-22T09:47:42Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=698dc7d13c4e972214458996455447651a657264'/>
<id>urn:sha1:698dc7d13c4e972214458996455447651a657264</id>
<content type='text'>
commit a58da53ffd70294ebea8ecd0eb45fd0d74add9f9 upstream.

vhost_vsock_stop() calls vhost_dev_check_owner() to check the device
ownership. It expects current-&gt;mm to be valid.

vhost_vsock_stop() is also called by vhost_vsock_dev_release() when
the user has not done close(), so when we are in do_exit(). In this
case current-&gt;mm is invalid and we're releasing the device, so we
should clean it anyway.

Let's check the owner only when vhost_vsock_stop() is called
by an ioctl.

When invoked from release we can not fail so we don't check return
code of vhost_vsock_stop(). We need to stop vsock even if it's not
the owner.

Fixes: 433fc58e6bf2 ("VSOCK: Introduce vhost_vsock.ko")
Cc: stable@vger.kernel.org
Reported-by: syzbot+1e3ea63db39f2b4440e0@syzkaller.appspotmail.com
Reported-and-tested-by: syzbot+3140b17cb44a7b174008@syzkaller.appspotmail.com
Signed-off-by: Stefano Garzarella &lt;sgarzare@redhat.com&gt;
Acked-by: Jason Wang &lt;jasowang@redhat.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>vdpa: check that offsets are within bounds</title>
<updated>2021-12-22T08:30:51Z</updated>
<author>
<name>Dan Carpenter</name>
<email>dan.carpenter@oracle.com</email>
</author>
<published>2021-12-08T10:33:37Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=51f6302f81d243772047a74ffeceddfb11c964d5'/>
<id>urn:sha1:51f6302f81d243772047a74ffeceddfb11c964d5</id>
<content type='text'>
commit 3ed21c1451a14d139e1ceb18f2fa70865ce3195a upstream.

In this function "c-&gt;off" is a u32 and "size" is a long.  On 64bit systems
if "c-&gt;off" is greater than "size" then "size - c-&gt;off" is a negative and
we always return -E2BIG.  But on 32bit systems the subtraction is type
promoted to a high positive u32 value and basically any "c-&gt;len" is
accepted.

Fixes: 4c8cf31885f6 ("vhost: introduce vDPA-based backend")
Reported-by: Xie Yongji &lt;xieyongji@bytedance.com&gt;
Signed-off-by: Dan Carpenter &lt;dan.carpenter@oracle.com&gt;
Link: https://lore.kernel.org/r/20211208103337.GA4047@kili
Signed-off-by: Michael S. Tsirkin &lt;mst@redhat.com&gt;
Cc: stable@vger.kernel.org
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>vhost/vsock: fix incorrect used length reported to the guest</title>
<updated>2021-12-01T08:19:09Z</updated>
<author>
<name>Stefano Garzarella</name>
<email>sgarzare@redhat.com</email>
</author>
<published>2021-11-22T16:35:24Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=4fd0ad08ee332d7b61e0fc7fabead1fb57554065'/>
<id>urn:sha1:4fd0ad08ee332d7b61e0fc7fabead1fb57554065</id>
<content type='text'>
commit 49d8c5ffad07ca014cfae72a1b9b8c52b6ad9cb8 upstream.

The "used length" reported by calling vhost_add_used() must be the
number of bytes written by the device (using "in" buffers).

In vhost_vsock_handle_tx_kick() the device only reads the guest
buffers (they are all "out" buffers), without writing anything,
so we must pass 0 as "used length" to comply virtio spec.

Fixes: 433fc58e6bf2 ("VSOCK: Introduce vhost_vsock.ko")
Cc: stable@vger.kernel.org
Reported-by: Halil Pasic &lt;pasic@linux.ibm.com&gt;
Suggested-by: Jason Wang &lt;jasowang@redhat.com&gt;
Signed-off-by: Stefano Garzarella &lt;sgarzare@redhat.com&gt;
Link: https://lore.kernel.org/r/20211122163525.294024-2-sgarzare@redhat.com
Signed-off-by: Michael S. Tsirkin &lt;mst@redhat.com&gt;
Reviewed-by: Stefan Hajnoczi &lt;stefanha@redhat.com&gt;
Reviewed-by: Halil Pasic &lt;pasic@linux.ibm.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>vhost-vdpa: Fix the wrong input in config_cb</title>
<updated>2021-10-20T09:45:04Z</updated>
<author>
<name>Cindy Lu</name>
<email>lulu@redhat.com</email>
</author>
<published>2021-09-29T09:09:33Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=ba39f55952a217b83311467c0b911126dad9b37f'/>
<id>urn:sha1:ba39f55952a217b83311467c0b911126dad9b37f</id>
<content type='text'>
commit bcef9356fc2e1302daf373c83c826aa27954d128 upstream.

Fix the wrong input in for config_cb. In function vhost_vdpa_config_cb,
the input cb.private was used as struct vhost_vdpa, so the input was
wrong here, fix this issue

Fixes: 776f395004d8 ("vhost_vdpa: Support config interrupt in vdpa")
Signed-off-by: Cindy Lu &lt;lulu@redhat.com&gt;
Link: https://lore.kernel.org/r/20210929090933.20465-1-lulu@redhat.com
Signed-off-by: Michael S. Tsirkin &lt;mst@redhat.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
</feed>
