diff --git a/drivers/vfio/vfio.c b/drivers/vfio/vfio.c index 75c16cc5921a..1eab4ace0671 100644 --- a/drivers/vfio/vfio.c +++ b/drivers/vfio/vfio.c @@ -1109,7 +1109,7 @@ static int vfio_group_get_device_fd(struct vfio_group *group, char *buf) * We can't use anon_inode_getfd() because we need to modify * the f_mode flags directly to allow more than just ioctls */ - ret = get_unused_fd_flags(0); + ret = get_unused_fd_flags(O_CLOEXEC); if (ret < 0) { device->ops->release(device->device_data); break;