All of lore.kernel.org
 help / color / mirror / Atom feed
From: Thomas Huth <thuth@redhat.com>
To: qemu-devel@nongnu.org
Cc: "Stefan Hajnoczi" <stefanha@redhat.com>,
	qemu-stable@nongnu.org, "Fabiano Rosas" <farosas@suse.de>,
	"Philippe Mathieu-Daudé" <philmd@linaro.org>
Subject: [PULL 10/13] s390x: Fix leak in machine_set_loadparm
Date: Wed, 14 May 2025 13:27:30 +0200	[thread overview]
Message-ID: <20250514112733.456644-11-thuth@redhat.com> (raw)
In-Reply-To: <20250514112733.456644-1-thuth@redhat.com>

From: Fabiano Rosas <farosas@suse.de>

ASAN spotted a leaking string in machine_set_loadparm():

Direct leak of 9 byte(s) in 1 object(s) allocated from:
    #0 0x560ffb5bb379 in malloc ../projects/compiler-rt/lib/asan/asan_malloc_linux.cpp:69:3
    #1 0x7f1aca926518 in g_malloc ../glib/gmem.c:106
    #2 0x7f1aca94113e in g_strdup ../glib/gstrfuncs.c:364
    #3 0x560ffc8afbf9 in qobject_input_type_str ../qapi/qobject-input-visitor.c:542:12
    #4 0x560ffc8a80ff in visit_type_str ../qapi/qapi-visit-core.c:349:10
    #5 0x560ffbe6053a in machine_set_loadparm ../hw/s390x/s390-virtio-ccw.c:802:10
    #6 0x560ffc0c5e52 in object_property_set ../qom/object.c:1450:5
    #7 0x560ffc0d4175 in object_property_set_qobject ../qom/qom-qobject.c:28:10
    #8 0x560ffc0c6004 in object_property_set_str ../qom/object.c:1458:15
    #9 0x560ffbe2ae60 in update_machine_ipl_properties ../hw/s390x/ipl.c:569:9
    #10 0x560ffbe2aa65 in s390_ipl_update_diag308 ../hw/s390x/ipl.c:594:5
    #11 0x560ffbdee132 in handle_diag_308 ../target/s390x/diag.c:147:9
    #12 0x560ffbebb956 in helper_diag ../target/s390x/tcg/misc_helper.c:137:9
    #13 0x7f1a3c51c730  (/memfd:tcg-jit (deleted)+0x39730)

Cc: qemu-stable@nongnu.org
Signed-off-by: Fabiano Rosas <farosas@suse.de>
Message-ID: <20250509174938.25935-1-farosas@suse.de>
Fixes: 1fd396e3228 ("s390x: Register TYPE_S390_CCW_MACHINE properties as class properties")
Reviewed-by: Thomas Huth <thuth@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Signed-off-by: Thomas Huth <thuth@redhat.com>
---
 hw/s390x/s390-virtio-ccw.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/hw/s390x/s390-virtio-ccw.c b/hw/s390x/s390-virtio-ccw.c
index 431d6b782a8..f69a4d8ed31 100644
--- a/hw/s390x/s390-virtio-ccw.c
+++ b/hw/s390x/s390-virtio-ccw.c
@@ -771,6 +771,7 @@ static void machine_set_loadparm(Object *obj, Visitor *v,
     }
 
     s390_ipl_fmt_loadparm(ms->loadparm, val, errp);
+    g_free(val);
 }
 
 static void ccw_machine_class_init(ObjectClass *oc, const void *data)
-- 
2.49.0



  parent reply	other threads:[~2025-05-14 11:29 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-05-14 11:27 [PULL 00/13] s390x obsolete machine removal & misc fixes Thomas Huth
2025-05-14 11:27 ` [PULL 01/13] hw/s390x/s390-virtio-ccw: Remove the deprecated 2.10 machine type Thomas Huth
2025-05-14 11:27 ` [PULL 02/13] hw/s390x/s390-virtio-ccw: Remove the deprecated 2.11 " Thomas Huth
2025-05-14 11:27 ` [PULL 03/13] hw/s390x/event-facility: Remove the obsolete "allow_all_mask_sizes" code Thomas Huth
2025-05-14 11:27 ` [PULL 04/13] target/s390x: Rename the qemu_V2_11 feature set to qemu_MIN Thomas Huth
2025-05-14 11:27 ` [PULL 05/13] hw/s390x/s390-virtio-ccw: Remove the deprecated 2.12 machine type Thomas Huth
2025-05-14 11:27 ` [PULL 06/13] hw/s390x/s390-virtio-ccw: Remove the deprecated 3.0 " Thomas Huth
2025-05-14 11:27 ` [PULL 07/13] hw/s390x: Remove the obsolete hpage_1m_allowed switch Thomas Huth
2025-05-14 11:27 ` [PULL 08/13] hw/s390x/s390-virtio-ccw: Remove the deprecated 3.1 machine type Thomas Huth
2025-05-14 11:27 ` [PULL 09/13] hw/s390x/s390-virtio-ccw: Remove the deprecated 4.0 " Thomas Huth
2025-05-14 11:27 ` Thomas Huth [this message]
2025-05-14 11:27 ` [PULL 11/13] include/hw/dma/xlnx_dpdma: Remove dependency on console.h Thomas Huth
2025-05-14 11:27 ` [PULL 12/13] tests/functional/test_s390x_tuxrun: Check whether the machine is available Thomas Huth
2025-05-14 11:27 ` [PULL 13/13] tests/functional: Skip the screendump tests if the command is not available Thomas Huth
2025-05-15 21:52 ` [PULL 00/13] s390x obsolete machine removal & misc fixes Stefan Hajnoczi

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20250514112733.456644-11-thuth@redhat.com \
    --to=thuth@redhat.com \
    --cc=farosas@suse.de \
    --cc=philmd@linaro.org \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-stable@nongnu.org \
    --cc=stefanha@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.