[kvm] change check_enabled to /dev/kvm

Bug #1883320 reported by Eric Desrochers on 2020-06-12
12
This bug affects 1 person
Affects Status Importance Assigned to Milestone
sosreport (Ubuntu)
Status tracked in Groovy
Xenial
Undecided
Unassigned
Bionic
Medium
Eric Desrochers
Eoan
Medium
Eric Desrochers
Focal
Medium
Eric Desrochers
Groovy
Medium
Eric Desrochers

Bug Description

[Impact]

The KVM plugin get triggered in a container
(e.g lxd) because of "/sys/module/kvm"
inheritance from the kernel host.

Not only it's a waste of sosreport time,
but running it inside a container may
unintentionally reveal details from its
host. Which is a undesired behaviour.

Switching to /dev/kvm, is more appropriate
and follow current standard as used by tool
such as cpu-checker (kvm-ok) for instance.

And taking benefit of this change to get rid
of the check_enabled() overwrite in favour of
using "files=" trigger.

[Test Case]

* Run sosreport inside a LXD container
* The container will contain KVM information from its host (Iff its host as KVM installed)

[Regression Potential]

We only change the way the plugin gets triggered to use a most conventional way.

If /dev/kvm exist, then exercise the kvm plugin.

No regression expected, but worse case scenario, it will only be isolated and impact the KVM plugin to collect data properly as expected.

It won't cause any harm to others plugins nor sosreport core functionalities itself.

The commit went through some upstream Travis testing which used a shell script called "simple.sh" to verify sosreport collection.

BTW, this same exact script is part of the sosreport autopkgtest, and will be run as part of the SRU to push this change.

[Other Information]

* Upstream bug:
https://github.com/sosreport/sos/issues/2062

* Upstream commit:
https://github.com/sosreport/sos/pull/2063/commits/dc58a038c18ff3e838d883d4b31aad5dac7ea9e1

Eric Desrochers (slashd) on 2020-06-12
tags: added: seg sts
Changed in sosreport (Ubuntu):
assignee: nobody → Eric Desrochers (slashd)
status: New → In Progress
Eric Desrochers (slashd) on 2020-06-12
description: updated
description: updated
Eric Desrochers (slashd) wrote :

Fixed in Groovy's sosreport (3.9.1-1ubuntu1) uploaded earlier today.

  * New 3.9.1 upstream release. (LP: #1884293)
    This maintenance release includes:
    - New plugins: sos_extras, ovirt_engine_backup, console,
      validation_framework.
    - lxd plugin collections have been overhauled.
    - Fixed handling of the namespace pattern for the networking
      plugin.
    - A basic path is now defined in Policy for all subclasses.

    Plugin API Enhancements:
    - Enablement checks have been extended to include architecture
      constraints.
    - SoSPredicate has been extended to include architecture constraints,
      as well as negative constraints for all elements.
    - Plugins will now capture service status information for all services
      defined in the services class attr.

    Further release information and tarballs are available at:
    - https://github.com/sosreport/sos/releases/tag/3.9.1

  * Former patches now fixed upstream:
    - d/p/0001-unittest-py3-fix.patch
    - d/p/0002-lxd-drop-db-collection-and-introduce-lxd-buginfo.patch

  * Other specific modifications:
    - d/p/0001-lshw-command.patch
    - d/p/0002-lds-substitute-oidc-conf.patch
==> - d/p/0003-kvm-change-trigger-to-dev-kvm.patch <==

Changed in sosreport (Ubuntu Groovy):
status: In Progress → Fix Released
Changed in sosreport (Ubuntu Focal):
status: New → In Progress
assignee: nobody → Eric Desrochers (slashd)
importance: Undecided → Medium
Eric Desrochers (slashd) on 2020-06-21
Changed in sosreport (Ubuntu Bionic):
status: New → In Progress
Changed in sosreport (Ubuntu Eoan):
status: New → In Progress
assignee: nobody → Eric Desrochers (slashd)
Changed in sosreport (Ubuntu Bionic):
assignee: nobody → Eric Desrochers (slashd)
Changed in sosreport (Ubuntu Groovy):
importance: Undecided → Medium
Changed in sosreport (Ubuntu Eoan):
importance: Undecided → Medium
Changed in sosreport (Ubuntu Bionic):
importance: Undecided → Medium

Hello Eric, or anyone else affected,

Accepted sosreport into focal-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/sosreport/3.9.1-1ubuntu0.20.04.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-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 sosreport (Ubuntu Focal):
status: In Progress → Fix Committed
tags: added: verification-needed verification-needed-focal
Changed in sosreport (Ubuntu Eoan):
status: In Progress → Fix Committed
tags: added: verification-needed-eoan
Łukasz Zemczak (sil2100) wrote :

Hello Eric, or anyone else affected,

Accepted sosreport into eoan-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/sosreport/3.9.1-1ubuntu0.19.10.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-eoan to verification-done-eoan. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed-eoan. 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.

Łukasz Zemczak (sil2100) wrote :

Hello Eric, or anyone else affected,

Accepted sosreport into bionic-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/sosreport/3.9.1-1ubuntu0.18.04.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-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 sosreport (Ubuntu Bionic):
status: In Progress → Fix Committed
tags: added: verification-needed-bionic

All autopkgtests for the newly accepted sosreport (3.9.1-1ubuntu0.18.04.1) for bionic have finished running.
The following regressions have been reported in tests triggered by the package:

sosreport/3.9.1-1ubuntu0.18.04.1 (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#sosreport

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

Thank you!

Eric Desrochers (slashd) wrote :

[VERIFICATION BIONIC]

Test with sosreport: 3.9.1-1ubuntu0.18.04.1

* Running sosreport from for instance an LXD container, no longer reveal KVM details from its host as it was previously (if KVM was installed at the host level):

 ** ls -altr sos_commands/kvm
ls: cannot access 'sos_commands/kvm': No such file or directory

* Running sosreport from a system with KVM installed does triggers the KVM plugin as it should and the data is accurate and as expected.

* sos_logs/sos.log:
sos.log:2020-06-23 17:37:44,340 INFO: [plugin:kvm] collecting path '/sys/module/kvm/srcversion'
sos.log:2020-06-23 17:37:44,341 INFO: [plugin:kvm] collecting path '/sys/module/kvm_intel/srcversion'
sos.log:2020-06-23 17:37:44,341 INFO: [plugin:kvm] collecting output of 'kvm_stat --once'

# ls -altr sos_commands/kvm/
total 20
-rw-r--r-- 1 root root 8568 Jun 23 17:42 kvm_stat_--once

Eric Desrochers (slashd) wrote :

[VERIFICATION FOCAL]

Test with sosreport: 3.9.1-1ubuntu0.20.04.1

* Running sosreport from for instance an LXD container, no longer reveal KVM details from its host as it was previously (if KVM was installed at the host level):

 ** ls -altr sos_commands/kvm
ls: cannot access 'sos_commands/kvm': No such file or directory

* Running sosreport from a system with KVM installed does triggers the KVM plugin as it should and the data is accurate and as expected.

* sos_logs/sos.log:
INFO: [plugin:kvm] collecting path '/sys/module/kvm/srcversion'
INFO: [plugin:kvm] collecting path '/sys/module/kvm_intel/srcversion'
INFO: [plugin:kvm] collecting output of 'kvm_stat --once'

# ls sos_commands/kvm/
total 20
kvm_stat_--once

Eric Desrochers (slashd) wrote :

[VERIFICATION EOAN]

Test with sosreport: 3.9.1-1ubuntu0.19.10.1

* Running sosreport from for instance an LXD container, no longer reveal KVM details from its host as it was previously (if KVM was installed at the host level):

 ** ls -altr sos_commands/kvm
ls: cannot access 'sos_commands/kvm': No such file or directory

* Running sosreport from a system with KVM installed does triggers the KVM plugin as it should and the data is accurate and as expected.

* sos_logs/sos.log:
INFO: [plugin:kvm] collecting path '/sys/module/kvm/srcversion'
INFO: [plugin:kvm] collecting path '/sys/module/kvm_intel/srcversion'
INFO: [plugin:kvm] collecting output of 'kvm_stat --once'

# ls sos_commands/kvm/
total 20
kvm_stat_--once

tags: added: verification-done verification-done-bionic verification-done-eoan verification-done-focal
removed: verification-needed verification-needed-bionic verification-needed-eoan verification-needed-focal
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers