lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-Id: <20250207052033.2222629-2-junnan01.wu@samsung.com>
Date: Fri,  7 Feb 2025 13:20:33 +0800
From: Junnan Wu <junnan01.wu@...sung.com>
To: stefanha@...hat.com, sgarzare@...hat.com
Cc: kvm@...r.kernel.org, virtualization@...ts.linux-foundation.org,
	netdev@...r.kernel.org, mindong.zhao@...sung.com, q1.huang@...sung.com,
	ying01.gao@...sung.com, ying123.xu@...sung.com, Junnan Wu
	<junnan01.wu@...sung.com>
Subject: [PATCH 2/2] vsock/virtio: Don't reset the created SOCKET during s2r

From: Ying Gao <ying01.gao@...sung.com>

If suspend is executed during vsock communication and the
socket is reset, the original socket will be unusable after resume.

Judge the value of vdev->priv in function virtio_vsock_vqs_del,
only when the function is invoked by virtio_vsock_remove,
all vsock connections will be reset.

Signed-off-by: Ying Gao <ying01.gao@...sung.com>
Signed-off-by: Junnan Wu <junnan01.wu@...sung.com>
---
 net/vmw_vsock/virtio_transport.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/net/vmw_vsock/virtio_transport.c b/net/vmw_vsock/virtio_transport.c
index 9eefd0fba92b..9df609581755 100644
--- a/net/vmw_vsock/virtio_transport.c
+++ b/net/vmw_vsock/virtio_transport.c
@@ -717,8 +717,10 @@ static void virtio_vsock_vqs_del(struct virtio_vsock *vsock)
 	struct sk_buff *skb;
 
 	/* Reset all connected sockets when the VQs disappear */
-	vsock_for_each_connected_socket(&virtio_transport.transport,
-					virtio_vsock_reset_sock);
+	if (!vdev->priv) {
+		vsock_for_each_connected_socket(&virtio_transport.transport,
+						virtio_vsock_reset_sock);
+	}
 
 	/* Stop all work handlers to make sure no one is accessing the device,
 	 * so we can safely call virtio_reset_device().
-- 
2.34.1


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ