virt: Support detection for ARM64 Hyper-V guests (fixed upstream)

Bug #1952599 reported by Gauthier Jolly
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
systemd (Ubuntu)
Fix Released
Undecided
Lukas Märdian
Bionic
Fix Released
Undecided
Unassigned
Focal
Fix Released
Undecided
Unassigned
Hirsute
Won't Fix
Undecided
Unassigned
Impish
Fix Released
Undecided
Unassigned
Jammy
Fix Released
Undecided
Lukas Märdian

Bug Description

[Impact]

 * The detection of Microsoft Hyper-V VMs is done by cpuid currently,
however there is no cpuid on ARM64. And since ARM64 is now a supported
architecture for Microsoft Hyper-V guests[0], then introduce a more
generic way to detect whether a guest is running as a Hyper-V guest: check
if /sys/class/dmi/id/product_version starts with "Hyper-V".

 * This bug has already been fixed upstream[1][2]

[Test Plan]

 * While changes have been made in the kernel for ARM64 on Hyper-V, there is no way to start an ARM64 VM on Hyper-V at the moment. Thus we just want to make sure no regression is introduced.

 * start an Hyper-V amd64 VM and make sure "systemd-detect-virt" still return MSFT (should still rely on cpuid here)

[Where problems could occur]

 * The main risk is for the system to detect Hyper-V virt erroneously. An issue was reported upstream after the first commit was merged[3]. For this reason, systemd is now looking for "Hyper-V" (in /sys/class/dmi/id/product_version) and not "Microsoft" (in /sys/class/dmi/id/bios_vendor)

 * This change might also break virt detection on hyper-v AMD64. That's why we need testing. However, AMD64 virt detection should still rely on cpuid instead of DMI as cpuid takes priority over DMI.

[0] https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=7aff79e297ee1aa0126924921fd87a4ae59d2467
[1] https://github.com/systemd/systemd/pull/20998/files
[2] https://github.com/systemd/systemd/pull/21475/files
[3] https://github.com/systemd/systemd/issues/21468

CVE References

Lukas Märdian (slyon)
tags: added: fr-1886
Lukas Märdian (slyon)
Changed in systemd (Ubuntu Jammy):
assignee: nobody → Lukas Märdian (slyon)
Revision history for this message
Launchpad Janitor (janitor) wrote :
Download full text (13.8 KiB)

This bug was fixed in the package systemd - 249.5-2ubuntu1

---------------
systemd (249.5-2ubuntu1) jammy; urgency=medium

  * Merge to Ubuntu from Debian unstable
    - Dropped changes (applied upstream):
      + UBUNTU-units-disable-journald-watchdog.patch
      + test-Allow-running-only-a-subset-of-integration-tests-by-.patch
      + hwdb-Add-ProBook-to-use-micmute-hotkey.patch
      + d/p/lp1931578/*.patch (ActivationPolicy=)
      + lp1932352-hwdb-Add-mic-mute-key-mapping-for-HP-Elite-Dragonfly.patch
      + d/p/lp1858210/*.patch (tzdata.zi)
      + lp1914740-network-enable-DHCP-broadcast-flag-if-required-by-in.patch
      + lp1934981-correct-suspend-then-sleep-string.patch
      + CVE-2020-13529.patch
      + CVE-2021-33910.patch
      + Merge-pull-request-20199-from-ddstreet-unit_cgroup_catchu.patch
      + udev-fix-slot-based-network-names-on-s390.patch
      + udev-add-missing-initialization-to-fix-freeing-invalid-ad.patch
      + udev-allow-onboard-index-up-to-65535.patch
      + lp1940635.patch (networkd failed to acquire a DHCP6 lease, v249.5)
  * debian/gbp.conf: Update debian-branch to ubuntu-jammy
    File: debian/gbp.conf
    https://git.launchpad.net/~ubuntu-core-dev/ubuntu/+source/systemd/commit/?id=f35b4d6c0653c3125b2e0e5d962f84543733c3c0
  * Refresh Ubuntu-UseDomains-by-default.patch
    File: debian/patches/debian/Ubuntu-UseDomains-by-default.patch
    https://git.launchpad.net/~ubuntu-core-dev/ubuntu/+source/systemd/commit/?id=6e3b2ffb1c2c2bf2223f91b350c1fd06b8903346
  * Refresh UBUNTU-test-test-functions-launch-qemu-with-vga-none.patch
    File: debian/patches/debian/UBUNTU-test-test-functions-launch-qemu-with-vga-none.patch
    https://git.launchpad.net/~ubuntu-core-dev/ubuntu/+source/systemd/commit/?id=7142fb9381ab98d750a7c2473087ea7264be860d
  * Refresh UBUNTU-Revert-cgroup-Continue-unit-reset-if-cgroup-is-busy.patch
    File: debian/patches/debian/UBUNTU-Revert-cgroup-Continue-unit-reset-if-cgroup-is-busy.patch
    https://git.launchpad.net/~ubuntu-core-dev/ubuntu/+source/systemd/commit/?id=3de0f444bfc0cf3b601c4a1ad8939d2cd69cdad6
  * Refresh UBUNTU-resolved-default-no-negative-caching.patch
    File: debian/patches/debian/UBUNTU-resolved-default-no-negative-caching.patch
    https://git.launchpad.net/~ubuntu-core-dev/ubuntu/+source/systemd/commit/?id=d7b25651ea7ceae2ebfeafb84d9d65fb8284367a
  * Refresh Revert-network-if-sys-is-rw-then-udev-should-be-around.patch
    File: debian/patches/Revert-network-if-sys-is-rw-then-udev-should-be-around.patch
    https://git.launchpad.net/~ubuntu-core-dev/ubuntu/+source/systemd/commit/?id=61b004d7710b305d9996b3ad9bb47dc372fcbbac
  * Refresh UBUNTU-src-test-testmount-util.c-Skip-parts-of-test-mount-util-in-LXC.patch
    File: debian/patches/debian/UBUNTU-src-test-testmount-util.c-Skip-parts-of-test-mount-util-in-LXC.patch
    https://git.launchpad.net/~ubuntu-core-dev/ubuntu/+source/systemd/commit/?id=5fe343a0fc89771820f997c2d6621ac517d9070f
  * Refresh Merge-pull-request-20705-from-yuwata-test-oomd-util.patch
    File: debian/patches/Merge-pull-request-20705-from-yuwata-test-oomd-util.patch
    https://git.launchpad.net/~ubuntu-core-dev/ubuntu/+source/systemd/commit/?id=e88125...

Changed in systemd (Ubuntu Jammy):
status: New → Fix Released
Revision history for this message
Łukasz Zemczak (sil2100) wrote : Please test proposed package

Hello Gauthier, or anyone else affected,

Accepted systemd into impish-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/systemd/248.3-1ubuntu8.1 in a few hours, and then in the -proposed repository.

Please help us by testing this new package. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation on how to enable and use -proposed. Your feedback will aid us getting this update out to other Ubuntu users.

If this package fixes the bug for you, please add a comment to this bug, mentioning the version of the package you tested, what testing has been performed on the package and change the tag from verification-needed-impish to verification-done-impish. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed-impish. In either case, without details of your testing we will not be able to proceed.

Further information regarding the verification process can be found at https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . Thank you in advance for helping!

N.B. The updated package will be released to -updates after the bug(s) fixed by this package have been verified and the package has been in -proposed for a minimum of 7 days.

Changed in systemd (Ubuntu Impish):
status: New → Fix Committed
tags: added: verification-needed verification-needed-impish
Revision history for this message
Łukasz Zemczak (sil2100) wrote :

Hello Gauthier, or anyone else affected,

Accepted systemd into focal-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/systemd/245.4-4ubuntu3.14 in a few hours, and then in the -proposed repository.

Please help us by testing this new package. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation on how to enable and use -proposed. Your feedback will aid us getting this update out to other Ubuntu users.

If this package fixes the bug for you, please add a comment to this bug, mentioning the version of the package you tested, what testing has been performed on the package and change the tag from verification-needed-focal to verification-done-focal. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed-focal. In either case, without details of your testing we will not be able to proceed.

Further information regarding the verification process can be found at https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . Thank you in advance for helping!

N.B. The updated package will be released to -updates after the bug(s) fixed by this package have been verified and the package has been in -proposed for a minimum of 7 days.

Changed in systemd (Ubuntu Focal):
status: New → Fix Committed
tags: added: verification-needed-focal
Revision history for this message
Łukasz Zemczak (sil2100) wrote :

Hello Gauthier, or anyone else affected,

Accepted systemd into bionic-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/systemd/237-3ubuntu10.53 in a few hours, and then in the -proposed repository.

Please help us by testing this new package. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation on how to enable and use -proposed. Your feedback will aid us getting this update out to other Ubuntu users.

If this package fixes the bug for you, please add a comment to this bug, mentioning the version of the package you tested, what testing has been performed on the package and change the tag from verification-needed-bionic to verification-done-bionic. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed-bionic. In either case, without details of your testing we will not be able to proceed.

Further information regarding the verification process can be found at https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . Thank you in advance for helping!

N.B. The updated package will be released to -updates after the bug(s) fixed by this package have been verified and the package has been in -proposed for a minimum of 7 days.

Changed in systemd (Ubuntu Bionic):
status: New → Fix Committed
tags: added: verification-needed-bionic
Revision history for this message
Ubuntu SRU Bot (ubuntu-sru-bot) wrote : Autopkgtest regression report (systemd/237-3ubuntu10.53)

All autopkgtests for the newly accepted systemd (237-3ubuntu10.53) for bionic have finished running.
The following regressions have been reported in tests triggered by the package:

openssh/1:7.6p1-4ubuntu0.5 (armhf)
linux-hwe-5.0/5.0.0-65.71 (armhf)

Please visit the excuses page listed below and investigate the failures, proceeding afterwards as per the StableReleaseUpdates policy regarding autopkgtest regressions [1].

https://people.canonical.com/~ubuntu-archive/proposed-migration/bionic/update_excuses.html#systemd

[1] https://wiki.ubuntu.com/StableReleaseUpdates#Autopkgtest_Regressions

Thank you!

Revision history for this message
Ubuntu SRU Bot (ubuntu-sru-bot) wrote : Autopkgtest regression report (systemd/248.3-1ubuntu8.1)

All autopkgtests for the newly accepted systemd (248.3-1ubuntu8.1) for impish have finished running.
The following regressions have been reported in tests triggered by the package:

dpdk/20.11.3-0ubuntu1 (armhf)
casper/1.465 (amd64)
diaspora-installer/0.7.15.0+debian1 (s390x, armhf)
libvirt-dbus/1.4.0-2ubuntu1 (amd64)
exim4/4.94.2-7ubuntu2 (armhf)
dovecot/1:2.3.13+dfsg1-1ubuntu3 (armhf)
udisks2/2.9.4-1 (arm64)
systemd/248.3-1ubuntu8.1 (amd64)

Please visit the excuses page listed below and investigate the failures, proceeding afterwards as per the StableReleaseUpdates policy regarding autopkgtest regressions [1].

https://people.canonical.com/~ubuntu-archive/proposed-migration/impish/update_excuses.html#systemd

[1] https://wiki.ubuntu.com/StableReleaseUpdates#Autopkgtest_Regressions

Thank you!

Revision history for this message
Gauthier Jolly (gjolly) wrote :
Download full text (4.5 KiB)

Hi there,

I used this[0] script to test the different series. The most relevant parts of it are those parameters for qemu:

-smbios type=0,vendor='Hyper-V test',version=1.2.3 \
-smbios type=1,manufacturer=t1manufacturer,product=t1product,version=t1version,serial=t1serial,uuid=11111111-1111-1111-1111-111111111111,sku=t1sku,family=t1family \

You can read more about them here[1]. In short, it configures the DMI table as follows:

ubuntu@impish:~$ cat /sys/class/dmi/id/product_name
t1product
ubuntu@impish:~$ cat /sys/class/dmi/id/sys_vendor
t1manufacturer
ubuntu@impish:~$ cat /sys/class/dmi/id/bios_vendor
Hyper-V test
ubuntu@impish:~$ cat /sys/class/dmi/id/product_version
t1version

Thus, the old systemd should not detect any virt ("none") and the new one should detect "microsoft"[2].

Test results:

Bionic
======

ubuntu@bionic:~$ dpkg -l systemd ; systemd-detect-virt
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
||/ Name Version Architecture Description
+++-======================================================-================================-================================-=================================================================================================================
ii systemd 237-3ubuntu10.52 arm64 system and service manager
none
ubuntu@bionic:~$ sudo apt-get install -y systemd
...
ubuntu@bionic:~$ dpkg -l systemd ; systemd-detect-virt
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
||/ Name Version Architecture Description
+++-======================================================-================================-================================-=================================================================================================================
ii systemd 237-3ubuntu10.53 arm64 system and service manager
microsoft

Focal
=====

ubuntu@focal:~$ dpkg -l systemd ; systemd-detect-virt
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
||/ Name Version Architecture Description
+++-==============-=================-============-=================================
ii systemd 245.4-4ubuntu3.13 arm64 system and service manager
none
ubuntu@focal:~$ sudo apt-get install -y systemd
...
ubuntu@focal:~$ dpkg -l systemd ; systemd-detect-virt
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
||/ Name ...

Read more...

tags: added: verification-done-bionic verification-done-focal verification-done-impish
removed: verification-needed-bionic verification-needed-focal verification-needed-impish
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package systemd - 248.3-1ubuntu8.1

---------------
systemd (248.3-1ubuntu8.1) impish; urgency=medium

  [ Lukas Märdian ]
  * Cherry-pick upstream 5ed0ea: hwdb: 60-keyboard:: Update Dell Privacy Local Mic Mute Hotkey (LP: #1926547)
    File: debian/patches/hwdb-60-keyboard-Update-Dell-Privacy-Local-Mic-Mute-Hotke.patch
    https://git.launchpad.net/~ubuntu-core-dev/ubuntu/+source/systemd/commit/?id=041be812ac5c204ad09830dc796ebdb0d6d0894a
  * Support detection for ARM64 Hyper-V guests (LP: #1952599)
    Files:
    - debian/patches/lp1952599/0001-virt-Support-detection-for-ARM64-Hyper-V-guests.patch
    - debian/patches/lp1952599/0002-virt-Fix-the-detection-for-Hyper-V-VMs.patch
    https://git.launchpad.net/~ubuntu-core-dev/ubuntu/+source/systemd/commit/?id=5060ac86698b206459cef42daa84499781147378

  [ Andy Chi ]
  * Add privacy micmute hotkey for Dell machine. (LP: #1952733)
    File: debian/patches/lp1952733-hwdb-60-keyboard-Update-Dell-Privacy-Micmute-Hotkey-Map.patch
    https://git.launchpad.net/~ubuntu-core-dev/ubuntu/+source/systemd/commit/?id=f74b782d3ceb01d76c7bffdce7502763dd540150
  * Add microphone mute key for Dell machine. (LP: #1952735)
    File: debian/patches/lp1952735-keymap-Add-microphone-mute-keymap-for-Dell-Machine.patch
    https://git.launchpad.net/~ubuntu-core-dev/ubuntu/+source/systemd/commit/?id=03c117092c1a32b5db025613d328add54bef3718

  [ Yao Wei ]
  * Add ACCEL_LOCATION=base property for Dell clamshell models (LP: #1943561)
    Files:
    - debian/patches/lp1943561/Add-additional-Dell-models-that-require-ACCEL_LOCATION-ba.patch
    - debian/patches/lp1943561/Use-SKU-to-identify-Dell-clamshell-models-for-acceleromet.patch
    https://git.launchpad.net/~ubuntu-core-dev/ubuntu/+source/systemd/commit/?id=b6b30ad3d9ef862d30f397ba481fe4f647751c99

 -- Lukas Märdian <email address hidden> Fri, 10 Dec 2021 09:56:36 +0100

Changed in systemd (Ubuntu Impish):
status: Fix Committed → Fix Released
Revision history for this message
Brian Murray (brian-murray) wrote : Update Released

The verification of the Stable Release Update for systemd has completed successfully and the package is now being released to -updates. Subsequently, the Ubuntu Stable Release Updates Team is being unsubscribed and will not receive messages about this bug report. In the event that you encounter a regression using the package from -updates please report a new bug using ubuntu-bug and tag the bug report regression-update so we can easily find any regressions.

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

This bug was fixed in the package systemd - 245.4-4ubuntu3.14

---------------
systemd (245.4-4ubuntu3.14) focal; urgency=medium

  [ Lukas Märdian ]
  * Allow target units to fail (LP: #1948476)
    File: d/p/lp1948476-pid1-target-units-can-fail-through-dependencies.patch
    https://git.launchpad.net/~ubuntu-core-dev/ubuntu/+source/systemd/commit/?id=fe0cb0bd66baea89d8bbe47cb47d88540f46d470
  * Fix whitespace in lp1926547-hwdb-60-keyboard-Update-Dell-Privacy-Micmute-Hotkey-.patch to match upstream
    File: debian/patches/lp1926547-hwdb-60-keyboard-Update-Dell-Privacy-Micmute-Hotkey-.patch
    https://git.launchpad.net/~ubuntu-core-dev/ubuntu/+source/systemd/commit/?id=80fef80a1b018556939011707c4ce00cebc58806
  * Support detection for ARM64 Hyper-V guests (LP: #1952599)
    Files:
    - debian/patches/lp1952599/0001-virt-Support-detection-for-ARM64-Hyper-V-guests.patch
    - debian/patches/lp1952599/0002-virt-Fix-the-detection-for-Hyper-V-VMs.patch
    https://git.launchpad.net/~ubuntu-core-dev/ubuntu/+source/systemd/commit/?id=caf3aff933cc7bf21565faba05f78ce78b3196cd

  [ Andy Chi ]
  * Add privacy micmute hotkey for Dell machine. (LP: #1952733)
    File: debian/patches/lp1952733-hwdb-60-keyboard-Update-Dell-Privacy-Micmute-Hotkey-Map.patch
    https://git.launchpad.net/~ubuntu-core-dev/ubuntu/+source/systemd/commit/?id=ff8dc41f55baa418076e42509ddbf3212a8c1353
  * Add microphone mute key for Dell machine. (LP: #1952735)
    File: debian/patches/lp1952735-keymap-Add-microphone-mute-keymap-for-Dell-Machine.patch
    https://git.launchpad.net/~ubuntu-core-dev/ubuntu/+source/systemd/commit/?id=175fb4e209fba889b4bcd81cb2ed262923943a3f

  [ Yao Wei ]
  * Add ACCEL_LOCATION=base property for 6 Dell clamshell models (LP: #1943561)
    File: debian/patches/lp1943561-dell-clamshell-accel-location-base-with-sku.patch
    https://git.launchpad.net/~ubuntu-core-dev/ubuntu/+source/systemd/commit/?id=246195d68b2bb0473f4a3f1c2ebe54dfd37f068b

  [ Dan Streetman ]
  * d/p/lp1944711-login-filenames-in-run-systemd-users-are-uids.patch:
    Fix systemd-logind restart loading of existing sessions
    (LP: #1944711)

  [ Ratchanan Srirattanamet ]
  * d/p/debian/timedatectl-lp1650688.patch,
    d/p/debian/UBUNTU-Fix-timezone-setting-on-read-only-etc.patch:
    Fix timedated unable to retrieve & properly set timezone on
    read-only /etc (e.g. Ubuntu Core and system-image-based systems)
    (LP: #1650688)

 -- Lukas Märdian <email address hidden> Fri, 10 Dec 2021 10:04:02 +0100

Changed in systemd (Ubuntu Focal):
status: Fix Committed → Fix Released
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package systemd - 237-3ubuntu10.53

---------------
systemd (237-3ubuntu10.53) bionic; urgency=medium

  [ Ratchanan Srirattanamet ]
  * d/p/debian/timedatectl-lp1650688.patch,
    d/p/debian/UBUNTU-Fix-timezone-setting-on-read-only-etc.patch:
    Fix timedated unable to retrieve & properly set timezone on
    read-only /etc (e.g. Ubuntu Core and system-image-based systems)
    (LP: #1650688)

  [ Lukas Märdian ]
  * Support detection for ARM64 Hyper-V guests (LP: #1952599)

 -- Lukas Märdian <email address hidden> Fri, 10 Dec 2021 10:15:49 +0100

Changed in systemd (Ubuntu Bionic):
status: Fix Committed → Fix Released
Revision history for this message
Lukas Märdian (slyon) wrote :

We cannot prepare & verify an SRU for Hirsute within the two weeks left before EOL, so I'm marking this task wontfix.

Changed in systemd (Ubuntu Hirsute):
status: New → Won't Fix
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.