lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date:   Thu, 10 Mar 2022 10:59:33 +0000
From:   Eli Cohen <elic@...dia.com>
To:     Jason Wang <jasowang@...hat.com>, "mst@...hat.com" <mst@...hat.com>
CC:     "kvm@...r.kernel.org" <kvm@...r.kernel.org>,
        "virtualization@...ts.linux-foundation.org" 
        <virtualization@...ts.linux-foundation.org>,
        "netdev@...r.kernel.org" <netdev@...r.kernel.org>,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
        Anirudh Rayabharam <mail@...rudhrb.com>
Subject: RE: [PATCH] vhost: allow batching hint without size

Tested-by: Eli Cohen <elic@...dia.com>

> -----Original Message-----
> From: Jason Wang <jasowang@...hat.com>
> Sent: Thursday, March 10, 2022 9:52 AM
> To: mst@...hat.com
> Cc: kvm@...r.kernel.org; virtualization@...ts.linux-foundation.org; netdev@...r.kernel.org; linux-kernel@...r.kernel.org; Jason Wang
> <jasowang@...hat.com>; Eli Cohen <elic@...dia.com>; Anirudh Rayabharam <mail@...rudhrb.com>
> Subject: [PATCH] vhost: allow batching hint without size
> 
> Commit e2ae38cf3d91 ("vhost: fix hung thread due to erroneous iotlb
> entries") tries to reject the IOTLB message whose size is zero. But
> the size is not necessarily meaningful, one example is the batching
> hint, so the commit breaks that.
> 
> Fixing this be reject zero size message only if the message is used to
> update/invalidate the IOTLB.
> 
> Fixes: e2ae38cf3d91 ("vhost: fix hung thread due to erroneous iotlb entries")
> Reported-by: Eli Cohen <elic@...dia.com>
> Cc: Anirudh Rayabharam <mail@...rudhrb.com>
> Signed-off-by: Jason Wang <jasowang@...hat.com>
> ---
>  drivers/vhost/vhost.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/vhost/vhost.c b/drivers/vhost/vhost.c
> index 082380c03a3e..1768362115c6 100644
> --- a/drivers/vhost/vhost.c
> +++ b/drivers/vhost/vhost.c
> @@ -1170,7 +1170,9 @@ ssize_t vhost_chr_write_iter(struct vhost_dev *dev,
>  		goto done;
>  	}
> 
> -	if (msg.size == 0) {
> +	if ((msg.type == VHOST_IOTLB_UPDATE ||
> +	     msg.type == VHOST_IOTLB_INVALIDATE) &&
> +	     msg.size == 0) {
>  		ret = -EINVAL;
>  		goto done;
>  	}
> --
> 2.18.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ