qemu-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-commits] [qemu/qemu] 570011: vfio/iommufd: Fix memory leak


From: Peter Maydell
Subject: [Qemu-commits] [qemu/qemu] 570011: vfio/iommufd: Fix memory leak
Date: Tue, 19 Mar 2024 10:34:02 -0700

  Branch: refs/heads/master
  Home:   https://github.com/qemu/qemu
  Commit: 57001144628db65ef9b7dbbfb759101212696d6a
      
https://github.com/qemu/qemu/commit/57001144628db65ef9b7dbbfb759101212696d6a
  Author: Cédric Le Goater <clg@redhat.com>
  Date:   2024-03-19 (Tue, 19 Mar 2024)

  Changed paths:
    M hw/vfio/iommufd.c

  Log Message:
  -----------
  vfio/iommufd: Fix memory leak

Coverity reported a memory leak on variable 'contents' in routine
iommufd_cdev_getfd(). Use g_autofree variables to simplify the exit
path and get rid of g_free() calls.

Cc: Eric Auger <eric.auger@redhat.com>
Cc: Yi Liu <yi.l.liu@intel.com>
Fixes: CID 1540007
Fixes: 5ee3dc7af785 ("vfio/iommufd: Implement the iommufd backend")
Suggested-by: Zhenzhong Duan <zhenzhong.duan@intel.com>
Reviewed-by: Zhenzhong Duan <zhenzhong.duan@intel.com>
Signed-off-by: Cédric Le Goater <clg@redhat.com>


  Commit: 5b2b9450a2f83668bedd092b43233ad35f0d40bd
      
https://github.com/qemu/qemu/commit/5b2b9450a2f83668bedd092b43233ad35f0d40bd
  Author: Cédric Le Goater <clg@redhat.com>
  Date:   2024-03-19 (Tue, 19 Mar 2024)

  Changed paths:
    M hw/ppc/pnv_i2c.c

  Log Message:
  -----------
  ppc/pnv: I2C controller is not user creatable

The I2C controller is a subunit of the processor. Make it so and avoid
QEMU crashes.

  $ build/qemu-system-ppc64 -S -machine powernv9 -device pnv-i2c
  qemu-system-ppc64: ../hw/ppc/pnv_i2c.c:521: pnv_i2c_realize: Assertion 
`i2c->chip' failed.
  Aborted (core dumped)

Fixes: 263b81ee15af ("ppc/pnv: Add an I2C controller model")
Cc: Glenn Miles <milesg@linux.vnet.ibm.com>
Reported-by: Thomas Huth <thuth@redhat.com>
Reviewed-by: Thomas Huth <thuth@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Glenn Miles <milesg@linux.vnet.ibm.com>
Signed-off-by: Cédric Le Goater <clg@redhat.com>


  Commit: a7538ca0791880b6aeb2cc4cc8c00305e2d975f8
      
https://github.com/qemu/qemu/commit/a7538ca0791880b6aeb2cc4cc8c00305e2d975f8
  Author: Cédric Le Goater <clg@redhat.com>
  Date:   2024-03-19 (Tue, 19 Mar 2024)

  Changed paths:
    M hw/arm/xlnx-versal-virt.c
    M hw/block/m25p80.c
    M hw/ssi/aspeed_smc.c
    M include/hw/block/flash.h

  Log Message:
  -----------
  aspeed/smc: Only wire flash devices at reset

The Aspeed machines have many Static Memory Controllers (SMC), up to
8, which can only drive flash memory devices. Commit 27a2c66c92ec
("aspeed/smc: Wire CS lines at reset") tried to ease the definitions
of these devices by allowing flash devices from the command line to be
attached to a SSI bus. For that, the wiring of the CS lines of the
Aspeed SMC controller was moved at reset. Two assumptions are made
though, first that the device has a SSI_GPIO_CS GPIO line, which is
not always the case, and second that it is a flash device.

Correct this problem by ensuring that the devices attached to the bus
are of the correct flash type. This fixes a QEMU abort when devices
without a CS line, such as the max111x, are passed on the command
line.

While at it, export TYPE_M25P80 used in the Xilinx Versal Virtual
machine.

Resolves: https://gitlab.com/qemu-project/qemu/-/issues/2228
Fixes: 27a2c66c92ec ("aspeed/smc: Wire CS lines at reset")
Reported-by: Thomas Huth <thuth@redhat.com>
Reviewed-by: Thomas Huth <thuth@redhat.com>
Tested-by: Thomas Huth <thuth@redhat.com>
[ clg: minor fixes in the commit log ]
Signed-off-by: Cédric Le Goater <clg@redhat.com>


  Commit: 55f7c6a5f2bd82e1d2d0eac6eee0185ce0451815
      
https://github.com/qemu/qemu/commit/55f7c6a5f2bd82e1d2d0eac6eee0185ce0451815
  Author: Peter Maydell <peter.maydell@linaro.org>
  Date:   2024-03-19 (Tue, 19 Mar 2024)

  Changed paths:
    M tests/unit/meson.build

  Log Message:
  -----------
  tests: Raise timeouts for bufferiszero and crypto-tlscredsx509

On our gcov CI job, the bufferiszero and crypto-tlscredsx509
tests time out occasionally, making the job flaky. Double the
timeout on these two tests.

Cc: qemu-stable@nongnu.org
Resolves: https://gitlab.com/qemu-project/qemu/-/issues/2221
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Message-id: 20240312110815.116992-1-peter.maydell@linaro.org


  Commit: 7e9595e41502960b3827abbd3dac282d93b65693
      
https://github.com/qemu/qemu/commit/7e9595e41502960b3827abbd3dac282d93b65693
  Author: Peter Maydell <peter.maydell@linaro.org>
  Date:   2024-03-19 (Tue, 19 Mar 2024)

  Changed paths:
    M hw/arm/xlnx-versal-virt.c
    M hw/block/m25p80.c
    M hw/ppc/pnv_i2c.c
    M hw/ssi/aspeed_smc.c
    M hw/vfio/iommufd.c
    M include/hw/block/flash.h

  Log Message:
  -----------
  Merge tag 'pull-for-9.0-20240319' of https://github.com/legoater/qemu into 
staging

aspeed, pnv, vfio queue:

* user device fixes for Aspeed and PowerNV machines
* coverity fix for iommufd

# -----BEGIN PGP SIGNATURE-----
#
# iQIzBAABCAAdFiEEoPZlSPBIlev+awtgUaNDx8/77KEFAmX5mm0ACgkQUaNDx8/7
# 7KE/MQ/9GeX4yNBxY2iTATdmPXwjMw8AtKyfIQb605nIO0ch1Z98ywl5VMwCNohn
# ppY9L5bFpEASgRlFVm73X4DGxKyRGpRPqylsvINh0hKciRpmRkELHY3llhnXsd7P
# Q197pDtFr54FeX8j4+hSAu4paT97fPENlKn0J6lto2I1cXGcD1LYNDFhysoXdGme
# brJgo7KjQJZPZ560ZewskL5FWf3G9EkRjpqd8y0G5OtNmAPgAaahOMHhDCXan182
# J89I9CHI5xN45MRfAs8JamSaj/GyNsr4h04WhPa0+VZQ5vsaeW2Ekt4ypj+oAV+p
# wykhYzQk4ALZcmmph2flSAtLa7uheI+imyqubMthQCDj3G8onSQBMd5/4WRK6O49
# 0oE1DpPDEfhlJEQYxaYhOeqeA9iaP+w6V+yE+L5oGlMO66cR7GZsPu0x7kXailbH
# IoHw9mO+vMkpuyeP7M3hA8WRFCdFpf1Nn1Ao5Jz3KoiTyJWlIvX5VSaj12sjddQ2
# fU9SKu2Q5QqS5uQGakkY64EyUy7RkGIX6zY2NIscVe2lfAfKf3mZwu7OIuLjEy5O
# lRn35vWV8fOdRooKoDPTNcdBCaNPi+RApin8chOv5P+F+ie7+Twf9sb1AgH/pIcv
# HptvTXbvSFNbbdb+OE8a5qsqTvnrN8d31IXzrWRYsJB07x2IyoA=
# =zR3v
# -----END PGP SIGNATURE-----
# gpg: Signature made Tue 19 Mar 2024 14:00:13 GMT
# gpg:                using RSA key A0F66548F04895EBFE6B0B6051A343C7CFFBECA1
# gpg: Good signature from "Cédric Le Goater <clg@kaod.org>" [undefined]
# gpg: WARNING: This key is not certified with a trusted signature!
# gpg:          There is no indication that the signature belongs to the owner.
# Primary key fingerprint: A0F6 6548 F048 95EB FE6B  0B60 51A3 43C7 CFFB ECA1

* tag 'pull-for-9.0-20240319' of https://github.com/legoater/qemu:
  aspeed/smc: Only wire flash devices at reset
  ppc/pnv: I2C controller is not user creatable
  vfio/iommufd: Fix memory leak

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>


Compare: https://github.com/qemu/qemu/compare/ddc27d2ad936...7e9595e41502

To unsubscribe from these emails, change your notification settings at 
https://github.com/qemu/qemu/settings/notifications



reply via email to

[Prev in Thread] Current Thread [Next in Thread]