Bugzilla will be upgraded to version 5.0. The upgrade date is tentatively scheduled for 2 December 2018, pending final testing and feedback.
Bug 1333159 - qemu-kvm doesn't reload udev rules before triggering for kvm device
qemu-kvm doesn't reload udev rules before triggering for kvm device
Status: CLOSED ERRATA
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: qemu-kvm (Show other bugs)
7.2
All All
medium Severity medium
: rc
: ---
Assigned To: Miroslav Rezanina
FuXiangChun
:
Depends On:
Blocks: 1338755
  Show dependency treegraph
 
Reported: 2016-05-04 15:32 EDT by Olimp Bockowski
Modified: 2016-11-03 16:13 EDT (History)
13 users (show)

See Also:
Fixed In Version: qemu-kvm-1.5.3-114.el7
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
: 1338755 (view as bug list)
Environment:
Last Closed: 2016-11-03 16:13:06 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)


External Trackers
Tracker ID Priority Status Summary Last Updated
Red Hat Product Errata RHSA-2016:2585 normal SHIPPED_LIVE Moderate: qemu-kvm security, bug fix, and enhancement update 2016-11-03 08:09:03 EDT

  None (edit)
Description Olimp Bockowski 2016-05-04 15:32:33 EDT
Description of problem:

qemu-kvm(-rhev) package does not call "udevadm control --reload-rules" before triggering for kvm device
a rule setting /dev/kvm ownership and permsions is missed while installing qemu-kvm-rhev package


Version-Release number of selected component (if applicable):
qemu-kvm 1.5.3
qemu-kvm-rhev 2.3.0

How reproducible:

every time

Steps to Reproduce:

yum remove qemu-kvm-rhev
rmmod kvm_intel kvm ixgbe ; modprobe kvm_intel ; modprobe ixgbe
ls -l /dev/kvm
  crw-------. 1 root root 10, 232 26.4. 13:10 /dev/kvm
./sriov.sh ; yum install -y qemu-kvm-rhev
  Creating maximum number of SR-IOV VF insterfaces for the PCI device 0000:87:00.1
  Creating maximum number of SR-IOV VF insterfaces for the PCI device 0000:87:00.0
ls -l /dev/kvm
  crw-------. 1 root root 10, 232 26.4. 13:11 /dev/kvm
yum remove qemu-kvm-rhev
yum install -y qemu-kvm-rhev
ls -l /dev/kvm
  crw-rw-rw-. 1 root kvm 10, 232 26.4. 13:12 /dev/kvm

Actual results:

before triggering for kvm device qemu-kvm(-rhev) doesn't call:
udevadm control --reload-rules


Expected results:

calls

Additional info:

More detailed tests, information in attached case
Comment 2 Olimp Bockowski 2016-05-05 03:16:55 EDT
Hello,

Simpler way to reproduce:

#prepare
rmmod kvm kvm_intel
yum remove  qemu-kvm
modprobe kvm_intel
# owner of /dev/kvm should be root. root
# Test
udevadm trigger 
yum install -y qemu-kvm
# notably install must complete with 3s from trigger fpr bug to occur
# check /dev/kvm owner it should be root.kvm if not you hit the bug

If trigger is omitted above the permissions will change as they should

olimpb
Comment 6 Miroslav Rezanina 2016-06-15 05:20:22 EDT
Fix included in qemu-kvm-1.5.3-114.el7
Comment 9 FuXiangChun 2016-09-05 03:46:05 EDT
I got the same result between fixed and unfixed qemu-kvm. so I am not sure if this bug is fixed.  Could you help me take a look at these steps?  If it is wrong. please correct it. 

steps:

1.#rmmod kvm kvm_intel

2.#rpm -e qemu-kvm-tools-1.5.3-105.el7.x86_64 qemu-kvm-common-1.5.3-105.el7.x86_64 qemu-kvm-debuginfo-1.5.3-105.el7.x86_64 qemu-img-1.5.3-105.el7.x86_64 qemu-kvm-1.5.3-105.el7.x86_64

3.# modprobe kvm_intel

4.# ll /dev/kvm
crw------- 1 root root 10, 232 Sep  5 15:20 /dev/kvm

5.#rpm -ivh qemu*(qemu-kvm-1.5.3-105......)

6.# ll /dev/kvm
crw-rw-rw- 1 root kvm 10, 232 Sep  5 15:20 /dev/kvm

The fixed version(qemu-kvm-1.5.3-121) and unfixed version(qemu-kvm-1.5.3-105.el7) got the same result as above.
Comment 10 Yanan Fu 2016-09-14 04:43:57 EDT
cancel the needinfo in comment 9 as can reproduce it now.

-------------------------reproduce---------------------
Test version:
qemu-kvm-1.5.3-113.el7.x86_64

Test steps:
1. unload kvm module, uninstall qemu-kvm
  # rmmod kvm-intel kvm
  # rpm -qa | grep qemu-kvm
    qemu-kvm-common-1.5.3-113.el7.x86_64
    qemu-kvm-1.5.3-113.el7.x86_64
  # yum remove -y qemu-kvm-common-1.5.3-113.el7.x86_64 qemu-kvm-1.5.3-113.el7.x86_64

2. load kvm module
  # modprobe kvm_intel
  # lsmod | grep kvm
   kvm_intel             170125  0 
   kvm                   543643  1 kvm_intel
   irqbypass              13503  2 kvm,vfio_pci

3. check owner of /dev/kvm, it is "root.root", right result.
  # ll /dev/kvm
    crw-------. 1 root root 10, 232 Sep 14 04:26 /dev/kvm

4. Install qemu-kvm while doing "udevadm trigger"
  # udevadm trigger; yum install -y ./qemu-*
  # rpm -qa | grep qemu-kvm
    qemu-kvm-common-1.5.3-113.el7.x86_64
    qemu-kvm-1.5.3-113.el7.x86_64

5. check owner of /dev/kvm, it is "root.root", so hit this issue.
  # ll /dev/kvm
   crw-------. 1 root root 10, 232 Sep 14 04:28 /dev/kvm

6. uninstall qemu-kvm, then install qemu-kvm without "udevadm trigger"
  # yum remove -y qemu-kvm-common-1.5.3-113.el7.x86_64 qemu-kvm-1.5.3-113.el7.x86_64
  # yum install -y ./qemu-*

7. check owner of /dev/kvm, it is "root.kvm"
  # ll /dev/kvm
crw-rw-rw-. 1 root kvm 10, 232 Sep 14 04:30 /dev/kvm

reproduce this bug successfully according the result of step 5.

-------------------------verification---------------------
Test version:
qemu-kvm-1.5.3-124.el7.x86_64

Test steps:
same steps with above.
1. unload kvm module, uninstall qemu-kvm
2. load kvm module
3. check owner of /dev/kvm, it is "root.root", right result.
4. install qemu-kvm while doing "udevadm trigger".
  # udevadm trigger; yum install -y ./* 
   (qemu-kvm-1.5.3-124.el7.x86_64)

5. check owner of /dev/kvm, it is "root.kvm".
  # ll /dev/kvm
   crw-rw-rw-. 1 root kvm 10, 232 Sep 14 04:32 /dev/kvm

Move to VERIFIED according to the test result above.
Comment 12 errata-xmlrpc 2016-11-03 16:13:06 EDT
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://rhn.redhat.com/errata/RHSA-2016-2585.html

Note You need to log in before you can comment on or make changes to this bug.