mirror of
https://github.com/Fishwaldo/linux-bl808.git
synced 2025-06-06 14:45:14 +00:00
vfio: Set container device mode
Minor 0 is the VFIO container device (/dev/vfio/vfio). On it's own the container does not provide a user with any privileged access. It only supports API version check and extension check ioctls. Only by attaching a VFIO group to the container does it gain any access. Set the mode of the container to allow access. Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
This commit is contained in:
parent
0b43c08233
commit
664e9386bd
1 changed files with 4 additions and 0 deletions
|
@ -27,6 +27,7 @@
|
||||||
#include <linux/rwsem.h>
|
#include <linux/rwsem.h>
|
||||||
#include <linux/sched.h>
|
#include <linux/sched.h>
|
||||||
#include <linux/slab.h>
|
#include <linux/slab.h>
|
||||||
|
#include <linux/stat.h>
|
||||||
#include <linux/string.h>
|
#include <linux/string.h>
|
||||||
#include <linux/uaccess.h>
|
#include <linux/uaccess.h>
|
||||||
#include <linux/vfio.h>
|
#include <linux/vfio.h>
|
||||||
|
@ -1359,6 +1360,9 @@ static const struct file_operations vfio_device_fops = {
|
||||||
*/
|
*/
|
||||||
static char *vfio_devnode(struct device *dev, umode_t *mode)
|
static char *vfio_devnode(struct device *dev, umode_t *mode)
|
||||||
{
|
{
|
||||||
|
if (MINOR(dev->devt) == 0)
|
||||||
|
*mode = S_IRUGO | S_IWUGO;
|
||||||
|
|
||||||
return kasprintf(GFP_KERNEL, "vfio/%s", dev_name(dev));
|
return kasprintf(GFP_KERNEL, "vfio/%s", dev_name(dev));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue