Populating Hyper-V MSR for Ubuntu 13.10

Bug #1193172 reported by Abhishek Gupta
14
This bug affects 3 people
Affects Status Importance Assigned to Milestone
Linux
Unknown
Unknown
linux (Ubuntu)
Fix Released
High
Tim Gardner
Saucy
Fix Released
High
Tim Gardner
Yakkety
Fix Released
Undecided
Unassigned

Bug Description

For new distribution releases the Hyper-V team is trying to better populate the Hyper-V guest ID. Our specific goal is to identify any given distribution and its release version. With this intent we worked with SUSE to include a patch in their upcoming SLES 11 SP3 release. The patch is available in the following issue:

https://bugzilla.novell.com/show_bug.cgi?id=814005

In case you cannot access the bug then the entire patch is as follows:

--- linux-3.9-rc5-master.orig/drivers/hv/hv.c
+++ linux-3.9-rc5-master/drivers/hv/hv.c
@@ -134,6 +134,8 @@ int hv_init(void)
        int max_leaf;
        union hv_x64_msr_hypercall_contents hypercall_msr;
        void *virtaddr = NULL;
+ __u8 d1 = 0x10; /* SuSE */
+ __u16 d2 = 0x0; /* -d of a.b.c-d */

        memset(hv_context.synic_event_page, 0, sizeof(void *) * NR_CPUS);
        memset(hv_context.synic_message_page, 0,
@@ -148,7 +150,7 @@ int hv_init(void)
        /*
         * Write our OS ID.
         */
- hv_context.guestid = generate_guest_id(0, LINUX_VERSION_CODE, 0);
+ hv_context.guestid = generate_guest_id(d1, LINUX_VERSION_CODE, d2);
        wrmsrl(HV_X64_MSR_GUEST_OS_ID, hv_context.guestid);

        /* See if the hypercall page is already set */

We request you to include the same patch for Ubuntu 13.10 with the below modifications:

1. In place of __u8 d1 = 0x10; /* SuSE */ we would request you to add the following line:
__u8 d1 = 0x80; /* Canonical */

2. In place of __u16 d2 = 0x0; /* -d of a.b.c-d */ we would request you to add the correct ‘-d’ of the Linux kernel version for Ubuntu 13.10
__u16 d2 = 0x0; /* -d of a.b.c-d */

For Ubuntu 13.10, I noticed that uname –r returns “3.9.0-6-generic”. We would like to populate d2 with 6. It would be best if you guys could automate the process of populating that string.

CVE References

Abhishek Gupta (abgupta)
summary: - Populating Hyper-V MSR
+ Populating Hyper-V MSR for Ubuntu 13.10
Revision history for this message
Brad Figg (brad-figg) wrote : Missing required logs.

This bug is missing log files that will aid in diagnosing the problem. From a terminal window please run:

apport-collect 1193172

and then change the status of the bug to 'Confirmed'.

If, due to the nature of the issue you have encountered, you are unable to run this command, please add a comment stating that fact and change the bug status to 'Confirmed'.

This change has been made by an automated script, maintained by the Ubuntu Kernel Team.

Changed in linux (Ubuntu):
status: New → Incomplete
tags: added: saucy
Revision history for this message
Abhishek Gupta (abgupta) wrote :

No logs are needed because this is not a defect. It is just additional code. Confirmed.

Changed in linux (Ubuntu):
status: Incomplete → Confirmed
Jeremy Stanley (fungi)
no longer affects: git-review
Changed in linux (Ubuntu):
importance: Undecided → Medium
tags: added: bot-stop-nagging
tags: added: kernel-da-key
penalvch (penalvch)
tags: added: patch
Revision history for this message
Ben Howard (darkmuggle-deactivatedaccount) wrote :

Raising priority. MS has indicated this is a critical need for 13.10.

Changed in linux (Ubuntu):
importance: Medium → High
Tim Gardner (timg-tpi)
Changed in linux (Ubuntu Saucy):
assignee: nobody → Tim Gardner (timg-tpi)
status: Confirmed → In Progress
Revision history for this message
Tim Gardner (timg-tpi) wrote :
Revision history for this message
Tim Gardner (timg-tpi) wrote :
Changed in linux (Ubuntu Saucy):
status: In Progress → Fix Committed
Revision history for this message
Tim Gardner (timg-tpi) wrote :

abgupta - what is the intended use for this information ?

Revision history for this message
Abhishek Gupta (abgupta) wrote :

There are two purposes:

a) It will help in Azure billing because now we can know what distribution of Linux we are running.
b) It helps us identify prominent distributions which in turn allows us to ensure that drivers are readily available in such distributions.

Please let me know if you need more information.
Thanks,
Abhishek

Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package linux - 3.10.0-5.15

---------------
linux (3.10.0-5.15) saucy; urgency=low

  [ Andy Whitcroft ]

  * [Config] add iwldvm to nic-modules
    - LP: #1204194

  [ Tim Gardner ]

  * [Debian] Supply PKG_ABI in kmake
    - LP: #1193172
  * SAUCE: (no-up) hv: Supply vendor ID and package ABI
    - LP: #1193172

  [ Upstream Kernel Changes ]

  * efivars: check for EFI_RUNTIME_SERVICES
    - LP: #1200570
  * drm/radeon/hdmi: make sure we have an afmt block assigned
  * Input: elantech - fix for newer hardware versions (v7)
    - LP: #1166442
 -- Tim Gardner <email address hidden> Tue, 23 Jul 2013 07:42:49 -0600

Changed in linux (Ubuntu Saucy):
status: Fix Committed → Fix Released
Revision history for this message
Kleber Sacilotto de Souza (kleber-souza) wrote :

This bug is awaiting verification that the kernel in -proposed solves the problem. Please test the kernel and update this bug with the results. If the problem is solved, change the tag 'verification-needed-yakkety' to 'verification-done-yakkety'. If the problem still exists, change the tag 'verification-needed-yakkety' to 'verification-failed-yakkety'.

If verification is not done by 5 working days from today, this fix will be dropped from the source code, and this bug will be closed.

See https://wiki.ubuntu.com/Testing/EnableProposed for documentation how to enable and use -proposed. Thank you!

tags: added: verification-needed-yakkety
Revision history for this message
Kleber Sacilotto de Souza (kleber-souza) wrote :

This patch was reverted and re-applied on Yakkety kernel in order to facilitate the backport for another feature request (bug #1676635). Therefore, verification is not needed again for Yakkety.

tags: removed: verification-needed-yakkety
Andy Whitcroft (apw)
tags: added: verification-done-yakkety
Revision history for this message
Launchpad Janitor (janitor) wrote :
Download full text (4.3 KiB)

This bug was fixed in the package linux - 4.8.0-54.57

---------------
linux (4.8.0-54.57) yakkety; urgency=low

  * linux: 4.8.0-54.57 -proposed tracker (LP: #1692589)

  * CVE-2017-0605
    - tracing: Use strlcpy() instead of strcpy() in __trace_find_cmdline()

  * Populating Hyper-V MSR for Ubuntu 13.10 (LP: #1193172)
    - SAUCE: (no-up) hv: Supply vendor ID and package ABI

  * [Hyper-V] Implement Hyper-V PTP Source (LP: #1676635)
    - hv: allocate synic pages for all present CPUs
    - hv: init percpu_list in hv_synic_alloc()
    - Drivers: hv: vmbus: Prevent sending data on a rescinded channel
    - hv: switch to cpuhp state machine for synic init/cleanup
    - hv: make CPU offlining prevention fine-grained
    - Drivers: hv: vmbus: Fix a rescind handling bug
    - Drivers: hv: util: kvp: Fix a rescind processing issue
    - Drivers: hv: util: Fcopy: Fix a rescind processing issue
    - Drivers: hv: util: Backup: Fix a rescind processing issue
    - Drivers: hv: vmbus: Move the definition of hv_x64_msr_hypercall_contents
    - Drivers: hv: vmbus: Move the definition of generate_guest_id()
    - Revert "UBUNTU: SAUCE: (no-up) hv: Supply vendor ID and package ABI"
    - Drivers: hv vmbus: Move Hypercall page setup out of common code
    - Drivers: hv: vmbus: Move Hypercall invocation code out of common code
    - Drivers: hv: vmbus: Consolidate all Hyper-V specific clocksource code
    - Drivers: hv: vmbus: Move the extracting of Hypervisor version information
    - Drivers: hv: vmbus: Move the crash notification function
    - Drivers: hv: vmbus: Move the check for hypercall page setup
    - Drivers: hv: vmbus: Move the code to signal end of message
    - Drivers: hv: vmbus: Restructure the clockevents code
    - Drivers: hv: util: Use hv_get_current_tick() to get current tick
    - Drivers: hv: vmbus: Get rid of an unsused variable
    - Drivers: hv: vmbus: Define APIs to manipulate the message page
    - Drivers: hv: vmbus: Define APIs to manipulate the event page
    - Drivers: hv: vmbus: Define APIs to manipulate the synthetic interrupt
      controller
    - Drivers: hv: vmbus: Define an API to retrieve virtual processor index
    - Drivers: hv: vmbus: Define an APIs to manage interrupt state
    - Drivers: hv: vmbus: Cleanup hyperv_vmbus.h
    - hv_util: switch to using timespec64
    - Drivers: hv: restore hypervcall page cleanup before kexec
    - Drivers: hv: restore TSC page cleanup before kexec
    - Drivers: hv: balloon: add a fall through comment to hv_memory_notifier()
    - Drivers: hv: vmbus: Use all supported IC versions to negotiate
    - Drivers: hv: Log the negotiated IC versions.
    - Drivers: hv: Fix the bug in generating the guest ID
    - hv: export current Hyper-V clocksource
    - hv_utils: implement Hyper-V PTP source
    - SAUCE: (no-up) hv: Supply vendor ID and package ABI

  * CIFS: Enable encryption for SMB3 (LP: #1670508)
    - SMB3: Add mount parameter to allow user to override max credits
    - SMB2: Separate Kerberos authentication from SMB2_sess_setup
    - SMB2: Separate RawNTLMSSP authentication from SMB2_sess_setup
    - SMB3: parsing for new snapshot timestamp mount parm
    - cifs: Simplify SMB...

Read more...

Changed in linux (Ubuntu Yakkety):
status: New → Fix Released
status: New → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.