Displaying 20 results from an estimated 174 matches for "filep".
Did you mean:
file
2020 Jun 02
2
[PATCH] vdpa: bypass waking up vhost_woker for vdpa vq kick
...vhost_virtqueue *vq,
a84ddbf1ef29f1 Zhu Lingshan 2020-05-26 317 void __user *argp)
a84ddbf1ef29f1 Zhu Lingshan 2020-05-26 318 {
a84ddbf1ef29f1 Zhu Lingshan 2020-05-26 319 bool pollstart = false, pollstop = false;
a84ddbf1ef29f1 Zhu Lingshan 2020-05-26 320 struct file *eventfp, *filep = NULL;
a84ddbf1ef29f1 Zhu Lingshan 2020-05-26 321 struct vhost_vring_file f;
a84ddbf1ef29f1 Zhu Lingshan 2020-05-26 322 long r;
a84ddbf1ef29f1 Zhu Lingshan 2020-05-26 323
a84ddbf1ef29f1 Zhu Lingshan 2020-05-26 324 if (copy_from_user(&f, argp, sizeof(f)))
a84ddbf1ef29f1 Zhu Lingshan...
2020 Jun 02
2
[PATCH] vdpa: bypass waking up vhost_woker for vdpa vq kick
...vhost_virtqueue *vq,
a84ddbf1ef29f1 Zhu Lingshan 2020-05-26 317 void __user *argp)
a84ddbf1ef29f1 Zhu Lingshan 2020-05-26 318 {
a84ddbf1ef29f1 Zhu Lingshan 2020-05-26 319 bool pollstart = false, pollstop = false;
a84ddbf1ef29f1 Zhu Lingshan 2020-05-26 320 struct file *eventfp, *filep = NULL;
a84ddbf1ef29f1 Zhu Lingshan 2020-05-26 321 struct vhost_vring_file f;
a84ddbf1ef29f1 Zhu Lingshan 2020-05-26 322 long r;
a84ddbf1ef29f1 Zhu Lingshan 2020-05-26 323
a84ddbf1ef29f1 Zhu Lingshan 2020-05-26 324 if (copy_from_user(&f, argp, sizeof(f)))
a84ddbf1ef29f1 Zhu Lingshan...
2020 May 28
0
[PATCH] vdpa: bypass waking up vhost_woker for vdpa vq kick
...gt; + }
> +
> + return 0;
> +}
So this basically a duplication of vhost_poll_start()?
> +
> +static long vhost_vdpa_set_vring_kick(struct vhost_virtqueue *vq,
> + void __user *argp)
> +{
> + bool pollstart = false, pollstop = false;
> + struct file *eventfp, *filep = NULL;
> + struct vhost_vring_file f;
> + long r;
> +
> + if (copy_from_user(&f, argp, sizeof(f)))
> + return -EFAULT;
> +
> + eventfp = f.fd == -1 ? NULL : eventfd_fget(f.fd);
> + if (IS_ERR(eventfp)) {
> + r = PTR_ERR(eventfp);
> + return r;
> + }
> +
&...
2019 Apr 16
4
[PATCH v3 09/26] compat_ioctl: move drivers to compat_ptr_ioctl
...ap = usbdev_mmap,
.open = usbdev_open,
.release = usbdev_release,
diff --git a/drivers/vfio/vfio.c b/drivers/vfio/vfio.c
index a3030cdf3c18..a5efe82584a5 100644
--- a/drivers/vfio/vfio.c
+++ b/drivers/vfio/vfio.c
@@ -1200,15 +1200,6 @@ static long vfio_fops_unl_ioctl(struct file *filep,
return ret;
}
-#ifdef CONFIG_COMPAT
-static long vfio_fops_compat_ioctl(struct file *filep,
- unsigned int cmd, unsigned long arg)
-{
- arg = (unsigned long)compat_ptr(arg);
- return vfio_fops_unl_ioctl(filep, cmd, arg);
-}
-#endif /* CONFIG_COMPAT */
-
static int vfio_fops_open(struct...
2019 Apr 16
4
[PATCH v3 09/26] compat_ioctl: move drivers to compat_ptr_ioctl
...ap = usbdev_mmap,
.open = usbdev_open,
.release = usbdev_release,
diff --git a/drivers/vfio/vfio.c b/drivers/vfio/vfio.c
index a3030cdf3c18..a5efe82584a5 100644
--- a/drivers/vfio/vfio.c
+++ b/drivers/vfio/vfio.c
@@ -1200,15 +1200,6 @@ static long vfio_fops_unl_ioctl(struct file *filep,
return ret;
}
-#ifdef CONFIG_COMPAT
-static long vfio_fops_compat_ioctl(struct file *filep,
- unsigned int cmd, unsigned long arg)
-{
- arg = (unsigned long)compat_ptr(arg);
- return vfio_fops_unl_ioctl(filep, cmd, arg);
-}
-#endif /* CONFIG_COMPAT */
-
static int vfio_fops_open(struct...
2020 Sep 24
1
[RFC PATCH 02/24] vhost-vdpa: fix vqs leak in vhost_vdpa_open()
..._free_domain(struct vhost_vdpa *v)
> v->domain = NULL;
> }
>
> +static void vhost_vdpa_cleanup(struct vhost_vdpa *v)
> +{
> + vhost_dev_cleanup(&v->vdev);
> + kfree(v->vdev.vqs);
> +}
> +
> static int vhost_vdpa_open(struct inode *inode, struct file *filep)
> {
> struct vhost_vdpa *v;
> @@ -809,7 +815,7 @@ static int vhost_vdpa_open(struct inode *inode, struct file *filep)
> return 0;
>
> err_init_iotlb:
> - vhost_dev_cleanup(&v->vdev);
> + vhost_vdpa_cleanup(v);
> err:
> atomic_dec(&v->opened);...
2019 Apr 19
0
[PATCH v3 09/26] compat_ioctl: move drivers to compat_ptr_ioctl
....open = usbdev_open,
> .release = usbdev_release,
> diff --git a/drivers/vfio/vfio.c b/drivers/vfio/vfio.c
> index a3030cdf3c18..a5efe82584a5 100644
> --- a/drivers/vfio/vfio.c
> +++ b/drivers/vfio/vfio.c
> @@ -1200,15 +1200,6 @@ static long vfio_fops_unl_ioctl(struct file *filep,
> return ret;
> }
>
> -#ifdef CONFIG_COMPAT
> -static long vfio_fops_compat_ioctl(struct file *filep,
> - unsigned int cmd, unsigned long arg)
> -{
> - arg = (unsigned long)compat_ptr(arg);
> - return vfio_fops_unl_ioctl(filep, cmd, arg);
> -}
> -#endif...
2018 Sep 12
1
[PATCH v2 02/17] compat_ioctl: move drivers to generic_compat_ioctl_ptrarg
...ap = usbdev_mmap,
.open = usbdev_open,
.release = usbdev_release,
diff --git a/drivers/vfio/vfio.c b/drivers/vfio/vfio.c
index 64833879f75d..79f08a99602d 100644
--- a/drivers/vfio/vfio.c
+++ b/drivers/vfio/vfio.c
@@ -1200,15 +1200,6 @@ static long vfio_fops_unl_ioctl(struct file *filep,
return ret;
}
-#ifdef CONFIG_COMPAT
-static long vfio_fops_compat_ioctl(struct file *filep,
- unsigned int cmd, unsigned long arg)
-{
- arg = (unsigned long)compat_ptr(arg);
- return vfio_fops_unl_ioctl(filep, cmd, arg);
-}
-#endif /* CONFIG_COMPAT */
-
static int vfio_fops_open(struct...
2015 Dec 31
4
[PATCH RFC] vhost: basic device IOTLB support
...mp;dev->iotlb_completion);
+ for (i = 0; i < VHOST_IOTLB_SIZE; i++)
+ dev->iotlb[i].flags.valid = VHOST_IOTLB_INVALID;
}
EXPORT_SYMBOL_GPL(vhost_dev_init);
@@ -940,9 +956,10 @@ long vhost_dev_ioctl(struct vhost_dev *d, unsigned int ioctl, void __user *argp)
{
struct file *eventfp, *filep = NULL;
struct eventfd_ctx *ctx = NULL;
+ struct vhost_iotlb_entry entry;
u64 p;
long r;
- int i, fd;
+ int index, i, fd;
/* If you are not the owner, you can become one */
if (ioctl == VHOST_SET_OWNER) {
@@ -1008,6 +1025,80 @@ long vhost_dev_ioctl(struct vhost_dev *d, unsigned int ioct...
2015 Dec 31
4
[PATCH RFC] vhost: basic device IOTLB support
...mp;dev->iotlb_completion);
+ for (i = 0; i < VHOST_IOTLB_SIZE; i++)
+ dev->iotlb[i].flags.valid = VHOST_IOTLB_INVALID;
}
EXPORT_SYMBOL_GPL(vhost_dev_init);
@@ -940,9 +956,10 @@ long vhost_dev_ioctl(struct vhost_dev *d, unsigned int ioctl, void __user *argp)
{
struct file *eventfp, *filep = NULL;
struct eventfd_ctx *ctx = NULL;
+ struct vhost_iotlb_entry entry;
u64 p;
long r;
- int i, fd;
+ int index, i, fd;
/* If you are not the owner, you can become one */
if (ioctl == VHOST_SET_OWNER) {
@@ -1008,6 +1025,80 @@ long vhost_dev_ioctl(struct vhost_dev *d, unsigned int ioct...
2020 Jun 02
0
[PATCH] vdpa: bypass waking up vhost_woker for vdpa vq kick
...,
> a84ddbf1ef29f1 Zhu Lingshan 2020-05-26 317 void __user *argp)
> a84ddbf1ef29f1 Zhu Lingshan 2020-05-26 318 {
> a84ddbf1ef29f1 Zhu Lingshan 2020-05-26 319 bool pollstart = false, pollstop = false;
> a84ddbf1ef29f1 Zhu Lingshan 2020-05-26 320 struct file *eventfp, *filep = NULL;
> a84ddbf1ef29f1 Zhu Lingshan 2020-05-26 321 struct vhost_vring_file f;
> a84ddbf1ef29f1 Zhu Lingshan 2020-05-26 322 long r;
> a84ddbf1ef29f1 Zhu Lingshan 2020-05-26 323
> a84ddbf1ef29f1 Zhu Lingshan 2020-05-26 324 if (copy_from_user(&f, argp, sizeof(f)))
> a84d...
2019 Jul 30
2
[PATCH v5 12/29] compat_ioctl: move drivers to compat_ptr_ioctl
...ap = usbdev_mmap,
.open = usbdev_open,
.release = usbdev_release,
diff --git a/drivers/vfio/vfio.c b/drivers/vfio/vfio.c
index 388597930b64..c8482624ca34 100644
--- a/drivers/vfio/vfio.c
+++ b/drivers/vfio/vfio.c
@@ -1184,15 +1184,6 @@ static long vfio_fops_unl_ioctl(struct file *filep,
return ret;
}
-#ifdef CONFIG_COMPAT
-static long vfio_fops_compat_ioctl(struct file *filep,
- unsigned int cmd, unsigned long arg)
-{
- arg = (unsigned long)compat_ptr(arg);
- return vfio_fops_unl_ioctl(filep, cmd, arg);
-}
-#endif /* CONFIG_COMPAT */
-
static int vfio_fops_open(struct...
2015 Dec 31
0
[PATCH RFC] vhost: basic device IOTLB support
...(i = 0; i < VHOST_IOTLB_SIZE; i++)
> + dev->iotlb[i].flags.valid = VHOST_IOTLB_INVALID;
> }
> EXPORT_SYMBOL_GPL(vhost_dev_init);
>
> @@ -940,9 +956,10 @@ long vhost_dev_ioctl(struct vhost_dev *d, unsigned int ioctl, void __user *argp)
> {
> struct file *eventfp, *filep = NULL;
> struct eventfd_ctx *ctx = NULL;
> + struct vhost_iotlb_entry entry;
> u64 p;
> long r;
> - int i, fd;
> + int index, i, fd;
>
> /* If you are not the owner, you can become one */
> if (ioctl == VHOST_SET_OWNER) {
> @@ -1008,6 +1025,80 @@ long vhos...
2023 Mar 10
0
[PATCH] vhost-vdpa: cleanup memory maps when closing vdpa fds
...it's a UAF?
> >
> I think so, the v->domain is set to NULL in vhost_vdpa_free_domain(), it
> seems would trigger null-pointer access in my case.
>
> > Thanks
> >
> > >
> > > > static int vhost_vdpa_release(struct inode *inode, struct file *filep)
> > > > {
> > > > struct vhost_vdpa *v = filep->private_data;
> > > > struct vhost_dev *d = &v->vdev;
> > > >
> > > > mutex_lock(&d->mutex);
> > > > filep->private_d...
2023 Mar 21
1
[PATCH v3 2/8] vhost-vdpa: use bind_mm/unbind_mm device callbacks
...a->config;
+
+ if (!vdpa->use_va || !ops->unbind_mm)
+ return;
+
+ ops->unbind_mm(vdpa);
+}
+
static long vhost_vdpa_get_device_id(struct vhost_vdpa *v, u8 __user *argp)
{
struct vdpa_device *vdpa = v->vdpa;
@@ -709,6 +731,14 @@ static long vhost_vdpa_unlocked_ioctl(struct file *filep,
case VHOST_VDPA_RESUME:
r = vhost_vdpa_resume(v);
break;
+ case VHOST_SET_OWNER:
+ r = vhost_dev_set_owner(d);
+ if (r)
+ break;
+ r = vhost_vdpa_bind_mm(v);
+ if (r)
+ vhost_dev_reset_owner(d, NULL);
+ break;
default:
r = vhost_dev_ioctl(&v->vdev, cmd, argp);
if (r...
2020 Aug 04
0
[PATCH V5 4/6] vhost_vdpa: implement IRQ offloading in vhost_vdpa
...t_vdpa *v, unsigned int cmd,
> cb.private = NULL;
> }
> ops->set_vq_cb(vdpa, idx, &cb);
> + vhost_vdpa_update_vq_irq(vq);
> break;
>
> case VHOST_SET_VRING_NUM:
> @@ -765,6 +829,18 @@ static int vhost_vdpa_open(struct inode *inode, struct file *filep)
> return r;
> }
>
> +static void vhost_vdpa_clean_irq(struct vhost_vdpa *v)
> +{
> + struct vhost_virtqueue *vq;
> + int i;
> +
> + for (i = 0; i < v->nvqs; i++) {
> + vq = &v->vqs[i];
> + if (vq->call_ctx.producer.irq)
> + irq_bypass...
2020 Feb 05
0
[PATCH] vhost: introduce vDPA based backend
...ufficient for to doing this or need to
> introduce new API like iommu_device in mdev.
Agree. We may also need to introduce something like
the iommu_device.
>
>
> > + return -ENOTSUPP;
> > +}
> > +
> > +static int vhost_vdpa_open(struct inode *inode, struct file *filep)
> > +{
> > + struct vhost_vdpa *v;
> > + struct vhost_dev *dev;
> > + struct vhost_virtqueue **vqs;
> > + int nvqs, i, r, opened;
> > +
> > + v = vhost_vdpa_get_from_minor(iminor(inode));
> > + if (!v)
> > + return -ENODEV;
> > +
> &g...
2020 Sep 07
0
[PATCH] vhost-vdpa: fix backend feature ioctls
...)
- return -EFAULT;
- if (features & ~VHOST_VDPA_BACKEND_FEATURES)
- return -EOPNOTSUPP;
- vhost_set_backend_features(&v->vdev, features);
- return 0;
}
r = vhost_vring_ioctl(&v->vdev, cmd, argp);
@@ -440,8 +426,20 @@ static long vhost_vdpa_unlocked_ioctl(struct file *filep,
struct vhost_vdpa *v = filep->private_data;
struct vhost_dev *d = &v->vdev;
void __user *argp = (void __user *)arg;
+ u64 __user *featurep = argp;
+ u64 features;
long r;
+ if (cmd == VHOST_SET_BACKEND_FEATURES) {
+ r = copy_from_user(&features, featurep, sizeof(features))...
2020 Sep 24
0
[RFC PATCH 01/24] vhost-vdpa: fix backend feature ioctls
...)
- return -EFAULT;
- if (features & ~VHOST_VDPA_BACKEND_FEATURES)
- return -EOPNOTSUPP;
- vhost_set_backend_features(&v->vdev, features);
- return 0;
}
r = vhost_vring_ioctl(&v->vdev, cmd, argp);
@@ -440,8 +426,20 @@ static long vhost_vdpa_unlocked_ioctl(struct file *filep,
struct vhost_vdpa *v = filep->private_data;
struct vhost_dev *d = &v->vdev;
void __user *argp = (void __user *)arg;
+ u64 __user *featurep = argp;
+ u64 features;
long r;
+ if (cmd == VHOST_SET_BACKEND_FEATURES) {
+ r = copy_from_user(&features, featurep, sizeof(features))...
2020 Sep 24
0
[RFC PATCH 02/24] vhost-vdpa: fix vqs leak in vhost_vdpa_open()
...vdpa.c
@@ -764,6 +764,12 @@ static void vhost_vdpa_free_domain(struct vhost_vdpa *v)
v->domain = NULL;
}
+static void vhost_vdpa_cleanup(struct vhost_vdpa *v)
+{
+ vhost_dev_cleanup(&v->vdev);
+ kfree(v->vdev.vqs);
+}
+
static int vhost_vdpa_open(struct inode *inode, struct file *filep)
{
struct vhost_vdpa *v;
@@ -809,7 +815,7 @@ static int vhost_vdpa_open(struct inode *inode, struct file *filep)
return 0;
err_init_iotlb:
- vhost_dev_cleanup(&v->vdev);
+ vhost_vdpa_cleanup(v);
err:
atomic_dec(&v->opened);
return r;
@@ -840,8 +846,7 @@ static int vhost_v...