search for: vhost_net_reset_owner

Displaying 20 results from an estimated 67 matches for "vhost_net_reset_owner".

Did you mean: vhost_dev_reset_owner
2018 May 18
3
KASAN: use-after-free Read in vhost_chr_write_iter
...ev->iotlb) { > ret = -EFAULT; > break; > } > dev->iotlb = NULL; > > > Call Sequence: > CPU0 > ===== > vhost_net_chr_write_iter > vhost_chr_write_iter > vhost_process_iotlb_msg > > CPU1 > ===== > vhost_net_ioctl > vhost_net_reset_owner > vhost_dev_reset_owner > vhost_dev_cleanup Thanks a lot for the analysis. This could be addressed by simply protect it with dev mutex. Will post a patch.
2018 May 18
3
KASAN: use-after-free Read in vhost_chr_write_iter
...ev->iotlb) { > ret = -EFAULT; > break; > } > dev->iotlb = NULL; > > > Call Sequence: > CPU0 > ===== > vhost_net_chr_write_iter > vhost_chr_write_iter > vhost_process_iotlb_msg > > CPU1 > ===== > vhost_net_ioctl > vhost_net_reset_owner > vhost_dev_reset_owner > vhost_dev_cleanup Thanks a lot for the analysis. This could be addressed by simply protect it with dev mutex. Will post a patch.
2018 May 21
2
KASAN: use-after-free Read in vhost_chr_write_iter
...> > Call Sequence: > > > CPU0 > > > ===== > > > vhost_net_chr_write_iter > > > ????vhost_chr_write_iter > > > ??????? vhost_process_iotlb_msg > > > > > > CPU1 > > > ===== > > > vhost_net_ioctl > > > ????vhost_net_reset_owner > > > ??????? vhost_dev_reset_owner > > > ??????????? vhost_dev_cleanup > > > > Thanks a lot for the analysis. > > > > This could be addressed by simply protect it with dev mutex. > > > > Will post a patch. > > > > Could you ple...
2018 May 21
2
KASAN: use-after-free Read in vhost_chr_write_iter
...> > Call Sequence: > > > CPU0 > > > ===== > > > vhost_net_chr_write_iter > > > ????vhost_chr_write_iter > > > ??????? vhost_process_iotlb_msg > > > > > > CPU1 > > > ===== > > > vhost_net_ioctl > > > ????vhost_net_reset_owner > > > ??????? vhost_dev_reset_owner > > > ??????????? vhost_dev_cleanup > > > > Thanks a lot for the analysis. > > > > This could be addressed by simply protect it with dev mutex. > > > > Will post a patch. > > > > Could you ple...
2018 Aug 03
4
[PATCH net-next] vhost: switch to use new message format
...656f8 100644 --- a/drivers/vhost/net.c +++ b/drivers/vhost/net.c @@ -78,6 +78,10 @@ enum { }; enum { + VHOST_NET_BACKEND_FEATURES = (1ULL << VHOST_BACKEND_F_IOTLB_MSG_V2) +}; + +enum { VHOST_NET_VQ_RX = 0, VHOST_NET_VQ_TX = 1, VHOST_NET_VQ_MAX = 2, @@ -1399,6 +1403,21 @@ static long vhost_net_reset_owner(struct vhost_net *n) return err; } +static int vhost_net_set_backend_features(struct vhost_net *n, u64 features) +{ + int i; + + mutex_lock(&n->dev.mutex); + for (i = 0; i < VHOST_NET_VQ_MAX; ++i) { + mutex_lock(&n->vqs[i].vq.mutex); + n->vqs[i].vq.acked_backend_features...
2018 Aug 03
4
[PATCH net-next] vhost: switch to use new message format
...656f8 100644 --- a/drivers/vhost/net.c +++ b/drivers/vhost/net.c @@ -78,6 +78,10 @@ enum { }; enum { + VHOST_NET_BACKEND_FEATURES = (1ULL << VHOST_BACKEND_F_IOTLB_MSG_V2) +}; + +enum { VHOST_NET_VQ_RX = 0, VHOST_NET_VQ_TX = 1, VHOST_NET_VQ_MAX = 2, @@ -1399,6 +1403,21 @@ static long vhost_net_reset_owner(struct vhost_net *n) return err; } +static int vhost_net_set_backend_features(struct vhost_net *n, u64 features) +{ + int i; + + mutex_lock(&n->dev.mutex); + for (i = 0; i < VHOST_NET_VQ_MAX; ++i) { + mutex_lock(&n->vqs[i].vq.mutex); + n->vqs[i].vq.acked_backend_features...
2018 Aug 03
0
[PATCH net-next] vhost: switch to use new message format
...et.c > @@ -78,6 +78,10 @@ enum { > }; > > enum { > + VHOST_NET_BACKEND_FEATURES = (1ULL << VHOST_BACKEND_F_IOTLB_MSG_V2) > +}; > + > +enum { > VHOST_NET_VQ_RX = 0, > VHOST_NET_VQ_TX = 1, > VHOST_NET_VQ_MAX = 2, > @@ -1399,6 +1403,21 @@ static long vhost_net_reset_owner(struct vhost_net *n) > return err; > } > > +static int vhost_net_set_backend_features(struct vhost_net *n, u64 features) > +{ > + int i; > + > + mutex_lock(&n->dev.mutex); > + for (i = 0; i < VHOST_NET_VQ_MAX; ++i) { > + mutex_lock(&n->vqs[i].vq....
2018 Aug 06
1
[PATCH net-next V2] vhost: switch to use new message format
...656f8 100644 --- a/drivers/vhost/net.c +++ b/drivers/vhost/net.c @@ -78,6 +78,10 @@ enum { }; enum { + VHOST_NET_BACKEND_FEATURES = (1ULL << VHOST_BACKEND_F_IOTLB_MSG_V2) +}; + +enum { VHOST_NET_VQ_RX = 0, VHOST_NET_VQ_TX = 1, VHOST_NET_VQ_MAX = 2, @@ -1399,6 +1403,21 @@ static long vhost_net_reset_owner(struct vhost_net *n) return err; } +static int vhost_net_set_backend_features(struct vhost_net *n, u64 features) +{ + int i; + + mutex_lock(&n->dev.mutex); + for (i = 0; i < VHOST_NET_VQ_MAX; ++i) { + mutex_lock(&n->vqs[i].vq.mutex); + n->vqs[i].vq.acked_backend_features...
2018 Jan 25
1
[PATCH net] vhost_net: stop device during reset owner
...") Signed-off-by: Jason Wang <jasowang at redhat.com> --- drivers/vhost/net.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/vhost/net.c b/drivers/vhost/net.c index c7bdeb6..5636c7c 100644 --- a/drivers/vhost/net.c +++ b/drivers/vhost/net.c @@ -1208,6 +1208,7 @@ static long vhost_net_reset_owner(struct vhost_net *n) } vhost_net_stop(n, &tx_sock, &rx_sock); vhost_net_flush(n); + vhost_dev_stop(&n->dev); vhost_dev_reset_owner(&n->dev, umem); vhost_net_vq_reset(n); done: -- 2.7.4
2018 May 21
0
KASAN: use-after-free Read in vhost_chr_write_iter
...????????????????????? dev->iotlb = NULL; >> >> >> Call Sequence: >> CPU0 >> ===== >> vhost_net_chr_write_iter >> ????vhost_chr_write_iter >> ??????? vhost_process_iotlb_msg >> >> CPU1 >> ===== >> vhost_net_ioctl >> ????vhost_net_reset_owner >> ??????? vhost_dev_reset_owner >> ??????????? vhost_dev_cleanup > > Thanks a lot for the analysis. > > This could be addressed by simply protect it with dev mutex. > > Will post a patch. > Could you please help to test the attached patch? I've done some smoki...
2018 May 22
0
KASAN: use-after-free Read in vhost_chr_write_iter
...e: >>>> CPU0 >>>> ===== >>>> vhost_net_chr_write_iter >>>> ????vhost_chr_write_iter >>>> ??????? vhost_process_iotlb_msg >>>> >>>> CPU1 >>>> ===== >>>> vhost_net_ioctl >>>> ????vhost_net_reset_owner >>>> ??????? vhost_dev_reset_owner >>>> ??????????? vhost_dev_cleanup >>> Thanks a lot for the analysis. >>> >>> This could be addressed by simply protect it with dev mutex. >>> >>> Will post a patch. >>> >> Could...
2018 May 22
0
KASAN: use-after-free Read in vhost_chr_write_iter
...e: >>>> CPU0 >>>> ===== >>>> vhost_net_chr_write_iter >>>> ????vhost_chr_write_iter >>>> ??????? vhost_process_iotlb_msg >>>> >>>> CPU1 >>>> ===== >>>> vhost_net_ioctl >>>> ????vhost_net_reset_owner >>>> ??????? vhost_dev_reset_owner >>>> ??????????? vhost_dev_cleanup >>> Thanks a lot for the analysis. >>> >>> This could be addressed by simply protect it with dev mutex. >>> >>> Will post a patch. >>> >> Could...
2020 Jul 01
5
[PATCH 0/5]
Hi all: This series tries to support batched IOTLB updating vhost-vdpa. Currently vhost-vdpa accepts userspace mapping via IOTLB API, and it can only forward one mapping to IOMMU or device through IOMMU API or dma_map(). Though set_map() is designed to have the capability to pass an rbtree based mapping to vDPA device, it's still be called at least once for each VHOST_IOTLB_UPDATE or
2013 Apr 27
0
[PATCH] vhost: Move vhost-net zerocopy support fields to net.c
...c long vhost_net_set_backend(struct vhost_net *n, unsigned index, int fd) if (r) goto err_used; - oldubufs = vq->ubufs; - vq->ubufs = ubufs; + oldubufs = nvq->ubufs; + nvq->ubufs = ubufs; n->tx_packets = 0; n->tx_zcopy_err = 0; @@ -911,6 +1022,7 @@ static long vhost_net_reset_owner(struct vhost_net *n) vhost_net_stop(n, &tx_sock, &rx_sock); vhost_net_flush(n); err = vhost_dev_reset_owner(&n->dev); + vhost_net_reset_ubuf_info(n); done: mutex_unlock(&n->dev.mutex); if (tx_sock) @@ -986,11 +1098,17 @@ static long vhost_net_ioctl(struct file *f, u...
2013 Apr 27
0
[PATCH] vhost: Move vhost-net zerocopy support fields to net.c
...c long vhost_net_set_backend(struct vhost_net *n, unsigned index, int fd) if (r) goto err_used; - oldubufs = vq->ubufs; - vq->ubufs = ubufs; + oldubufs = nvq->ubufs; + nvq->ubufs = ubufs; n->tx_packets = 0; n->tx_zcopy_err = 0; @@ -911,6 +1022,7 @@ static long vhost_net_reset_owner(struct vhost_net *n) vhost_net_stop(n, &tx_sock, &rx_sock); vhost_net_flush(n); err = vhost_dev_reset_owner(&n->dev); + vhost_net_reset_ubuf_info(n); done: mutex_unlock(&n->dev.mutex); if (tx_sock) @@ -986,11 +1098,17 @@ static long vhost_net_ioctl(struct file *f, u...
2009 Dec 20
0
[PATCH 1/3] vhost: prevent modification of an active ring
...utex); } - mutex_unlock(&n->dev.mutex); vhost_net_flush(n); + mutex_unlock(&n->dev.mutex); } static long vhost_net_ioctl(struct file *f, unsigned int ioctl, @@ -587,8 +585,10 @@ static long vhost_net_ioctl(struct file *f, unsigned int ioctl, case VHOST_RESET_OWNER: return vhost_net_reset_owner(n); default: + mutex_lock(&n->dev.mutex); r = vhost_dev_ioctl(&n->dev, ioctl, arg); vhost_net_flush(n); + mutex_unlock(&n->dev.mutex); return r; } } diff --git a/drivers/vhost/vhost.c b/drivers/vhost/vhost.c index e7b4dea..29f1675 100644 --- a/drivers/vhost/vhos...
2009 Dec 20
0
[PATCH 1/3] vhost: prevent modification of an active ring
...utex); } - mutex_unlock(&n->dev.mutex); vhost_net_flush(n); + mutex_unlock(&n->dev.mutex); } static long vhost_net_ioctl(struct file *f, unsigned int ioctl, @@ -587,8 +585,10 @@ static long vhost_net_ioctl(struct file *f, unsigned int ioctl, case VHOST_RESET_OWNER: return vhost_net_reset_owner(n); default: + mutex_lock(&n->dev.mutex); r = vhost_dev_ioctl(&n->dev, ioctl, arg); vhost_net_flush(n); + mutex_unlock(&n->dev.mutex); return r; } } diff --git a/drivers/vhost/vhost.c b/drivers/vhost/vhost.c index e7b4dea..29f1675 100644 --- a/drivers/vhost/vhos...
2020 Sep 09
0
[PATCH] vhost: new vhost_vdpa SET/GET_BACKEND_FEATURES handlers
...t; return -EFAULT; > if (features & ~VHOST_NET_BACKEND_FEATURES) > return -EOPNOTSUPP; > - vhost_set_backend_features(&n->dev, features); > + vhost_net_set_backend_features(&n->dev, features); > return 0; > case VHOST_RESET_OWNER: > return vhost_net_reset_owner(n); > diff --git a/drivers/vhost/vdpa.c b/drivers/vhost/vdpa.c > index 3fab94f88894..ade33c566a81 100644 > --- a/drivers/vhost/vdpa.c > +++ b/drivers/vhost/vdpa.c > @@ -344,6 +344,33 @@ static long vhost_vdpa_set_config_call(struct vhost_vdpa > *v, u32 __user *argp) > return...
2020 Jun 18
6
[PATCH RFC 0/5] support batched IOTLB updating in vhost-vdpa
Hi all: This series tries to support batched IOTLB updating vhost-vdpa. Currently vhost-vdpa accepts userspace mapping via IOTLB API, and it can only forward one mapping to IOMMU or device through IOMMU API or dma_map(). Though set_map() is deisgend to have the capability to pass an rbtree based mapping to vDPA device, it's still be called at least once for each VHOST_IOTLB_UPDATE or
2009 Dec 20
0
[PATCH 2/3] vhost: add access_ok checks
...l, @@ -580,8 +592,7 @@ static long vhost_net_ioctl(struct file *f, unsigned int ioctl, return r; if (features & ~VHOST_FEATURES) return -EOPNOTSUPP; - vhost_net_set_features(n, features); - return 0; + return vhost_net_set_features(n, features); case VHOST_RESET_OWNER: return vhost_net_reset_owner(n); default: diff --git a/drivers/vhost/vhost.c b/drivers/vhost/vhost.c index 29f1675..33e06bf 100644 --- a/drivers/vhost/vhost.c +++ b/drivers/vhost/vhost.c @@ -224,6 +224,91 @@ void vhost_dev_cleanup(struct vhost_dev *dev) dev->mm = NULL; } +static int log_access_ok(void __user *log_bas...