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>] [day] [month] [year] [list]
Date:   Thu, 6 Jul 2017 21:37:11 +0000
From:   Dexuan Cui <decui@...rosoft.com>
To:     "gregkh@...uxfoundation.org" <gregkh@...uxfoundation.org>,
        KY Srinivasan <kys@...rosoft.com>,
        Stephen Hemminger <sthemmin@...rosoft.com>,
        "Haiyang Zhang" <haiyangz@...rosoft.com>,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
        "devel@...uxdriverproject.org" <devel@...uxdriverproject.org>
CC:     "olaf@...fle.de" <olaf@...fle.de>,
        Vitaly Kuznetsov <vkuznets@...hat.com>,
        "jasowang@...hat.com" <jasowang@...hat.com>,
        "apw@...onical.com" <apw@...onical.com>,
        Andy Lutomirski <luto@...nel.org>,
        "marcelo.cerri@...onical.com" <marcelo.cerri@...onical.com>,
        "leann.ogasawara@...onical.com" <leann.ogasawara@...onical.com>,
        "Rolf Neugebauer" <rolf.neugebauer@...ker.com>,
        'Marcelo Cerri' <marcelo.cerri@...onical.com>
Subject: [PATCH] vmbus: fix the missed signaling in hv_signal_on_read()

There is an off-by-one bug here, which can cause host-to-guest write to stall.

When cur_write_sz == pending_sz, we shouldn't signal the host because it's
meaningless: the ring mustn't be 100% full.

But when cached_write_sz == pending_sz, we must signal the host.

Fixes: 433e19cf33d3 ("Drivers: hv: vmbus: finally fix
hv_need_to_signal_on_read()")

Signed-off-by: John Starks <John.Starks@...rosoft.com>
Signed-off-by: Dexuan Cui <decui@...rosoft.com>
Cc: Haiyang Zhang <haiyangz@...rosoft.com>
Cc: Stephen Hemminger <sthemmin@...rosoft.com>
Cc: "K. Y. Srinivasan" <kys@...rosoft.com>
Cc: <stable@...r.kernel.org>
---
 include/linux/hyperv.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/include/linux/hyperv.h b/include/linux/hyperv.h
index ba93b7e..246bc6b 100644
--- a/include/linux/hyperv.h
+++ b/include/linux/hyperv.h
@@ -1501,11 +1501,11 @@ static inline  void hv_signal_on_read(struct vmbus_channel *channel)
 
 	cur_write_sz = hv_get_bytes_to_write(rbi);
 
-	if (cur_write_sz < pending_sz)
+	if (cur_write_sz <= pending_sz)
 		return;
 
 	cached_write_sz = hv_get_cached_bytes_to_write(rbi);
-	if (cached_write_sz < pending_sz)
+	if (cached_write_sz <= pending_sz)
 		vmbus_setevent(channel);
 
 	return;
-- 
2.7.4

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ