All of lore.kernel.org
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] qemu-sockets: use qapi_free_SocketAddress in cleanup
@ 2016-07-06 16:42 marcandre.lureau
  2016-07-06 20:18 ` Eric Blake
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: marcandre.lureau @ 2016-07-06 16:42 UTC (permalink / raw)
  To: qemu-devel; +Cc: pbonzini, Marc-André Lureau

From: Marc-André Lureau <marcandre.lureau@redhat.com>

Commit 74b6ce43e3 uses the wrong free API for a SocketAddress, that
may leak some linked data.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
---
 util/qemu-sockets.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/util/qemu-sockets.c b/util/qemu-sockets.c
index fb83d48..777af49 100644
--- a/util/qemu-sockets.c
+++ b/util/qemu-sockets.c
@@ -1012,7 +1012,7 @@ void socket_listen_cleanup(int fd, Error **errp)
         }
     }
 
-    g_free(addr);
+    qapi_free_SocketAddress(addr);
 }
 
 int socket_dgram(SocketAddress *remote, SocketAddress *local, Error **errp)
-- 
2.9.0

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [Qemu-devel] [PATCH] qemu-sockets: use qapi_free_SocketAddress in cleanup
  2016-07-06 16:42 [Qemu-devel] [PATCH] qemu-sockets: use qapi_free_SocketAddress in cleanup marcandre.lureau
@ 2016-07-06 20:18 ` Eric Blake
  2016-07-08  8:15 ` Shannon Zhao
  2016-07-08 14:03 ` Paolo Bonzini
  2 siblings, 0 replies; 4+ messages in thread
From: Eric Blake @ 2016-07-06 20:18 UTC (permalink / raw)
  To: marcandre.lureau, qemu-devel; +Cc: pbonzini

[-- Attachment #1: Type: text/plain, Size: 956 bytes --]

On 07/06/2016 10:42 AM, marcandre.lureau@redhat.com wrote:
> From: Marc-André Lureau <marcandre.lureau@redhat.com>
> 
> Commit 74b6ce43e3 uses the wrong free API for a SocketAddress, that
> may leak some linked data.
> 
> Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
> ---
>  util/qemu-sockets.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

Reviewed-by: Eric Blake <eblake@redhat.com>


> 
> diff --git a/util/qemu-sockets.c b/util/qemu-sockets.c
> index fb83d48..777af49 100644
> --- a/util/qemu-sockets.c
> +++ b/util/qemu-sockets.c
> @@ -1012,7 +1012,7 @@ void socket_listen_cleanup(int fd, Error **errp)
>          }
>      }
>  
> -    g_free(addr);
> +    qapi_free_SocketAddress(addr);
>  }
>  
>  int socket_dgram(SocketAddress *remote, SocketAddress *local, Error **errp)
> 

-- 
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 604 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [Qemu-devel] [PATCH] qemu-sockets: use qapi_free_SocketAddress in cleanup
  2016-07-06 16:42 [Qemu-devel] [PATCH] qemu-sockets: use qapi_free_SocketAddress in cleanup marcandre.lureau
  2016-07-06 20:18 ` Eric Blake
@ 2016-07-08  8:15 ` Shannon Zhao
  2016-07-08 14:03 ` Paolo Bonzini
  2 siblings, 0 replies; 4+ messages in thread
From: Shannon Zhao @ 2016-07-08  8:15 UTC (permalink / raw)
  To: marcandre.lureau, qemu-devel; +Cc: pbonzini



On 2016/7/7 0:42, marcandre.lureau@redhat.com wrote:
> From: Marc-André Lureau <marcandre.lureau@redhat.com>
> 
> Commit 74b6ce43e3 uses the wrong free API for a SocketAddress, that
> may leak some linked data.
> 
> Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
I'm planing to send a patch, then I find this :)

Reviewed-by: Shannon Zhao <shannon.zhao@linaro.org>

> ---
>  util/qemu-sockets.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/util/qemu-sockets.c b/util/qemu-sockets.c
> index fb83d48..777af49 100644
> --- a/util/qemu-sockets.c
> +++ b/util/qemu-sockets.c
> @@ -1012,7 +1012,7 @@ void socket_listen_cleanup(int fd, Error **errp)
>          }
>      }
>  
> -    g_free(addr);
> +    qapi_free_SocketAddress(addr);
>  }
>  
>  int socket_dgram(SocketAddress *remote, SocketAddress *local, Error **errp)
> 

-- 
Shannon

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [Qemu-devel] [PATCH] qemu-sockets: use qapi_free_SocketAddress in cleanup
  2016-07-06 16:42 [Qemu-devel] [PATCH] qemu-sockets: use qapi_free_SocketAddress in cleanup marcandre.lureau
  2016-07-06 20:18 ` Eric Blake
  2016-07-08  8:15 ` Shannon Zhao
@ 2016-07-08 14:03 ` Paolo Bonzini
  2 siblings, 0 replies; 4+ messages in thread
From: Paolo Bonzini @ 2016-07-08 14:03 UTC (permalink / raw)
  To: marcandre.lureau, qemu-devel



On 06/07/2016 18:42, marcandre.lureau@redhat.com wrote:
> From: Marc-André Lureau <marcandre.lureau@redhat.com>
> 
> Commit 74b6ce43e3 uses the wrong free API for a SocketAddress, that
> may leak some linked data.
> 
> Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
> ---
>  util/qemu-sockets.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/util/qemu-sockets.c b/util/qemu-sockets.c
> index fb83d48..777af49 100644
> --- a/util/qemu-sockets.c
> +++ b/util/qemu-sockets.c
> @@ -1012,7 +1012,7 @@ void socket_listen_cleanup(int fd, Error **errp)
>          }
>      }
>  
> -    g_free(addr);
> +    qapi_free_SocketAddress(addr);
>  }
>  
>  int socket_dgram(SocketAddress *remote, SocketAddress *local, Error **errp)
> 

Queued, thanks.

Paolo

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2016-07-08 14:03 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-07-06 16:42 [Qemu-devel] [PATCH] qemu-sockets: use qapi_free_SocketAddress in cleanup marcandre.lureau
2016-07-06 20:18 ` Eric Blake
2016-07-08  8:15 ` Shannon Zhao
2016-07-08 14:03 ` Paolo Bonzini

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.