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]
Message-ID: <d8fef7b4-d01c-98ad-c3b1-4c48f482ce76@redhat.com>
Date:   Fri, 26 Mar 2021 12:13:31 +0100
From:   David Hildenbrand <david@...hat.com>
To:     Liu Xiang <liu.xiang@...ngsmart.com>, mst@...hat.com
Cc:     jasowang@...hat.com, virtualization@...ts.linux-foundation.org,
        linux-kernel@...r.kernel.org, liuxiang_1999@....com,
        liuxiang1999@...il.com
Subject: Re: [PATCH] virtio-balloon: move release_pages_balloon() outside of
 mutex_unlock(&vb->balloon_lock)

On 26.03.21 10:53, Liu Xiang wrote:
> Since pages have been deflated to a local list,
> there is no race between fill and leak.
> 
> Signed-off-by: Liu Xiang <liu.xiang@...ngsmart.com>
> ---
>   drivers/virtio/virtio_balloon.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/virtio/virtio_balloon.c b/drivers/virtio/virtio_balloon.c
> index 8985fc2ce..7da25b87f 100644
> --- a/drivers/virtio/virtio_balloon.c
> +++ b/drivers/virtio/virtio_balloon.c
> @@ -303,8 +303,8 @@ static unsigned leak_balloon(struct virtio_balloon *vb, size_t num)
>   	 */
>   	if (vb->num_pfns != 0)
>   		tell_host(vb, vb->deflate_vq);
> -	release_pages_balloon(vb, &pages);
>   	mutex_unlock(&vb->balloon_lock);
> +	release_pages_balloon(vb, &pages);
>   	return num_freed_pages;
>   }
>   
> 

I think this should be fine

Reviewed-by: David Hildenbrand <david@...hat.com>

-- 
Thanks,

David / dhildenb

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ