History

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.

Alex Williamson committed 13 years ago

Commit 664e9381 parent 0b43c081 file · +4 −0Browse files

Unified · Split

drivers/vfio/vfio.c+4−0
@@ -27,6 +27,7 @@ · 26 unmodified lines
27#include <linux/rwsem.h>27#include <linux/rwsem.h>
28#include <linux/sched.h>28#include <linux/sched.h>
29#include <linux/slab.h>29#include <linux/slab.h>
30#include <linux/stat.h>
30#include <linux/string.h>31#include <linux/string.h>
31#include <linux/uaccess.h>32#include <linux/uaccess.h>
32#include <linux/vfio.h>33#include <linux/vfio.h>
@@ -1359,6 +1360,9 @@ static const struct file_operations vfio_device_fops = { · 1326 unmodified lines
1359 */1360 */
1360static char *vfio_devnode(struct device *dev, umode_t *mode)1361static char *vfio_devnode(struct device *dev, umode_t *mode)
1361{1362{
1363 if (MINOR(dev->devt) == 0)
1364 *mode = S_IRUGO | S_IWUGO;
1365
1362 return kasprintf(GFP_KERNEL, "vfio/%s", dev_name(dev));1366 return kasprintf(GFP_KERNEL, "vfio/%s", dev_name(dev));
1363}1367}
1364 1368

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t