[Virtio-fs] [PATCH] virtiofsd: Fix lo_destroy crash in g_hash_table_foreach_remove
Stefan Hajnoczi
stefanha at redhat.com
Wed Aug 7 09:50:30 UTC 2019
On Wed, Aug 07, 2019 at 10:31:52AM +0100, Dr. David Alan Gilbert (git) wrote:
> From: "Dr. David Alan Gilbert" <dgilbert at redhat.com>
>
> This fixes a crash in lo_destroy since g_hash_table_foreach_remove
> doesn't like the hashtable changing as it iterates, and unref_inode
> will remove entries.
>
> Avoid the g_hash_table_foreach_remove and use a dummy iterator to find
> one element of the table at a time.
>
> Fixes: virtiofsd: fix lo_destroy() resource leaks
>
> Signed-off-by: Dr. David Alan Gilbert <dgilbert at redhat.com>
> ---
> contrib/virtiofsd/passthrough_ll.c | 27 +++++++++++++--------------
> 1 file changed, 13 insertions(+), 14 deletions(-)
Reviewed-by: Stefan Hajnoczi <stefanha at redhat.com>
More information about the Virtio-fs
mailing list