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:   Mon, 28 Nov 2016 17:30:27 +0100
From:   Vitaly Kuznetsov <vkuznets@...hat.com>
To:     devel@...uxdriverproject.org
Cc:     linux-kernel@...r.kernel.org,
        "K. Y. Srinivasan" <kys@...rosoft.com>,
        Haiyang Zhang <haiyangz@...rosoft.com>,
        Alex Ng <alexng@...rosoft.com>
Subject: [PATCH] hv: utils: properly pick TS protocol version for future hosts

It is reasonable to expect that future Hyper-V versions will continue
supporting TimeSync v4 protocol, we, however, only pick it for
VERSION_WIN10. Currently this is not an issue as VERSION_WIN10 is the
maximum protocol version we can negotiate but this may change in future.
Instead of hoping that we won't forget to update it when time comes I
suggest we change the default now.

Signed-off-by: Vitaly Kuznetsov <vkuznets@...hat.com>
---
 drivers/hv/hv_util.c | 13 +++++--------
 1 file changed, 5 insertions(+), 8 deletions(-)

diff --git a/drivers/hv/hv_util.c b/drivers/hv/hv_util.c
index bcd0630..a13003f 100644
--- a/drivers/hv/hv_util.c
+++ b/drivers/hv/hv_util.c
@@ -382,23 +382,20 @@ static int util_probe(struct hv_device *dev,
 	 * Based on the host; initialize the framework and
 	 * service version numbers we will negotiate.
 	 */
-	switch (vmbus_proto_version) {
-	case (VERSION_WS2008):
+	if (vmbus_proto_version <= VERSION_WS2008) {
 		util_fw_version = UTIL_WS2K8_FW_VERSION;
 		sd_srv_version = SD_VERSION_1;
 		ts_srv_version = TS_VERSION_1;
 		hb_srv_version = HB_VERSION_1;
-		break;
-	case(VERSION_WIN10):
+	} else if (vmbus_proto_version < VERSION_WIN10) {
 		util_fw_version = UTIL_FW_VERSION;
 		sd_srv_version = SD_VERSION;
-		ts_srv_version = TS_VERSION;
+		ts_srv_version = TS_VERSION_3;
 		hb_srv_version = HB_VERSION;
-		break;
-	default:
+	} else {
 		util_fw_version = UTIL_FW_VERSION;
 		sd_srv_version = SD_VERSION;
-		ts_srv_version = TS_VERSION_3;
+		ts_srv_version = TS_VERSION;
 		hb_srv_version = HB_VERSION;
 	}
 
-- 
2.9.3

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ