Matthias Maier 2fc1bc6c7b app-emulation/qemu: add rule to fix permissions on /dev/vfio/vfio
The device node /dev/vfio/vfio gets created on modprobing the vfio*
modules. This happens in particular on demand when a qemu vm with PCI
passthrough is started up. The default permissios for the freshly
created device node is

  crw-rw-rw-  1 root root 10, 196 Mar 27 08:44 /dev/vfio/vfio

This is terrible.

This patch adds an udev rules and makes sure that the device node has rw
permissions for user root, and group kvm (and no permissions for all).
This fixes

 - startup when a qemu-kvm is started as non-root (provided the user is
   in group kvm, which is our current policy for accessing /dev/kvm, etc.,
   anyway).

 - work around this security vulnerability, where /dev/vfio/vfio is
   created with world writable permissions upon modprobe. [1]

Thanks to username234, Kash Pande, Ted Rodgers for discovery and patch!

[1] Steps to reproduce:

    % ls -la /dev/vfio/vfio
    crw-------  1 root root 10, 196 Mar 27 15:40 /dev/vfio/vfio

    % modprobe vfio

    % ls -la /dev/vfio/vfio
    crw-rw-rw-  1 root root 10, 196 Mar 27 15:41 /dev/vfio/vfio

[2] I cannot find an udev rule installed by libvirt/qemu/... that
    triggers these permissions.

Bug: https://bugs.gentoo.org/651668
Package-Manager: Portage-2.3.24, Repoman-2.3.6
RepoMan-Options: --force
2018-03-27 10:44:04 -05:00
2018-03-25 19:26:55 +02:00
2018-03-27 00:05:53 -04:00
2018-03-25 19:26:56 +02:00
2018-03-27 10:14:16 +02:00
2018-03-26 18:13:52 +02:00
2018-03-21 21:47:19 +00:00
2018-03-26 16:59:12 +04:00
2018-03-27 07:47:51 +02:00
2018-03-22 13:15:01 +01:00
2018-03-25 23:06:51 +02:00
2018-03-26 11:39:12 -07:00
2018-03-26 17:03:40 +00:00
2018-03-26 14:40:40 -04:00
2018-03-16 21:42:36 +01:00
2018-03-27 11:31:06 +02:00
2018-03-25 20:57:30 +03:00
2018-03-27 11:13:19 +02:00
2018-03-25 19:27:08 +02:00
S
Description
No description provided
9.8 GiB
Languages
Shell 98%
Roff 1.4%
Emacs Lisp 0.2%
C 0.1%