Bug 1532382 - udev rules: Mark the kvm device as static_node (on s390x and ppc64)
Summary: udev rules: Mark the kvm device as static_node (on s390x and ppc64)
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Fedora
Classification: Fedora
Component: systemd
Version: rawhide
Hardware: s390x
OS: Linux
medium
medium
Target Milestone: ---
Assignee: systemd-maint
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2018-01-08 20:45 UTC by Thomas Huth
Modified: 2018-09-05 19:04 UTC (History)
7 users (show)

Fixed In Version: systemd-236-2.git3e14c4c.fc28
Clone Of:
Environment:
Last Closed: 2018-01-11 11:22:35 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description Thomas Huth 2018-01-08 20:45:02 UTC
Description of problem:
On s390x and ppc64, the permissions of the /dev/kvm device are currently not right as long as the kvm kernel module has not been loaded yet. The kernel module is using MODULE_ALIAS("devname:kvm") there, so the module will be loaded on the first access to /dev/kvm. In that case, udev needs to apply the permission to the static node already (which was created via devtmpfs), i.e. the udev rule hase to be specified with the option "static_node=kvm".
Please included the following patch in Fedora 28 to fix this problem:
https://github.com/systemd/systemd/commit/d35d6249d5a7ed3228

Steps to Reproduce:
1. Reboot a s390x machine (and make sure that the kvm.ko kernel module is not automatically loaded by any means)
2. Check the permissions of /dev/kvm
3. Load the kvm.ko kernel module
4. Check the permissions of /dev/kvm again

Actual results:
 # ls -l /dev/kvm
 crw------- 1 root root 10, 232  4. Jan 03:23 /dev/kvm
 # modprobe kvm
 # ls -l /dev/kvm
 crw-rw---- 1 root kvm 10, 232  4. Jan 03:25 /dev/kvm

Expected results:
 # ls -l /dev/kvm
 crw-rw---- 1 root kvm 10, 232  4. Jan 03:23 /dev/kvm
 # modprobe kvm
 # ls -l /dev/kvm
 crw-rw---- 1 root kvm 10, 232  4. Jan 03:23 /dev/kvm

Comment 2 Thomas Huth 2018-01-08 20:58:53 UTC
By the way, the problem has been discovered by running "virsh domcapabilities" on a freshly booted s390x system. As long as the kvm.ko module has not been loaded yet, the command returns the wrong information since /dev/kvm is not accessible. With the udev rule fixed, /dev/kvm is accessible and thus the kvm.ko module is loaded on access automatically, so that "virsh domcapabilities" can return the right information to the user.


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