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]
Date:	Fri, 07 May 2010 13:11:08 -0700
From:	David L Stevens <dlstevens@...ibm.com>
To:	mst@...hat.com
Cc:	netdev@...r.kernel.org
Subject: [PATCH] fix multi-buffer logging with mergeable buffers

This patch fixes the multibuffer case of logging with
mergeable buffers.

Signed-off-by: David L Stevens <dlstevens@...ibm.com>

diff --git a/drivers/vhost/net.c b/drivers/vhost/net.c
index 85519b4..d526b68 100644
--- a/drivers/vhost/net.c
+++ b/drivers/vhost/net.c
@@ -236,8 +236,9 @@ static int get_rx_bufs(struct vhost_virtqueue *vq,
 	int seg = 0;
 	int headcount = 0;
 	unsigned d;
-	int r;
+	int r, nlogs;
 
+	nlogs = 0;
 	while (datalen > 0) {
 		if (unlikely(headcount >= VHOST_NET_MAX_SG)) {
 			r = -ENOBUFS;
@@ -245,7 +246,8 @@ static int get_rx_bufs(struct vhost_virtqueue *vq,
 		}
 		d = vhost_get_desc(vq->dev, vq, vq->iov + seg,
 				   ARRAY_SIZE(vq->iov) - seg, &out,
-				   &in, log, log_num);
+				   &in, log+nlogs, log_num);
+		nlogs += log ? *log_num : 0;
 		if (d == vq->num) {
 			r = 0;
 			goto err;
@@ -263,6 +265,8 @@ static int get_rx_bufs(struct vhost_virtqueue *vq,
 		seg += in;
 	}
 	*iovcount = seg;
+	if (unlikely(log))
+		*log_num = nlogs;
 	return headcount;
 err:
 	vhost_discard_desc(vq, headcount);


--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ