<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel/linux.git/net/vmw_vsock, branch linux-6.0.y</title>
<subtitle>Linux kernel stable tree (mirror)</subtitle>
<id>https://git.radix-linux.su/kernel/linux.git/atom?h=linux-6.0.y</id>
<link rel='self' href='https://git.radix-linux.su/kernel/linux.git/atom?h=linux-6.0.y'/>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/'/>
<updated>2022-12-31T12:26:12+00:00</updated>
<entry>
<title>net: vmw_vsock: vmci: Check memcpy_from_msg()</title>
<updated>2022-12-31T12:26:12+00:00</updated>
<author>
<name>Artem Chernyshev</name>
<email>artem.chernyshev@red-soft.ru</email>
</author>
<published>2022-12-06T06:58:34+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=b5cd38e32e18f556fab77972edd59fdb987b02ed'/>
<id>urn:sha1:b5cd38e32e18f556fab77972edd59fdb987b02ed</id>
<content type='text'>
[ Upstream commit 44aa5a6dba8283bfda28b1517af4de711c5652a4 ]

vmci_transport_dgram_enqueue() does not check the return value
of memcpy_from_msg().  If memcpy_from_msg() fails, it is possible that
uninitialized memory contents are sent unintentionally instead of user's
message in the datagram to the destination.  Return with an error if
memcpy_from_msg() fails.

Found by Linux Verification Center (linuxtesting.org) with SVACE.

Fixes: 0f7db23a07af ("vmci_transport: switch -&gt;enqeue_dgram, -&gt;enqueue_stream and -&gt;dequeue_stream to msghdr")
Signed-off-by: Artem Chernyshev &lt;artem.chernyshev@red-soft.ru&gt;
Reviewed-by: Stefano Garzarella &lt;sgarzare@redhat.com&gt;
Reviewed-by: Vishnu Dasa &lt;vdasa@vmware.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
</entry>
<entry>
<title>vsock: fix possible infinite sleep in vsock_connectible_wait_data()</title>
<updated>2022-11-10T17:17:22+00:00</updated>
<author>
<name>Dexuan Cui</name>
<email>decui@microsoft.com</email>
</author>
<published>2022-11-01T02:17:06+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=e0792a768244a98635279db2b60a837f62dce050'/>
<id>urn:sha1:e0792a768244a98635279db2b60a837f62dce050</id>
<content type='text'>
[ Upstream commit 466a85336fee6e3b35eb97b8405a28302fd25809 ]

Currently vsock_connectible_has_data() may miss a wakeup operation
between vsock_connectible_has_data() == 0 and the prepare_to_wait().

Fix the race by adding the process to the wait queue before checking
vsock_connectible_has_data().

Fixes: b3f7fd54881b ("af_vsock: separate wait data loop")
Signed-off-by: Dexuan Cui &lt;decui@microsoft.com&gt;
Reviewed-by: Stefano Garzarella &lt;sgarzare@redhat.com&gt;
Reported-by: Frédéric Dalleau &lt;frederic.dalleau@docker.com&gt;
Tested-by: Frédéric Dalleau &lt;frederic.dalleau@docker.com&gt;
Signed-off-by: Paolo Abeni &lt;pabeni@redhat.com&gt;
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
</entry>
<entry>
<title>vhost/vsock: Use kvmalloc/kvfree for larger packets.</title>
<updated>2022-10-21T10:38:19+00:00</updated>
<author>
<name>Junichi Uekawa</name>
<email>uekawa@chromium.org</email>
</author>
<published>2022-09-28T06:45:38+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=36c9f340c60413e28f980c0224c4e9d35851526b'/>
<id>urn:sha1:36c9f340c60413e28f980c0224c4e9d35851526b</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>vsock: Set socket state back to SS_UNCONNECTED in vsock_connect_timeout()</title>
<updated>2022-08-10T08:50:18+00:00</updated>
<author>
<name>Peilin Ye</name>
<email>peilin.ye@bytedance.com</email>
</author>
<published>2022-08-08T18:05:25+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=a3e7b29e30854ed67be0d17687e744ad0c769c4b'/>
<id>urn:sha1:a3e7b29e30854ed67be0d17687e744ad0c769c4b</id>
<content type='text'>
Imagine two non-blocking vsock_connect() requests on the same socket.
The first request schedules @connect_work, and after it times out,
vsock_connect_timeout() sets *sock* state back to TCP_CLOSE, but keeps
*socket* state as SS_CONNECTING.

Later, the second request returns -EALREADY, meaning the socket "already
has a pending connection in progress", even though the first request has
already timed out.

As suggested by Stefano, fix it by setting *socket* state back to
SS_UNCONNECTED, so that the second request will return -ETIMEDOUT.

Suggested-by: Stefano Garzarella &lt;sgarzare@redhat.com&gt;
Fixes: d021c344051a ("VSOCK: Introduce VM Sockets")
Reviewed-by: Stefano Garzarella &lt;sgarzare@redhat.com&gt;
Signed-off-by: Peilin Ye &lt;peilin.ye@bytedance.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>vsock: Fix memory leak in vsock_connect()</title>
<updated>2022-08-10T08:50:18+00:00</updated>
<author>
<name>Peilin Ye</name>
<email>peilin.ye@bytedance.com</email>
</author>
<published>2022-08-08T18:04:47+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=7e97cfed9929eaabc41829c395eb0d1350fccb9d'/>
<id>urn:sha1:7e97cfed9929eaabc41829c395eb0d1350fccb9d</id>
<content type='text'>
An O_NONBLOCK vsock_connect() request may try to reschedule
@connect_work.  Imagine the following sequence of vsock_connect()
requests:

  1. The 1st, non-blocking request schedules @connect_work, which will
     expire after 200 jiffies.  Socket state is now SS_CONNECTING;

  2. Later, the 2nd, blocking request gets interrupted by a signal after
     a few jiffies while waiting for the connection to be established.
     Socket state is back to SS_UNCONNECTED, but @connect_work is still
     pending, and will expire after 100 jiffies.

  3. Now, the 3rd, non-blocking request tries to schedule @connect_work
     again.  Since @connect_work is already scheduled,
     schedule_delayed_work() silently returns.  sock_hold() is called
     twice, but sock_put() will only be called once in
     vsock_connect_timeout(), causing a memory leak reported by syzbot:

  BUG: memory leak
  unreferenced object 0xffff88810ea56a40 (size 1232):
    comm "syz-executor756", pid 3604, jiffies 4294947681 (age 12.350s)
    hex dump (first 32 bytes):
      00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
      28 00 07 40 00 00 00 00 00 00 00 00 00 00 00 00  (..@............
    backtrace:
      [&lt;ffffffff837c830e&gt;] sk_prot_alloc+0x3e/0x1b0 net/core/sock.c:1930
      [&lt;ffffffff837cbe22&gt;] sk_alloc+0x32/0x2e0 net/core/sock.c:1989
      [&lt;ffffffff842ccf68&gt;] __vsock_create.constprop.0+0x38/0x320 net/vmw_vsock/af_vsock.c:734
      [&lt;ffffffff842ce8f1&gt;] vsock_create+0xc1/0x2d0 net/vmw_vsock/af_vsock.c:2203
      [&lt;ffffffff837c0cbb&gt;] __sock_create+0x1ab/0x2b0 net/socket.c:1468
      [&lt;ffffffff837c3acf&gt;] sock_create net/socket.c:1519 [inline]
      [&lt;ffffffff837c3acf&gt;] __sys_socket+0x6f/0x140 net/socket.c:1561
      [&lt;ffffffff837c3bba&gt;] __do_sys_socket net/socket.c:1570 [inline]
      [&lt;ffffffff837c3bba&gt;] __se_sys_socket net/socket.c:1568 [inline]
      [&lt;ffffffff837c3bba&gt;] __x64_sys_socket+0x1a/0x20 net/socket.c:1568
      [&lt;ffffffff84512815&gt;] do_syscall_x64 arch/x86/entry/common.c:50 [inline]
      [&lt;ffffffff84512815&gt;] do_syscall_64+0x35/0x80 arch/x86/entry/common.c:80
      [&lt;ffffffff84600068&gt;] entry_SYSCALL_64_after_hwframe+0x44/0xae
  &lt;...&gt;

Use mod_delayed_work() instead: if @connect_work is already scheduled,
reschedule it, and undo sock_hold() to keep the reference count
balanced.

Reported-and-tested-by: syzbot+b03f55bf128f9a38f064@syzkaller.appspotmail.com
Fixes: d021c344051a ("VSOCK: Introduce VM Sockets")
Co-developed-by: Stefano Garzarella &lt;sgarzare@redhat.com&gt;
Signed-off-by: Stefano Garzarella &lt;sgarzare@redhat.com&gt;
Reviewed-by: Stefano Garzarella &lt;sgarzare@redhat.com&gt;
Signed-off-by: Peilin Ye &lt;peilin.ye@bytedance.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>Merge tag 'hyperv-next-signed-20220528' of git://git.kernel.org/pub/scm/linux/kernel/git/hyperv/linux</title>
<updated>2022-05-28T18:39:01+00:00</updated>
<author>
<name>Linus Torvalds</name>
<email>torvalds@linux-foundation.org</email>
</author>
<published>2022-05-28T18:39:01+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=f56dbdda4322d33d485f3d30f3aabba71de9098c'/>
<id>urn:sha1:f56dbdda4322d33d485f3d30f3aabba71de9098c</id>
<content type='text'>
Pull hyperv updates from Wei Liu:

 - Harden hv_sock driver (Andrea Parri)

 - Harden Hyper-V PCI driver (Andrea Parri)

 - Fix multi-MSI for Hyper-V PCI driver (Jeffrey Hugo)

 - Fix Hyper-V PCI to reduce boot time (Dexuan Cui)

 - Remove code for long EOL'ed Hyper-V versions (Michael Kelley, Saurabh
   Sengar)

 - Fix balloon driver error handling (Shradha Gupta)

 - Fix a typo in vmbus driver (Julia Lawall)

 - Ignore vmbus IMC device (Michael Kelley)

 - Add a new error message to Hyper-V DRM driver (Saurabh Sengar)

* tag 'hyperv-next-signed-20220528' of git://git.kernel.org/pub/scm/linux/kernel/git/hyperv/linux: (28 commits)
  hv_balloon: Fix balloon_probe() and balloon_remove() error handling
  scsi: storvsc: Removing Pre Win8 related logic
  Drivers: hv: vmbus: fix typo in comment
  PCI: hv: Fix synchronization between channel callback and hv_pci_bus_exit()
  PCI: hv: Add validation for untrusted Hyper-V values
  PCI: hv: Fix interrupt mapping for multi-MSI
  PCI: hv: Reuse existing IRTE allocation in compose_msi_msg()
  drm/hyperv: Remove support for Hyper-V 2008 and 2008R2/Win7
  video: hyperv_fb: Remove support for Hyper-V 2008 and 2008R2/Win7
  scsi: storvsc: Remove support for Hyper-V 2008 and 2008R2/Win7
  Drivers: hv: vmbus: Remove support for Hyper-V 2008 and Hyper-V 2008R2/Win7
  x86/hyperv: Disable hardlockup detector by default in Hyper-V guests
  drm/hyperv: Add error message for fb size greater than allocated
  PCI: hv: Do not set PCI_COMMAND_MEMORY to reduce VM boot time
  PCI: hv: Fix hv_arch_irq_unmask() for multi-MSI
  Drivers: hv: vmbus: Refactor the ring-buffer iterator functions
  Drivers: hv: vmbus: Accept hv_sock offers in isolated guests
  hv_sock: Add validation for untrusted Hyper-V values
  hv_sock: Copy packets sent by Hyper-V out of the ring buffer
  hv_sock: Check hv_pkt_iter_first_raw()'s return value
  ...
</content>
</entry>
<entry>
<title>vsock/virtio: add support for device suspend/resume</title>
<updated>2022-05-02T23:04:34+00:00</updated>
<author>
<name>Stefano Garzarella</name>
<email>sgarzare@redhat.com</email>
</author>
<published>2022-04-28T13:22:41+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=bd50c5dc182b0a52599f87b429f9a5a9cbfc9b1c'/>
<id>urn:sha1:bd50c5dc182b0a52599f87b429f9a5a9cbfc9b1c</id>
<content type='text'>
Implement .freeze and .restore callbacks of struct virtio_driver
to support device suspend/resume.

During suspension all connected sockets are reset and VQs deleted.
During resume the VQs are re-initialized.

Reported by: Vilas R K &lt;vilas.r.k@intel.com&gt;
Signed-off-by: Stefano Garzarella &lt;sgarzare@redhat.com&gt;
Acked-by: Michael S. Tsirkin &lt;mst@redhat.com&gt;
Signed-off-by: Jakub Kicinski &lt;kuba@kernel.org&gt;
</content>
</entry>
<entry>
<title>vsock/virtio: factor our the code to initialize and delete VQs</title>
<updated>2022-05-02T23:04:34+00:00</updated>
<author>
<name>Stefano Garzarella</name>
<email>sgarzare@redhat.com</email>
</author>
<published>2022-04-28T13:22:40+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=a103209886264a3289f7e53e7ed389d0391fb23f'/>
<id>urn:sha1:a103209886264a3289f7e53e7ed389d0391fb23f</id>
<content type='text'>
Add virtio_vsock_vqs_init() and virtio_vsock_vqs_del() with the code
that was in virtio_vsock_probe() and virtio_vsock_remove to initialize
and delete VQs.

These new functions will be used in the next commit to support device
suspend/resume

Signed-off-by: Stefano Garzarella &lt;sgarzare@redhat.com&gt;
Acked-by: Michael S. Tsirkin &lt;mst@redhat.com&gt;
Signed-off-by: Jakub Kicinski &lt;kuba@kernel.org&gt;
</content>
</entry>
<entry>
<title>hv_sock: Add validation for untrusted Hyper-V values</title>
<updated>2022-04-28T15:01:14+00:00</updated>
<author>
<name>Andrea Parri (Microsoft)</name>
<email>parri.andrea@gmail.com</email>
</author>
<published>2022-04-28T14:51:05+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=dbde6d0c7a5a462a1767a07c28eadd2c3dd08fb2'/>
<id>urn:sha1:dbde6d0c7a5a462a1767a07c28eadd2c3dd08fb2</id>
<content type='text'>
For additional robustness in the face of Hyper-V errors or malicious
behavior, validate all values that originate from packets that Hyper-V
has sent to the guest in the host-to-guest ring buffer.  Ensure that
invalid values cannot cause data being copied out of the bounds of the
source buffer in hvs_stream_dequeue().

Signed-off-by: Andrea Parri (Microsoft) &lt;parri.andrea@gmail.com&gt;
Reviewed-by: Michael Kelley &lt;mikelley@microsoft.com&gt;
Reviewed-by: Stefano Garzarella &lt;sgarzare@redhat.com&gt;
Link: https://lore.kernel.org/r/20220428145107.7878-4-parri.andrea@gmail.com
Signed-off-by: Wei Liu &lt;wei.liu@kernel.org&gt;
</content>
</entry>
<entry>
<title>hv_sock: Copy packets sent by Hyper-V out of the ring buffer</title>
<updated>2022-04-28T15:01:14+00:00</updated>
<author>
<name>Andrea Parri (Microsoft)</name>
<email>parri.andrea@gmail.com</email>
</author>
<published>2022-04-28T14:51:04+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=066f3377fb663f839a961cd66e71fc1a36437657'/>
<id>urn:sha1:066f3377fb663f839a961cd66e71fc1a36437657</id>
<content type='text'>
Pointers to VMbus packets sent by Hyper-V are used by the hv_sock driver
within the guest VM.  Hyper-V can send packets with erroneous values or
modify packet fields after they are processed by the guest.  To defend
against these scenarios, copy the incoming packet after validating its
length and offset fields using hv_pkt_iter_{first,next}().  Use
HVS_PKT_LEN(HVS_MTU_SIZE) to initialize the buffer which holds the
copies of the incoming packets.  In this way, the packet can no longer
be modified by the host.

Signed-off-by: Andrea Parri (Microsoft) &lt;parri.andrea@gmail.com&gt;
Reviewed-by: Michael Kelley &lt;mikelley@microsoft.com&gt;
Reviewed-by: Stefano Garzarella &lt;sgarzare@redhat.com&gt;
Link: https://lore.kernel.org/r/20220428145107.7878-3-parri.andrea@gmail.com
Signed-off-by: Wei Liu &lt;wei.liu@kernel.org&gt;
</content>
</entry>
</feed>
