qemu/hw/s390x
Fabiano Rosas bdf12f2a56 s390x: Fix leak in machine_set_loadparm
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: 1fd396e322 ("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>
2025-05-14 06:58:59 +02:00
..
3270-ccw.c qom: Have class_init() take a const data argument 2025-04-25 17:00:41 +02:00
ap-bridge.c qom: Make InterfaceInfo[] uses const 2025-04-25 17:00:41 +02:00
ap-device.c qom: Have class_init() take a const data argument 2025-04-25 17:00:41 +02:00
ccw-device.c qom: Have class_init() take a const data argument 2025-04-25 17:00:41 +02:00
ccw-device.h hw/s390x: Restrict "loadparm" property to devices that can be used for booting 2024-11-18 10:54:42 +01:00
cpu-topology.c qapi/machine: Rename CpuS390* to S390Cpu*, and drop 'prefix' 2024-09-10 13:22:47 +02:00
css-bridge.c qom: Make InterfaceInfo[] uses const 2025-04-25 17:00:41 +02:00
css.c include/system: Move exec/address-spaces.h to system/address-spaces.h 2025-04-23 14:08:21 -07:00
event-facility.c hw/s390x/event-facility: Remove the obsolete "allow_all_mask_sizes" code 2025-05-14 06:56:09 +02:00
ipl.c target/s390x: Return UVC cmd code, RC and RRC value when DIAG 308 Subcode 10 fails to enter secure mode 2025-04-30 09:48:57 +02:00
ipl.h target/s390x: Return UVC cmd code, RC and RRC value when DIAG 308 Subcode 10 fails to enter secure mode 2025-04-30 09:48:57 +02:00
Kconfig s390x: virtio-mem support 2024-12-21 20:15:06 +01:00
meson.build s390x: virtio-mem support 2024-12-21 20:15:06 +01:00
s390-ccw.c qom: Have class_init() take a const data argument 2025-04-25 17:00:41 +02:00
s390-hypercall.c s390x/s390-hypercall: introduce DIAG500 STORAGE_LIMIT 2024-12-21 15:59:59 +01:00
s390-hypercall.h s390x/s390-hypercall: introduce DIAG500 STORAGE_LIMIT 2024-12-21 15:59:59 +01:00
s390-pci-bus.c qom: Make InterfaceInfo[] uses const 2025-04-25 17:00:41 +02:00
s390-pci-inst.c exec/cpu-all: remove exec/target_page include 2025-04-23 15:04:57 -07:00
s390-pci-kvm.c s390x/pci: refresh fh before disabling aif 2024-01-19 11:38:32 +01:00
s390-pci-vfio.c vfio: Introduce a new header file for helper services 2025-04-25 09:01:37 +02:00
s390-skeys-kvm.c qom: Have class_init() take a const data argument 2025-04-25 17:00:41 +02:00
s390-skeys.c qom: Have class_init() take a const data argument 2025-04-25 17:00:41 +02:00
s390-stattrib-kvm.c qom: Have class_init() take a const data argument 2025-04-25 17:00:41 +02:00
s390-stattrib.c qom: Have class_init() take a const data argument 2025-04-25 17:00:41 +02:00
s390-virtio-ccw.c s390x: Fix leak in machine_set_loadparm 2025-05-14 06:58:59 +02:00
sclp.c qom: Have class_init() take a const data argument 2025-04-25 17:00:41 +02:00
sclpcpu.c qom: Have class_init() take a const data argument 2025-04-25 17:00:41 +02:00
sclpquiesce.c qom: Have class_init() take a const data argument 2025-04-25 17:00:41 +02:00
tod-kvm.c qom: Have class_init() take a const data argument 2025-04-25 17:00:41 +02:00
tod-tcg.c qom: Have class_init() take a const data argument 2025-04-25 17:00:41 +02:00
tod.c qom: Have class_init() take a const data argument 2025-04-25 17:00:41 +02:00
trace-events hw/s390x: Introduce s390_skeys_get|set() helpers 2024-06-19 12:42:03 +02:00
trace.h trace: switch position of headers to what Meson requires 2020-08-21 06:18:24 -04:00
vhost-scsi-ccw.c qom: Have class_init() take a const data argument 2025-04-25 17:00:41 +02:00
vhost-user-fs-ccw.c qom: Have class_init() take a const data argument 2025-04-25 17:00:41 +02:00
vhost-vsock-ccw.c qom: Have class_init() take a const data argument 2025-04-25 17:00:41 +02:00
virtio-ccw-9p.c qom: Have class_init() take a const data argument 2025-04-25 17:00:41 +02:00
virtio-ccw-balloon.c qom: Have class_init() take a const data argument 2025-04-25 17:00:41 +02:00
virtio-ccw-blk.c qom: Have class_init() take a const data argument 2025-04-25 17:00:41 +02:00
virtio-ccw-crypto.c qom: Have class_init() take a const data argument 2025-04-25 17:00:41 +02:00
virtio-ccw-gpu.c qom: Have class_init() take a const data argument 2025-04-25 17:00:41 +02:00
virtio-ccw-input.c qom: Have class_init() take a const data argument 2025-04-25 17:00:41 +02:00
virtio-ccw-md-stubs.c s390x/virtio-ccw: add support for virtio based memory devices 2024-12-21 15:59:59 +01:00
virtio-ccw-md.c qom: Make InterfaceInfo[] uses const 2025-04-25 17:00:41 +02:00
virtio-ccw-md.h s390x/virtio-ccw: add support for virtio based memory devices 2024-12-21 15:59:59 +01:00
virtio-ccw-mem.c qom: Have class_init() take a const data argument 2025-04-25 17:00:41 +02:00
virtio-ccw-mem.h s390x: virtio-mem support 2024-12-21 20:15:06 +01:00
virtio-ccw-net.c qom: Have class_init() take a const data argument 2025-04-25 17:00:41 +02:00
virtio-ccw-rng.c qom: Have class_init() take a const data argument 2025-04-25 17:00:41 +02:00
virtio-ccw-scsi.c qom: Have class_init() take a const data argument 2025-04-25 17:00:41 +02:00
virtio-ccw-serial.c qom: Have class_init() take a const data argument 2025-04-25 17:00:41 +02:00
virtio-ccw.c qom: Have class_init() take a const data argument 2025-04-25 17:00:41 +02:00
virtio-ccw.h hw/s390/virtio-ccw: Convert to three-phase reset 2024-09-13 15:31:43 +01:00