Displaying 20 results from an estimated 101 matches for "vhost_msg_node".
2018 May 29
3
[net] vhost: Use kzalloc() to allocate vhost_msg_node
On Fri, Apr 27, 2018 at 11:45:02AM -0400, Kevin Easton wrote:
> The struct vhost_msg within struct vhost_msg_node is copied to userspace,
> so it should be allocated with kzalloc() to ensure all structure padding
> is zeroed.
>
> Signed-off-by: Kevin Easton <kevin at guarana.org>
> Reported-by: syzbot+87cfa083e727a224754b at syzkaller.appspotmail.com
Is this patch going anywhere ?
The p...
2018 May 29
3
[net] vhost: Use kzalloc() to allocate vhost_msg_node
On Fri, Apr 27, 2018 at 11:45:02AM -0400, Kevin Easton wrote:
> The struct vhost_msg within struct vhost_msg_node is copied to userspace,
> so it should be allocated with kzalloc() to ensure all structure padding
> is zeroed.
>
> Signed-off-by: Kevin Easton <kevin at guarana.org>
> Reported-by: syzbot+87cfa083e727a224754b at syzkaller.appspotmail.com
Is this patch going anywhere ?
The p...
2018 May 07
1
[PATCH net] vhost: Use kzalloc() to allocate vhost_msg_node
On Fri, Apr 27, 2018 at 11:45:02AM -0400, Kevin Easton wrote:
> The struct vhost_msg within struct vhost_msg_node is copied to userspace,
> so it should be allocated with kzalloc() to ensure all structure padding
> is zeroed.
>
> Signed-off-by: Kevin Easton <kevin at guarana.org>
> Reported-by: syzbot+87cfa083e727a224754b at syzkaller.appspotmail.com
> ---
> drivers/vhost/vhost.c |...
2018 May 30
0
[net] vhost: Use kzalloc() to allocate vhost_msg_node
On Tue, May 29, 2018 at 03:19:08PM -0700, Guenter Roeck wrote:
> On Fri, Apr 27, 2018 at 11:45:02AM -0400, Kevin Easton wrote:
> > The struct vhost_msg within struct vhost_msg_node is copied to userspace,
> > so it should be allocated with kzalloc() to ensure all structure padding
> > is zeroed.
> >
> > Signed-off-by: Kevin Easton <kevin at guarana.org>
> > Reported-by: syzbot+87cfa083e727a224754b at syzkaller.appspotmail.com
>
> Is...
2018 Jun 07
3
KMSAN: uninit-value in _copy_to_iter (2)
...Subject: vhost: fix info leak
Fixes: CVE-2018-1118
Signed-off-by: Michael S. Tsirkin <mst at redhat.com>
---
diff --git a/drivers/vhost/vhost.c b/drivers/vhost/vhost.c
index f0be5f35ab28..9beefa6ed1ce 100644
--- a/drivers/vhost/vhost.c
+++ b/drivers/vhost/vhost.c
@@ -2345,6 +2345,9 @@ struct vhost_msg_node *vhost_new_msg(struct vhost_virtqueue *vq, int type)
struct vhost_msg_node *node = kmalloc(sizeof *node, GFP_KERNEL);
if (!node)
return NULL;
+
+ /* Make sure all padding within the structure is initialized. */
+ memset(&node->msg, 0, sizeof node->msg);
node->vq = vq;
node-&...
2018 Jun 07
3
KMSAN: uninit-value in _copy_to_iter (2)
...Subject: vhost: fix info leak
Fixes: CVE-2018-1118
Signed-off-by: Michael S. Tsirkin <mst at redhat.com>
---
diff --git a/drivers/vhost/vhost.c b/drivers/vhost/vhost.c
index f0be5f35ab28..9beefa6ed1ce 100644
--- a/drivers/vhost/vhost.c
+++ b/drivers/vhost/vhost.c
@@ -2345,6 +2345,9 @@ struct vhost_msg_node *vhost_new_msg(struct vhost_virtqueue *vq, int type)
struct vhost_msg_node *node = kmalloc(sizeof *node, GFP_KERNEL);
if (!node)
return NULL;
+
+ /* Make sure all padding within the structure is initialized. */
+ memset(&node->msg, 0, sizeof node->msg);
node->vq = vq;
node-&...
2018 Jun 07
2
KMSAN: uninit-value in _copy_to_iter (2)
...ff-by: Michael S. Tsirkin <mst at redhat.com>
> > ---
> > diff --git a/drivers/vhost/vhost.c b/drivers/vhost/vhost.c
> > index f0be5f35ab28..9beefa6ed1ce 100644
> > --- a/drivers/vhost/vhost.c
> > +++ b/drivers/vhost/vhost.c
> > @@ -2345,6 +2345,9 @@ struct vhost_msg_node *vhost_new_msg(struct vhost_virtqueue *vq, int type)
> > struct vhost_msg_node *node = kmalloc(sizeof *node, GFP_KERNEL);
> > if (!node)
> > return NULL;
> > +
> > + /* Make sure all padding within the structure is initialized. */
> > + memset(&node-&g...
2018 Jun 07
2
KMSAN: uninit-value in _copy_to_iter (2)
...ff-by: Michael S. Tsirkin <mst at redhat.com>
> > ---
> > diff --git a/drivers/vhost/vhost.c b/drivers/vhost/vhost.c
> > index f0be5f35ab28..9beefa6ed1ce 100644
> > --- a/drivers/vhost/vhost.c
> > +++ b/drivers/vhost/vhost.c
> > @@ -2345,6 +2345,9 @@ struct vhost_msg_node *vhost_new_msg(struct vhost_virtqueue *vq, int type)
> > struct vhost_msg_node *node = kmalloc(sizeof *node, GFP_KERNEL);
> > if (!node)
> > return NULL;
> > +
> > + /* Make sure all padding within the structure is initialized. */
> > + memset(&node-&g...
2016 Jun 22
0
[PATCH 3/3] vhost: device IOTLB API
...umem_interval_tree_remove(node, &umem->umem_tree);
- list_del(&node->link);
- kvfree(node);
- }
+ list_for_each_entry_safe(node, tmp, &umem->umem_list, link)
+ vhost_umem_free(umem, node);
+
kvfree(umem);
}
+static void vhost_clear_msg(struct vhost_dev *dev)
+{
+ struct vhost_msg_node *node, *n;
+
+ spin_lock(&dev->iotlb_lock);
+
+ list_for_each_entry_safe(node, n, &dev->read_list, node) {
+ list_del(&node->node);
+ kfree(node);
+ }
+
+ list_for_each_entry_safe(node, n, &dev->pending_list, node) {
+ list_del(&node->node);
+ kfree(node);
+ }...
2017 Mar 07
2
[PATCH] vhost: Move vhost.h to allow vhost driver out-of-tree compilation
...g endianness. Defaults to legacy native endianness.
- * Set to true when starting a modern virtio device. */
- bool is_le;
-#ifdef CONFIG_VHOST_CROSS_ENDIAN_LEGACY
- /* Ring endianness requested by userspace for cross-endian support. */
- bool user_be;
-#endif
- u32 busyloop_timeout;
-};
-
-struct vhost_msg_node {
- struct vhost_msg msg;
- struct vhost_virtqueue *vq;
- struct list_head node;
-};
-
-struct vhost_dev {
- struct mm_struct *mm;
- struct mutex mutex;
- struct vhost_virtqueue **vqs;
- int nvqs;
- struct file *log_file;
- struct eventfd_ctx *log_ctx;
- struct llist_head work_list;
- struct tas...
2017 Mar 07
2
[PATCH] vhost: Move vhost.h to allow vhost driver out-of-tree compilation
...g endianness. Defaults to legacy native endianness.
- * Set to true when starting a modern virtio device. */
- bool is_le;
-#ifdef CONFIG_VHOST_CROSS_ENDIAN_LEGACY
- /* Ring endianness requested by userspace for cross-endian support. */
- bool user_be;
-#endif
- u32 busyloop_timeout;
-};
-
-struct vhost_msg_node {
- struct vhost_msg msg;
- struct vhost_virtqueue *vq;
- struct list_head node;
-};
-
-struct vhost_dev {
- struct mm_struct *mm;
- struct mutex mutex;
- struct vhost_virtqueue **vqs;
- int nvqs;
- struct file *log_file;
- struct eventfd_ctx *log_ctx;
- struct llist_head work_list;
- struct tas...
2018 Jun 07
0
KMSAN: uninit-value in _copy_to_iter (2)
...s: CVE-2018-1118
> Signed-off-by: Michael S. Tsirkin <mst at redhat.com>
> ---
> diff --git a/drivers/vhost/vhost.c b/drivers/vhost/vhost.c
> index f0be5f35ab28..9beefa6ed1ce 100644
> --- a/drivers/vhost/vhost.c
> +++ b/drivers/vhost/vhost.c
> @@ -2345,6 +2345,9 @@ struct vhost_msg_node *vhost_new_msg(struct vhost_virtqueue *vq, int type)
> struct vhost_msg_node *node = kmalloc(sizeof *node, GFP_KERNEL);
> if (!node)
> return NULL;
> +
> + /* Make sure all padding within the structure is initialized. */
> + memset(&node->msg, 0, sizeof node->msg)...
2018 Jun 07
0
KMSAN: uninit-value in _copy_to_iter (2)
...mst at redhat.com>
> > > ---
> > > diff --git a/drivers/vhost/vhost.c b/drivers/vhost/vhost.c
> > > index f0be5f35ab28..9beefa6ed1ce 100644
> > > --- a/drivers/vhost/vhost.c
> > > +++ b/drivers/vhost/vhost.c
> > > @@ -2345,6 +2345,9 @@ struct vhost_msg_node *vhost_new_msg(struct vhost_virtqueue *vq, int type)
> > > struct vhost_msg_node *node = kmalloc(sizeof *node, GFP_KERNEL);
> > > if (!node)
> > > return NULL;
> > > +
> > > + /* Make sure all padding within the structure is initialized. */
> &...
2023 May 23
0
[PATCH] vhost: use kzalloc() instead of kmalloc() followed by memset()
...etions(-)
>
>diff --git a/drivers/vhost/vhost.c b/drivers/vhost/vhost.c
>index a92af08e7864..579ecb4ee4d2 100644
>--- a/drivers/vhost/vhost.c
>+++ b/drivers/vhost/vhost.c
>@@ -2575,12 +2575,11 @@ EXPORT_SYMBOL_GPL(vhost_disable_notify);
> /* Create a new message. */
> struct vhost_msg_node *vhost_new_msg(struct vhost_virtqueue *vq, int type)
> {
>- struct vhost_msg_node *node = kmalloc(sizeof *node, GFP_KERNEL);
>+ /* Make sure all padding within the structure is initialized. */
>+ struct vhost_msg_node *node = kzalloc(sizeof(*node), GFP_KERNEL);
> if (!node)
> r...
2017 Mar 10
0
[PATCH] vhost: Move vhost.h to allow vhost driver out-of-tree compilation
....
> - * Set to true when starting a modern virtio device. */
> - bool is_le;
> -#ifdef CONFIG_VHOST_CROSS_ENDIAN_LEGACY
> - /* Ring endianness requested by userspace for cross-endian support. */
> - bool user_be;
> -#endif
> - u32 busyloop_timeout;
> -};
> -
> -struct vhost_msg_node {
> - struct vhost_msg msg;
> - struct vhost_virtqueue *vq;
> - struct list_head node;
> -};
> -
> -struct vhost_dev {
> - struct mm_struct *mm;
> - struct mutex mutex;
> - struct vhost_virtqueue **vqs;
> - int nvqs;
> - struct file *log_file;
> - struct event...
2018 Aug 03
4
[PATCH net-next] vhost: switch to use new message format
...res = 0;
+ vq->acked_backend_features = 0;
vq->log_base = NULL;
vq->error_ctx = NULL;
vq->kick = NULL;
@@ -1027,28 +1028,40 @@ static int vhost_process_iotlb_msg(struct vhost_dev *dev,
ssize_t vhost_chr_write_iter(struct vhost_dev *dev,
struct iov_iter *from)
{
- struct vhost_msg_node node;
- unsigned size = sizeof(struct vhost_msg);
- size_t ret;
- int err;
+ struct vhost_iotlb_msg msg;
+ size_t offset;
+ int type, ret;
- if (iov_iter_count(from) < size)
- return 0;
- ret = copy_from_iter(&node.msg, size, from);
- if (ret != size)
+ ret = copy_from_iter(&type, siz...
2018 Aug 03
4
[PATCH net-next] vhost: switch to use new message format
...res = 0;
+ vq->acked_backend_features = 0;
vq->log_base = NULL;
vq->error_ctx = NULL;
vq->kick = NULL;
@@ -1027,28 +1028,40 @@ static int vhost_process_iotlb_msg(struct vhost_dev *dev,
ssize_t vhost_chr_write_iter(struct vhost_dev *dev,
struct iov_iter *from)
{
- struct vhost_msg_node node;
- unsigned size = sizeof(struct vhost_msg);
- size_t ret;
- int err;
+ struct vhost_iotlb_msg msg;
+ size_t offset;
+ int type, ret;
- if (iov_iter_count(from) < size)
- return 0;
- ret = copy_from_iter(&node.msg, size, from);
- if (ret != size)
+ ret = copy_from_iter(&type, siz...
2016 Jun 23
3
[PATCH V2 0/3] basic device IOTLB support for vhost_net
This patch tries to implement an device IOTLB for vhost. This could be
used with for co-operation with userspace IOMMU implementation (qemu)
for a secure DMA environment (DMAR) in guest.
The idea is simple. When vhost meets an IOTLB miss, it will request
the assistance of userspace to do the translation, this is done
through:
- when there's a IOTLB miss, it will notify userspace through
2016 Jun 23
3
[PATCH V2 0/3] basic device IOTLB support for vhost_net
This patch tries to implement an device IOTLB for vhost. This could be
used with for co-operation with userspace IOMMU implementation (qemu)
for a secure DMA environment (DMAR) in guest.
The idea is simple. When vhost meets an IOTLB miss, it will request
the assistance of userspace to do the translation, this is done
through:
- when there's a IOTLB miss, it will notify userspace through
2016 May 24
6
[RFC PATCH V3 0/3] basic device IOTLB support
This patch tries to implement an device IOTLB for vhost. This could be
used with for co-operation with userspace IOMMU implementation (qemu)
for a secure DMA environment (DMAR) in guest.
The idea is simple. When vhost meets an IOTLB miss, it will request
the assistance of userspace to do the translation, this is done
through:
- when there's a IOTLB miss, it will notify userspace through