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 for Android: free password hash cracker in your pocket
[<prev] [next>] [day] [month] [year] [list]
Message-ID: <20110518211339.GA26122@redhat.com>
Date:	Thu, 19 May 2011 00:13:39 +0300
From:	"Michael S. Tsirkin" <mst@...hat.com>
To:	virtualization@...ts.linux-foundation.org
Cc:	netdev@...r.kernel.org, linux-kernel@...r.kernel.org,
	rusty@...tcorp.com.au, habanero@...ux.vnet.ibm.com,
	Shirley Ma <mashirle@...ibm.com>,
	Krishna Kumar2 <krkumar2@...ibm.com>, kvm@...r.kernel.org,
	steved@...ibm.com, Tom Lendacky <tahm@...ux.vnet.ibm.com>,
	borntraeger@...ibm.com, avi@...hat.com
Subject: [PATCH RFC] vhost: fix enable notify: write out last avail value we
 saw

With RX ring and mergeable buffers, vhost-net sometimes
enables notifications when ring is not empty - just
doesn't have enough entries for the incoming packet.

To get event when entries are added in this case,
we should always write out the last index value
we saw into event index field, which is ahead
of the index we have consumed.

Otherwise we get a kick, see that there are not enough
entries in the ring, reenable notifications
but since last used index was not updated
we don't get any more events.

Signed-off-by: Michael S. Tsirkin <mst@...hat.com>
---

This bugfix is on top of my patchset, I'm working on addressing
Rusty's comments for that now.

Will push to my git tree event idx branch for everyone's testing pleasure
shortly.


 drivers/vhost/vhost.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/vhost/vhost.c b/drivers/vhost/vhost.c
index 2aea4cb..1267a3d 100644
--- a/drivers/vhost/vhost.c
+++ b/drivers/vhost/vhost.c
@@ -1438,7 +1438,7 @@ bool vhost_enable_notify(struct vhost_dev *dev, struct vhost_virtqueue *vq)
 			return false;
 		}
 	} else {
-		r = put_user(vq->last_avail_idx, vhost_avail_event(vq));
+		r = put_user(vq->avail_idx, vhost_avail_event(vq));
 		if (r) {
 			vq_err(vq, "Failed to update avail event index at %p: %d\n",
 			       vhost_avail_event(vq), r);
-- 
1.7.5.53.gc233e
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ