qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PULL 0/2] hmp queue
@ 2018-03-20 12:41 Dr. David Alan Gilbert (git)
  2018-03-20 12:41 ` [Qemu-devel] [PULL 1/2] HMP: Initialize err before using Dr. David Alan Gilbert (git)
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Dr. David Alan Gilbert (git) @ 2018-03-20 12:41 UTC (permalink / raw)
  To: qemu-devel; +Cc: marcandre.lureau, jixiang_zhang

From: "Dr. David Alan Gilbert" <dgilbert@redhat.com>

The following changes since commit 4bdc24fa018901892bb8a5bd1808ebd605f4c64d:

  Merge remote-tracking branch 'remotes/ericb/tags/pull-qapi-2018-03-12-v4' into staging (2018-03-20 09:51:49 +0000)

are available in the Git repository at:

  git://github.com/dagrh/qemu.git tags/pull-hmp-20180320

for you to fetch changes up to 95372184b7acdfd82ee748b6f0c6df1d839982ba:

  hmp: free sev info (2018-03-20 12:32:06 +0000)

----------------------------------------------------------------
HMP fixes for 2.12

----------------------------------------------------------------
Marc-André Lureau (1):
      hmp: free sev info

zhangjixiang (1):
      HMP: Initialize err before using

 hmp.c                 | 2 +-
 target/i386/monitor.c | 2 ++
 2 files changed, 3 insertions(+), 1 deletion(-)

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

* [Qemu-devel] [PULL 1/2] HMP: Initialize err before using
  2018-03-20 12:41 [Qemu-devel] [PULL 0/2] hmp queue Dr. David Alan Gilbert (git)
@ 2018-03-20 12:41 ` Dr. David Alan Gilbert (git)
  2018-03-20 12:41 ` [Qemu-devel] [PULL 2/2] hmp: free sev info Dr. David Alan Gilbert (git)
  2018-03-20 19:02 ` [Qemu-devel] [PULL 0/2] hmp queue Peter Maydell
  2 siblings, 0 replies; 4+ messages in thread
From: Dr. David Alan Gilbert (git) @ 2018-03-20 12:41 UTC (permalink / raw)
  To: qemu-devel; +Cc: marcandre.lureau, jixiang_zhang

From: zhangjixiang <jixiang_zhang@h3c.com>

When bdrv_snapshot_delete return fail, the errp will not be
assigned a valid value in error_propagate as errp didn't be
initialized in hmp_delvm, then error_reportf_err will use an
uninitialized value(call by hmp_delvm), and qemu crash.

Signed-off-by: zhangjixiang <jixiang_zhang@h3c.com>
Reviewed-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
---
 hmp.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/hmp.c b/hmp.c
index ba9e299ee2..fd13d5b56a 100644
--- a/hmp.c
+++ b/hmp.c
@@ -1321,7 +1321,7 @@ void hmp_savevm(Monitor *mon, const QDict *qdict)
 void hmp_delvm(Monitor *mon, const QDict *qdict)
 {
     BlockDriverState *bs;
-    Error *err;
+    Error *err = NULL;
     const char *name = qdict_get_str(qdict, "name");
 
     if (bdrv_all_delete_snapshot(name, &bs, &err) < 0) {
-- 
2.14.3

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

* [Qemu-devel] [PULL 2/2] hmp: free sev info
  2018-03-20 12:41 [Qemu-devel] [PULL 0/2] hmp queue Dr. David Alan Gilbert (git)
  2018-03-20 12:41 ` [Qemu-devel] [PULL 1/2] HMP: Initialize err before using Dr. David Alan Gilbert (git)
@ 2018-03-20 12:41 ` Dr. David Alan Gilbert (git)
  2018-03-20 19:02 ` [Qemu-devel] [PULL 0/2] hmp queue Peter Maydell
  2 siblings, 0 replies; 4+ messages in thread
From: Dr. David Alan Gilbert (git) @ 2018-03-20 12:41 UTC (permalink / raw)
  To: qemu-devel; +Cc: marcandre.lureau, jixiang_zhang

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

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

Fixes: 63036314
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Message-Id: <20180319175823.22111-1-marcandre.lureau@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
---
 target/i386/monitor.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/target/i386/monitor.c b/target/i386/monitor.c
index 011419eba2..a890b3c2ab 100644
--- a/target/i386/monitor.c
+++ b/target/i386/monitor.c
@@ -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)
-- 
2.14.3

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

* Re: [Qemu-devel] [PULL 0/2] hmp queue
  2018-03-20 12:41 [Qemu-devel] [PULL 0/2] hmp queue Dr. David Alan Gilbert (git)
  2018-03-20 12:41 ` [Qemu-devel] [PULL 1/2] HMP: Initialize err before using Dr. David Alan Gilbert (git)
  2018-03-20 12:41 ` [Qemu-devel] [PULL 2/2] hmp: free sev info Dr. David Alan Gilbert (git)
@ 2018-03-20 19:02 ` Peter Maydell
  2 siblings, 0 replies; 4+ messages in thread
From: Peter Maydell @ 2018-03-20 19:02 UTC (permalink / raw)
  To: Dr. David Alan Gilbert (git)
  Cc: QEMU Developers, Marc-André Lureau, jixiang_zhang

On 20 March 2018 at 12:41, Dr. David Alan Gilbert (git)
<dgilbert@redhat.com> wrote:
> From: "Dr. David Alan Gilbert" <dgilbert@redhat.com>
>
> The following changes since commit 4bdc24fa018901892bb8a5bd1808ebd605f4c64d:
>
>   Merge remote-tracking branch 'remotes/ericb/tags/pull-qapi-2018-03-12-v4' into staging (2018-03-20 09:51:49 +0000)
>
> are available in the Git repository at:
>
>   git://github.com/dagrh/qemu.git tags/pull-hmp-20180320
>
> for you to fetch changes up to 95372184b7acdfd82ee748b6f0c6df1d839982ba:
>
>   hmp: free sev info (2018-03-20 12:32:06 +0000)
>
> ----------------------------------------------------------------
> HMP fixes for 2.12
>
> ----------------------------------------------------------------
> Marc-André Lureau (1):
>       hmp: free sev info
>
> zhangjixiang (1):
>       HMP: Initialize err before using
>

Applied, thanks.

-- PMM

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

end of thread, other threads:[~2018-03-20 19:03 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-03-20 12:41 [Qemu-devel] [PULL 0/2] hmp queue Dr. David Alan Gilbert (git)
2018-03-20 12:41 ` [Qemu-devel] [PULL 1/2] HMP: Initialize err before using Dr. David Alan Gilbert (git)
2018-03-20 12:41 ` [Qemu-devel] [PULL 2/2] hmp: free sev info Dr. David Alan Gilbert (git)
2018-03-20 19:02 ` [Qemu-devel] [PULL 0/2] hmp queue Peter Maydell

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).