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-next>] [day] [month] [year] [list]
Message-Id: <20250207052033.2222629-1-junnan01.wu@samsung.com>
Date: Fri,  7 Feb 2025 13:20:32 +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 1/2] vsock/virtio: Move rx_buf_nr and rx_buf_max_nr
 initialization position

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

In function virtio_vsock_probe, it initializes the variables
"rx_buf_nr" and "rx_buf_max_nr",
but in function virtio_vsock_restore it doesn't.

Move the initizalition position into function virtio_vsock_vqs_start.

Once executing s2r twice in a row without
initializing rx_buf_nr and rx_buf_max_nr,
the rx_buf_max_nr increased to three times vq->num_free,
at this time, in function virtio_transport_rx_work,
the conditions to fill rx buffer
(rx_buf_nr < rx_buf_max_nr / 2) can't be met.

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

diff --git a/net/vmw_vsock/virtio_transport.c b/net/vmw_vsock/virtio_transport.c
index b58c3818f284..9eefd0fba92b 100644
--- a/net/vmw_vsock/virtio_transport.c
+++ b/net/vmw_vsock/virtio_transport.c
@@ -688,6 +688,8 @@ static void virtio_vsock_vqs_start(struct virtio_vsock *vsock)
 	mutex_unlock(&vsock->tx_lock);
 
 	mutex_lock(&vsock->rx_lock);
+	vsock->rx_buf_nr = 0;
+	vsock->rx_buf_max_nr = 0;
 	virtio_vsock_rx_fill(vsock);
 	vsock->rx_run = true;
 	mutex_unlock(&vsock->rx_lock);
@@ -779,8 +781,6 @@ static int virtio_vsock_probe(struct virtio_device *vdev)
 
 	vsock->vdev = vdev;
 
-	vsock->rx_buf_nr = 0;
-	vsock->rx_buf_max_nr = 0;
 	atomic_set(&vsock->queued_replies, 0);
 
 	mutex_init(&vsock->tx_lock);
-- 
2.34.1


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ