Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: qemu/qemu
base: 8acf865084a1
Choose a base ref
...
head repository: qemu/qemu
compare: b300c1344654
Choose a head ref
  • 3 commits
  • 2 files changed
  • 3 contributors

Commits on May 24, 2023

  1. vfio/pci: Fix a use-after-free issue

    vbasedev->name is freed wrongly which leads to garbage VFIO trace log.
    Fix it by allocating a dup of vbasedev->name and then free the dup.
    
    Fixes: 2dca1b3 ("vfio/pci: add support for VF token")
    Suggested-by: Alex Williamson <alex.williamson@redhat.com>
    Signed-off-by: Zhenzhong Duan <zhenzhong.duan@intel.com>
    Reviewed-by: Cédric Le Goater <clg@redhat.com>
    Reviewed-by: Matthew Rosato <mjrosato@linux.ibm.com>
    Acked-by: Alex Williamson <alex.williamson@redhat.com>
    Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
    Signed-off-by: Cédric Le Goater <clg@redhat.com>
    duanzhenzhong authored and legoater committed May 24, 2023
    Copy the full SHA
    b83b40b View commit details
    Browse the repository at this point in the history
  2. util/vfio-helpers: Use g_file_read_link()

    When _FORTIFY_SOURCE=2, glibc version is 2.35, and GCC version is
    12.1.0, the compiler complains as follows:
    
    In file included from /usr/include/features.h:490,
                     from /usr/include/bits/libc-header-start.h:33,
                     from /usr/include/stdint.h:26,
                     from /usr/lib/gcc/aarch64-unknown-linux-gnu/12.1.0/include/stdint.h:9,
                     from /home/alarm/q/var/qemu/include/qemu/osdep.h:94,
                     from ../util/vfio-helpers.c:13:
    In function 'readlink',
        inlined from 'sysfs_find_group_file' at ../util/vfio-helpers.c:116:9,
        inlined from 'qemu_vfio_init_pci' at ../util/vfio-helpers.c:326:18,
        inlined from 'qemu_vfio_open_pci' at ../util/vfio-helpers.c:517:9:
    /usr/include/bits/unistd.h:119:10: error: argument 2 is null but the corresponding size argument 3 value is 4095 [-Werror=nonnull]
      119 |   return __glibc_fortify (readlink, __len, sizeof (char),
          |          ^~~~~~~~~~~~~~~
    
    This error implies the allocated buffer can be NULL. Use
    g_file_read_link(), which allocates buffer automatically to avoid the
    error.
    
    Signed-off-by: Akihiko Odaki <akihiko.odaki@daynix.com>
    Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
    Reviewed-by: Cédric Le Goater <clg@redhat.com>
    Signed-off-by: Cédric Le Goater <clg@redhat.com>
    akihikodaki authored and legoater committed May 24, 2023
    Copy the full SHA
    dbdea0d View commit details
    Browse the repository at this point in the history
  3. Merge tag 'pull-vfio-20230524' of https://github.com/legoater/qemu in…

    …to staging
    
    vfio queue:
    
    * Fix for a memory corruption due to an extra free
    * Fix for a compile breakage
    
    # -----BEGIN PGP SIGNATURE-----
    #
    # iQIzBAABCAAdFiEEoPZlSPBIlev+awtgUaNDx8/77KEFAmRtyB4ACgkQUaNDx8/7
    # 7KFQvRAAhexL/Q8rWM8og+VESL5gPlpxDhWCI+l76+YJqQzZkgebwZ5rw920f8EG
    # bRs5AAk8fPTX/qKKq/JkYMmQwpM2jo8W4elcNumm44WAG7hDwd1LQ3nAZeOcvgU0
    # jQ1IwRYcgNo+oOTN9b7GhePQK27OraliLUrf/sBGUWvbdAttVc2pcB91CMur0Dxb
    # 9KK2vEA4MJ9B8zf2/ZkaK6Z+28GsratR7803Nvv25rm5sP3VBb9w0TnKZAOmaHLv
    # X5Tz8yjNvQxxzB9SzgOK6yMtnrp42ArVC5u2aDa33uzSWUeFiTF1HEFeGAps2nJg
    # 8tSNo0fTKhznrVR3q2pyxC05Dp+jmKicrmivc26iBdAWAUxQYX44UQoLYD5ISdti
    # nlSE+Is+0ZE5E2tHE9yAOPa4rrXHNBqpueu+VMPbYMyVEqzblP7twYe6HkGPYhrD
    # zbx/ABZAAGOf+3YmyL1yQrCc0WyJ2lHDySQt/llMrhkBTCHGEF8yjfWFypluZFWX
    # X7Mb0YZP0qPpFsV3TDcrqV3onaFSNehp2EJs2EJAa/DeUNbnKlz4LiYBzZE95egb
    # 9PGrLnB5w1Vlp44H+ctrnYj55TnspHT+Qqwvhkr/vOMupZukbGus0VFIU2IDrh2g
    # qEqhaigwxfVyZ1Eqwti4IgX8RVX8bW43slR33aD6vsO7jpiP2Pk=
    # =TA2V
    # -----END PGP SIGNATURE-----
    # gpg: Signature made Wed 24 May 2023 01:17:34 AM PDT
    # 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-vfio-20230524' of https://github.com/legoater/qemu:
      util/vfio-helpers: Use g_file_read_link()
      vfio/pci: Fix a use-after-free issue
    
    Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
    rth7680 committed May 24, 2023
    Copy the full SHA
    b300c13 View commit details
    Browse the repository at this point in the history