search for: vhost_net_set_backend

Displaying 20 results from an estimated 162 matches for "vhost_net_set_backend".

2020 Feb 14
0
vhost changes (batched) in linux-next after 12/13 trigger random crashes in KVM guests after reboot
...vq=0000000088199421][vq->last_avail_idx=0][vq->avail_idx=0][s.index=0][s.num=0] [ 67.801018] [1917] vhost:vhost_vring_ioctl:1655: VHOST_SET_VRING_BASE [vq=00000000175f11ec][vq->last_avail_idx=0][vq->avail_idx=0][s.index=1][s.num=0] [ 67.801026] [1917] vhost_net:vhost_net_ioctl:1726: VHOST_NET_SET_BACKEND [ 67.801028] [1917] vhost_net:vhost_net_set_backend:1538: sock=0000000082d8d291 != oldsock=000000001ae027fd index=0 fd=39 vq=0000000088199421 [ 67.801032] [1917] vhost_net:vhost_net_set_backend:1573: sock=0000000082d8d291 [ 67.801033] [1917] vhost_net:vhost_net_ioctl:1726: VHOST_NET_SET_BACKE...
2020 Feb 13
0
vhost changes (batched) in linux-next after 12/13 trigger random crashes in KVM guests after reboot
...vhost.c | 16 ++++++++++++++-- > 2 files changed, 31 insertions(+), 5 deletions(-) > > diff --git a/drivers/vhost/net.c b/drivers/vhost/net.c > index e158159671fa..e4d5f843f9c0 100644 > --- a/drivers/vhost/net.c > +++ b/drivers/vhost/net.c > @@ -1505,10 +1505,13 @@ static long vhost_net_set_backend(struct vhost_net *n, unsigned index, int fd) > > mutex_lock(&n->dev.mutex); > r = vhost_dev_check_owner(&n->dev); > - if (r) > + if (r) { > + pr_debug("vhost_dev_check_owner index=%u fd=%d rc r=%d", index, fd, r); > goto err; > + } > &g...
2010 Oct 06
1
VHOST_NET_SET_BACKEND
Hi All, I dont know how to put this question, but bear with me. My query is how to invoke the ioctl request "VHOST_NET_SET_BACKEND" or how to set the backend, and when ? With Anticipation, Devi.
2010 Oct 06
1
VHOST_NET_SET_BACKEND
Hi All, I dont know how to put this question, but bear with me. My query is how to invoke the ioctl request "VHOST_NET_SET_BACKEND" or how to set the backend, and when ? With Anticipation, Devi.
2020 Feb 14
0
vhost changes (batched) in linux-next after 12/13 trigger random crashes in KVM guests after reboot
...host/vhost.h | 10 +++++----- > 3 files changed, 45 insertions(+), 10 deletions(-) > > diff --git a/drivers/vhost/net.c b/drivers/vhost/net.c > index e158159671fa..e4d5f843f9c0 100644 > --- a/drivers/vhost/net.c > +++ b/drivers/vhost/net.c > @@ -1505,10 +1505,13 @@ static long vhost_net_set_backend(struct vhost_net *n, unsigned index, int fd) > > mutex_lock(&n->dev.mutex); > r = vhost_dev_check_owner(&n->dev); > - if (r) > + if (r) { > + pr_debug("vhost_dev_check_owner index=%u fd=%d rc r=%d", index, fd, r); > goto err; > + } > &g...
2020 Feb 14
0
vhost changes (batched) in linux-next after 12/13 trigger random crashes in KVM guests after reboot
...ged, 45 insertions(+), 10 deletions(-) >>> >>> diff --git a/drivers/vhost/net.c b/drivers/vhost/net.c >>> index e158159671fa..e4d5f843f9c0 100644 >>> --- a/drivers/vhost/net.c >>> +++ b/drivers/vhost/net.c >>> @@ -1505,10 +1505,13 @@ static long vhost_net_set_backend(struct vhost_net *n, unsigned index, int fd) >>> >>> mutex_lock(&n->dev.mutex); >>> r = vhost_dev_check_owner(&n->dev); >>> - if (r) >>> + if (r) { >>> + pr_debug("vhost_dev_check_owner index=%u...
2012 Dec 27
3
[PATCH 1/2] vhost_net: correct error hanlding in vhost_net_set_backend()
...<jasowang at redhat.com> --- drivers/vhost/net.c | 14 +++++++++++--- 1 files changed, 11 insertions(+), 3 deletions(-) diff --git a/drivers/vhost/net.c b/drivers/vhost/net.c index ebd08b2..629d6b5 100644 --- a/drivers/vhost/net.c +++ b/drivers/vhost/net.c @@ -834,8 +834,10 @@ static long vhost_net_set_backend(struct vhost_net *n, unsigned index, int fd) vhost_net_enable_vq(n, vq); r = vhost_init_used(vq); - if (r) - goto err_vq; + if (r) { + sock = NULL; + goto err_used; + } n->tx_packets = 0; n->tx_zcopy_err = 0; @@ -859,8 +861,14 @@ static long vhost_net_set_backend(stru...
2012 Dec 27
3
[PATCH 1/2] vhost_net: correct error hanlding in vhost_net_set_backend()
...<jasowang at redhat.com> --- drivers/vhost/net.c | 14 +++++++++++--- 1 files changed, 11 insertions(+), 3 deletions(-) diff --git a/drivers/vhost/net.c b/drivers/vhost/net.c index ebd08b2..629d6b5 100644 --- a/drivers/vhost/net.c +++ b/drivers/vhost/net.c @@ -834,8 +834,10 @@ static long vhost_net_set_backend(struct vhost_net *n, unsigned index, int fd) vhost_net_enable_vq(n, vq); r = vhost_init_used(vq); - if (r) - goto err_vq; + if (r) { + sock = NULL; + goto err_used; + } n->tx_packets = 0; n->tx_zcopy_err = 0; @@ -859,8 +861,14 @@ static long vhost_net_set_backend(stru...
2019 Jun 13
2
memory leak in vhost_net_ioctl
...c mm/slab.c:3326 [inline] [<00000000ae0c4ae0>] kmem_cache_alloc_trace+0x13d/0x280 mm/slab.c:3553 [<0000000079ebab38>] kmalloc include/linux/slab.h:547 [inline] [<0000000079ebab38>] vhost_net_ubuf_alloc drivers/vhost/net.c:241 [inline] [<0000000079ebab38>] vhost_net_set_backend drivers/vhost/net.c:1534 [inline] [<0000000079ebab38>] vhost_net_ioctl+0xb43/0xc10 drivers/vhost/net.c:1716 [<000000009f6204a2>] vfs_ioctl fs/ioctl.c:46 [inline] [<000000009f6204a2>] file_ioctl fs/ioctl.c:509 [inline] [<000000009f6204a2>] do_vfs_ioctl+0x6...
2019 Jun 13
2
memory leak in vhost_net_ioctl
...c mm/slab.c:3326 [inline] [<00000000ae0c4ae0>] kmem_cache_alloc_trace+0x13d/0x280 mm/slab.c:3553 [<0000000079ebab38>] kmalloc include/linux/slab.h:547 [inline] [<0000000079ebab38>] vhost_net_ubuf_alloc drivers/vhost/net.c:241 [inline] [<0000000079ebab38>] vhost_net_set_backend drivers/vhost/net.c:1534 [inline] [<0000000079ebab38>] vhost_net_ioctl+0xb43/0xc10 drivers/vhost/net.c:1716 [<000000009f6204a2>] vfs_ioctl fs/ioctl.c:46 [inline] [<000000009f6204a2>] file_ioctl fs/ioctl.c:509 [inline] [<000000009f6204a2>] do_vfs_ioctl+0x6...
2018 Jun 21
1
[PATCH net] vhost_net: validate sock before trying to put its fd
Sock will be NULL if we pass -1 to vhost_net_set_backend(), but when we meet errors during ubuf allocation, the code does not check for NULL before calling sockfd_put(), this will lead NULL dereferencing. Fixing by checking sock pointer before. Fixes: bab632d69ee4 ("vhost: vhost TX zero-copy support") Reported-by: Dan Carpenter <dan.carpent...
2010 Jul 15
2
[PATCH] vhost-net: avoid flush under lock
...l S. Tsirkin <mst at redhat.com> --- drivers/vhost/net.c | 5 +++++ 1 files changed, 5 insertions(+), 0 deletions(-) diff --git a/drivers/vhost/net.c b/drivers/vhost/net.c index 28d7786..50df58e6 100644 --- a/drivers/vhost/net.c +++ b/drivers/vhost/net.c @@ -534,11 +534,16 @@ static long vhost_net_set_backend(struct vhost_net *n, unsigned index, int fd) rcu_assign_pointer(vq->private_data, sock); vhost_net_enable_vq(n, vq); done: + mutex_unlock(&vq->mutex); + if (oldsock) { vhost_net_flush_vq(n, index); fput(oldsock->file); } + mutex_unlock(&n->dev.mutex); + return 0...
2010 Jul 15
2
[PATCH] vhost-net: avoid flush under lock
...l S. Tsirkin <mst at redhat.com> --- drivers/vhost/net.c | 5 +++++ 1 files changed, 5 insertions(+), 0 deletions(-) diff --git a/drivers/vhost/net.c b/drivers/vhost/net.c index 28d7786..50df58e6 100644 --- a/drivers/vhost/net.c +++ b/drivers/vhost/net.c @@ -534,11 +534,16 @@ static long vhost_net_set_backend(struct vhost_net *n, unsigned index, int fd) rcu_assign_pointer(vq->private_data, sock); vhost_net_enable_vq(n, vq); done: + mutex_unlock(&vq->mutex); + if (oldsock) { vhost_net_flush_vq(n, index); fput(oldsock->file); } + mutex_unlock(&n->dev.mutex); + return 0...
2013 Jan 06
2
[PATCH V3 0/2] handle polling errors
...cking - drop the buggy tuntap patch Changes from v1: - restore the state before the ioctl when vhost_init_used() fails - log the error when meet polling errors in the data path - don't put into waitqueue when tun_chr_poll() return POLLERR Jason Wang (2): vhost_net: correct error handling in vhost_net_set_backend() vhost: handle polling errors drivers/vhost/net.c | 88 +++++++++++++++++++----------------------------- drivers/vhost/vhost.c | 31 +++++++++++++---- drivers/vhost/vhost.h | 2 +- 3 files changed, 59 insertions(+), 62 deletions(-)
2013 Jan 06
2
[PATCH V3 0/2] handle polling errors
...cking - drop the buggy tuntap patch Changes from v1: - restore the state before the ioctl when vhost_init_used() fails - log the error when meet polling errors in the data path - don't put into waitqueue when tun_chr_poll() return POLLERR Jason Wang (2): vhost_net: correct error handling in vhost_net_set_backend() vhost: handle polling errors drivers/vhost/net.c | 88 +++++++++++++++++++----------------------------- drivers/vhost/vhost.c | 31 +++++++++++++---- drivers/vhost/vhost.h | 2 +- 3 files changed, 59 insertions(+), 62 deletions(-)
2017 Jan 31
3
[PATCH] vhost: fix initialization for vq->is_le
...nter intuitive, but >> also real a problem because it breaks vhost_net. The bug was introduced to >> vhost_net with commit 2751c9882b94 ("vhost: cross-endian support for >> legacy devices"). The symptom is corruption of the vq's used.idx field >> (virtio) after VHOST_NET_SET_BACKEND was issued as a part of the vhost >> shutdown on a vq with pending descriptors. >> >> Let us make sure the outcome of vhost_init_is_le never depend on the state >> it is actually supposed to initialize, and fix virtio_net by removing the >> reset from vhost_vq_init_acc...
2017 Jan 31
3
[PATCH] vhost: fix initialization for vq->is_le
...nter intuitive, but >> also real a problem because it breaks vhost_net. The bug was introduced to >> vhost_net with commit 2751c9882b94 ("vhost: cross-endian support for >> legacy devices"). The symptom is corruption of the vq's used.idx field >> (virtio) after VHOST_NET_SET_BACKEND was issued as a part of the vhost >> shutdown on a vq with pending descriptors. >> >> Let us make sure the outcome of vhost_init_is_le never depend on the state >> it is actually supposed to initialize, and fix virtio_net by removing the >> reset from vhost_vq_init_acc...
2017 Jan 30
3
[PATCH] vhost: fix initialization for vq->is_le
...e_data is NULL. This is not only counter intuitive, but also real a problem because it breaks vhost_net. The bug was introduced to vhost_net with commit 2751c9882b94 ("vhost: cross-endian support for legacy devices"). The symptom is corruption of the vq's used.idx field (virtio) after VHOST_NET_SET_BACKEND was issued as a part of the vhost shutdown on a vq with pending descriptors. Let us make sure the outcome of vhost_init_is_le never depend on the state it is actually supposed to initialize, and fix virtio_net by removing the reset from vhost_vq_init_access. With the above, there is no reason for...
2017 Jan 30
3
[PATCH] vhost: fix initialization for vq->is_le
...e_data is NULL. This is not only counter intuitive, but also real a problem because it breaks vhost_net. The bug was introduced to vhost_net with commit 2751c9882b94 ("vhost: cross-endian support for legacy devices"). The symptom is corruption of the vq's used.idx field (virtio) after VHOST_NET_SET_BACKEND was issued as a part of the vhost shutdown on a vq with pending descriptors. Let us make sure the outcome of vhost_init_is_le never depend on the state it is actually supposed to initialize, and fix virtio_net by removing the reset from vhost_vq_init_access. With the above, there is no reason for...
2011 Jul 17
3
[PATCHv9] vhost: experimental tx zero-copy support
...ot;, err, len); - vhost_add_used_and_signal(&net->dev, vq, head, 0); + if (!zcopy) + vhost_add_used_and_signal(&net->dev, vq, head, 0); total_len += len; if (unlikely(total_len >= VHOST_NET_WEIGHT)) { vhost_poll_queue(&vq->poll); @@ -603,6 +661,7 @@ static long vhost_net_set_backend(struct vhost_net *n, unsigned index, int fd) { struct socket *sock, *oldsock; struct vhost_virtqueue *vq; + struct vhost_ubuf_ref *ubufs, *oldubufs = NULL; int r; mutex_lock(&n->dev.mutex); @@ -632,6 +691,13 @@ static long vhost_net_set_backend(struct vhost_net *n, unsigned index,...