Skip to contentSkip to conversation

hmp: free sev info

PATCH In review Marc-André Lureau 3 participants 4 messages Mar 19, 2018 – Mar 20, 2018

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 hmp: free sev info

Found thanks to ASAN:

Direct leak of 16 byte(s) in 1 object(s) allocated from:

    #0 0x7efe20417a38 in __interceptor_calloc (/lib64/libasan.so.4+0xdea38)
    #1 0x7efe1f7b2f75 in g_malloc0 ../glib/gmem.c:124
    #2 0x7efe1f7b3249 in g_malloc0_n ../glib/gmem.c:355
    #3 0x558272879162 in sev_get_info /home/elmarco/src/qemu/target/i386/sev.c:414
    #4 0x55827285113b in hmp_info_sev /home/elmarco/src/qemu/target/i386/monitor.c:684
    #5 0x5582724043b8 in handle_hmp_command /home/elmarco/src/qemu/monitor.c:3333
---
 target/i386/monitor.c | 2 ++
 1 file changed, 2 insertions(+)
target/i386/monitor.c +2 -0
index 011419eba2..a890b3c2ab 100644
@@ -696,6 +696,8 @@ void hmp_info_sev(Monitor *mon, const QDict *qdict)
     } else {
         monitor_printf(mon, "SEV is not enabled\n");
     }
+
+    qapi_free_SevInfo(info);
 }
 
 SevLaunchMeasureInfo *qmp_query_sev_launch_measure(Error **errp)
Signature · 1 line
2.16.2.521.g9aa15f885a
Reviewed-by on v1 1/1
#1 lore raw
Quoted 10 lines · Marc-André Lureau

Found thanks to ASAN:

Direct leak of 16 byte(s) in 1 object(s) allocated from:

     #0 0x7efe20417a38 in __interceptor_calloc (/lib64/libasan.so.4+0xdea38)
     #1 0x7efe1f7b2f75 in g_malloc0 ../glib/gmem.c:124
     #2 0x7efe1f7b3249 in g_malloc0_n ../glib/gmem.c:355
     #3 0x558272879162 in sev_get_info /home/elmarco/src/qemu/target/i386/sev.c:414
     #4 0x55827285113b in hmp_info_sev /home/elmarco/src/qemu/target/i386/monitor.c:684
     #5 0x5582724043b8 in handle_hmp_command /home/elmarco/src/qemu/monitor.c:3333
Quoted 4 lines
---
  target/i386/monitor.c | 2 ++
  1 file changed, 2 insertions(+)

Worth mentioning in the commit message that this was introduced in commit 63036314.

And safe for freeze, as it's fixing a memory usage bug in material new to the 2.12 release.

Signature · 3 lines
Eric Blake, Principal Software Engineer
Red Hat, Inc.           +1-919-301-3266
Virtualization:  qemu.org | libvirt.org
#2 lore raw
Quoted 16 lines · * Eric Blake ([email protected]) wrote:
Quoted 10 lines · Marc-André Lureau

Found thanks to ASAN:

Direct leak of 16 byte(s) in 1 object(s) allocated from:

     #0 0x7efe20417a38 in __interceptor_calloc (/lib64/libasan.so.4+0xdea38)
     #1 0x7efe1f7b2f75 in g_malloc0 ../glib/gmem.c:124
     #2 0x7efe1f7b3249 in g_malloc0_n ../glib/gmem.c:355
     #3 0x558272879162 in sev_get_info /home/elmarco/src/qemu/target/i386/sev.c:414
     #4 0x55827285113b in hmp_info_sev /home/elmarco/src/qemu/target/i386/monitor.c:684
     #5 0x5582724043b8 in handle_hmp_command /home/elmarco/src/qemu/monitor.c:3333
Quoted 4 lines
---
  target/i386/monitor.c | 2 ++
  1 file changed, 2 insertions(+)
Quoted 7 lines

Worth mentioning in the commit message that this was introduced in commit 63036314.

And safe for freeze, as it's fixing a memory usage bug in material new to the 2.12 release.

Thanks, I'll pick that up for HMP.

Dave

Quoted 4 lines
Signature · 3 lines
Eric Blake, Principal Software Engineer
Red Hat, Inc.           +1-919-301-3266
Virtualization:  qemu.org | libvirt.org

--
Dr. David Alan Gilbert / [email protected] / Manchester, UK

#3 lore raw
In reply to Eric Blake
Quoted 16 lines · * Eric Blake ([email protected]) wrote:
Quoted 10 lines · Marc-André Lureau

Found thanks to ASAN:

Direct leak of 16 byte(s) in 1 object(s) allocated from:

     #0 0x7efe20417a38 in __interceptor_calloc (/lib64/libasan.so.4+0xdea38)
     #1 0x7efe1f7b2f75 in g_malloc0 ../glib/gmem.c:124
     #2 0x7efe1f7b3249 in g_malloc0_n ../glib/gmem.c:355
     #3 0x558272879162 in sev_get_info /home/elmarco/src/qemu/target/i386/sev.c:414
     #4 0x55827285113b in hmp_info_sev /home/elmarco/src/qemu/target/i386/monitor.c:684
     #5 0x5582724043b8 in handle_hmp_command /home/elmarco/src/qemu/monitor.c:3333
Quoted 4 lines
---
  target/i386/monitor.c | 2 ++
  1 file changed, 2 insertions(+)
Quoted 4 lines

Worth mentioning in the commit message that this was introduced in commit 63036314.

Queued. I've added:

Fixes 63036314

to the commit message.

Dave

Quoted 7 lines

And safe for freeze, as it's fixing a memory usage bug in material new to the 2.12 release.

Signature · 3 lines
Eric Blake, Principal Software Engineer
Red Hat, Inc.           +1-919-301-3266
Virtualization:  qemu.org | libvirt.org

--
Dr. David Alan Gilbert / [email protected] / Manchester, UK