Displaying 9 results from an estimated 9 matches for "vhost_net_buf_unproduce".
2018 Mar 09
7
[PATCH net 0/3] Several fixes for vhost_net ptr_ring usage
Hi:
This small series try to fix several bugs of ptr_ring usage in
vhost_net. Please review.
Thanks
Alexander Potapenko (1):
vhost_net: initialize rx_ring in vhost_net_open()
Jason Wang (2):
vhost_net: keep private_data and rx_ring synced
vhost_net: examine pointer types during un-producing
drivers/net/tun.c | 3 ++-
drivers/vhost/net.c | 8 +++++---
include/linux/if_tun.h | 4
2018 Mar 09
0
[PATCH net 1/3] vhost_net: initialize rx_ring in vhost_net_open()
From: Alexander Potapenko <glider at google.com>
KMSAN reported a use of uninit memory in vhost_net_buf_unproduce()
while trying to access n->vqs[VHOST_NET_VQ_TX].rx_ring:
==================================================================
BUG: KMSAN: use of uninitialized memory in vhost_net_buf_unproduce+0x7bb/0x9a0 drivers/vho
et.c:170
CPU: 0 PID: 3021 Comm: syz-fuzzer Not tainted 4.16.0-rc4+ #3853
Hardwa...
2018 Mar 09
2
[PATCH net] vhost_net: examine pointer types during un-producing
...__skb_array_destroy_skb(ptr);
}
}
+EXPORT_SYMBOL_GPL(tun_ptr_free);
static void tun_queue_purge(struct tun_file *tfile)
{
diff --git a/drivers/vhost/net.c b/drivers/vhost/net.c
index 610cba2..54a138f 100644
--- a/drivers/vhost/net.c
+++ b/drivers/vhost/net.c
@@ -170,7 +170,7 @@ static void vhost_net_buf_unproduce(struct vhost_net_virtqueue *nvq)
if (nvq->rx_ring && !vhost_net_buf_is_empty(rxq)) {
ptr_ring_unconsume(nvq->rx_ring, rxq->queue + rxq->head,
vhost_net_buf_get_size(rxq),
- __skb_array_destroy_skb);
+ tun_ptr_free);
rxq->head = rxq->tail = 0;...
2018 Mar 09
0
[PATCH net 2/3] vhost_net: keep private_data and rx_ring synced
...), 2 deletions(-)
diff --git a/drivers/vhost/net.c b/drivers/vhost/net.c
index 60f1080..efb9306 100644
--- a/drivers/vhost/net.c
+++ b/drivers/vhost/net.c
@@ -973,6 +973,7 @@ static struct socket *vhost_net_stop_vq(struct vhost_net *n,
vhost_net_disable_vq(n, vq);
vq->private_data = NULL;
vhost_net_buf_unproduce(nvq);
+ nvq->rx_ring = NULL;
mutex_unlock(&vq->mutex);
return sock;
}
@@ -1162,14 +1163,14 @@ static long vhost_net_set_backend(struct vhost_net *n, unsigned index, int fd)
vhost_net_disable_vq(n, vq);
vq->private_data = sock;
vhost_net_buf_unproduce(nvq);
- if (index ==...
2020 Feb 13
0
vhost changes (batched) in linux-next after 12/13 trigger random crashes in KVM guests after reboot
...r = PTR_ERR(ubufs);
> + pr_debug("ubufs index=%u fd=%d err r=%d vq=%p", index, fd, r, vq);
> goto err_ubufs;
> }
>
> @@ -1541,11 +1548,15 @@ static long vhost_net_set_backend(struct vhost_net *n, unsigned index, int fd)
> vq->private_data = sock;
> vhost_net_buf_unproduce(nvq);
> r = vhost_vq_init_access(vq);
> - if (r)
> + if (r) {
> + pr_debug("init_access index=%u fd=%d r=%d vq=%p", index, fd, r, vq);
> goto err_used;
> + }
> r = vhost_net_enable_vq(n, vq);
> - if (r)
> + if (r) {
> + pr_debug("enabl...
2020 Feb 14
0
vhost changes (batched) in linux-next after 12/13 trigger random crashes in KVM guests after reboot
...r = PTR_ERR(ubufs);
> + pr_debug("ubufs index=%u fd=%d err r=%d vq=%p", index, fd, r, vq);
> goto err_ubufs;
> }
>
> @@ -1541,11 +1548,15 @@ static long vhost_net_set_backend(struct vhost_net *n, unsigned index, int fd)
> vq->private_data = sock;
> vhost_net_buf_unproduce(nvq);
> r = vhost_vq_init_access(vq);
> - if (r)
> + if (r) {
> + pr_debug("init_access index=%u fd=%d r=%d vq=%p", index, fd, r, vq);
> goto err_used;
> + }
> r = vhost_net_enable_vq(n, vq);
> - if (r)
> + if (r) {
> + pr_debug("enabl...
2020 Feb 14
0
vhost changes (batched) in linux-next after 12/13 trigger random crashes in KVM guests after reboot
...r, vq);
>>> goto err_ubufs;
>>> }
>>>
>>> @@ -1541,11 +1548,15 @@ static long vhost_net_set_backend(struct vhost_net *n, unsigned index, int fd)
>>> vq->private_data = sock;
>>> vhost_net_buf_unproduce(nvq);
>>> r = vhost_vq_init_access(vq);
>>> - if (r)
>>> + if (r) {
>>> + pr_debug("init_access index=%u fd=%d r=%d vq=%p", index, fd, r, vq);
>>> goto err_used;
&g...
2020 Feb 07
16
vhost changes (batched) in linux-next after 12/13 trigger random crashes in KVM guests after reboot
On Fri, Feb 07, 2020 at 08:47:14AM +0100, Christian Borntraeger wrote:
> Also adding Cornelia.
>
>
> On 06.02.20 23:17, Michael S. Tsirkin wrote:
> > On Thu, Feb 06, 2020 at 04:12:21PM +0100, Christian Borntraeger wrote:
> >>
> >>
> >> On 06.02.20 15:22, eperezma at redhat.com wrote:
> >>> Hi Christian.
> >>>
> >>>
2020 Feb 07
16
vhost changes (batched) in linux-next after 12/13 trigger random crashes in KVM guests after reboot
On Fri, Feb 07, 2020 at 08:47:14AM +0100, Christian Borntraeger wrote:
> Also adding Cornelia.
>
>
> On 06.02.20 23:17, Michael S. Tsirkin wrote:
> > On Thu, Feb 06, 2020 at 04:12:21PM +0100, Christian Borntraeger wrote:
> >>
> >>
> >> On 06.02.20 15:22, eperezma at redhat.com wrote:
> >>> Hi Christian.
> >>>
> >>>