NBD patches through 2026-11-10
A few bug fixes:
- Eric Blake: fix two low-severity CVEs with non-compliant NBD clients
# -----BEGIN PGP SIGNATURE-----
#
# iQEzBAABCAAdFiEEccLMIrHEYCkn0vOqp6FrSiUnQ2oFAmr3HqAACgkQp6FrSiUn
# Q2oOugf/cw/KQ3ZCv2SIs313JHhWR8fRO0k4FG/t9r9JA0vBMgDPrKv6vfJWhFtg
# in5Nvy6KOkb/nq18MwuDzwmTgAyPYd1XACxHB8iR7g/MRbs9ODytQB12DUJVADEl
# Ww0Ht/VV0oXDPdpEEreQt5LvcErVVwfohzQXTCIVgMlhLjWvKg1hi0abTRzujZnm
# iyMdaN/hNz68yJbssOEnlXTVZ2jcRjkencRfBQMCQ7KI7/6Tod4MfSjPwqXLIeDc
# sES8yiAnn4N44q18iF7o1nKt9+rBXMZYRVs7Retxr/qsPuriEfhNBsiqx8XSeUnA
# Plmm9bOKu5rl9tDnjxAqrNd9mYjrwg==
# =Qmp0
# -----END PGP SIGNATURE-----
# gpg: Signature made Fri 13 Nov 2026 07:28:48 AM MST
# gpg: using RSA key 71C2CC22B1C4602927D2F3AAA7A16B4A2527436A
# gpg: Good signature from "Eric Blake <eblake@redhat.com>" [unknown]
# gpg: aka "Eric Blake (Free Software Programmer) <ebb9@byu.net>" [unknown]
# gpg: aka "[jpeg image of size 6874]" [unknown]
# 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: 71C2 CC22 B1C4 6029 27D2 F3AA A7A1 6B4A 2527 436A
* tag 'pull-nbd-2026-11-10-v2' of https://gitlab.com/ebblake/qemu:
iotests: Add another nbd-robustness test
nbd/server: Reject rather than assert on non-compliant NBD_OPT_SET_META_CONTEXT
iotests: Add new nbd-robustness test
nbd/server: Reject rather than assert on non-compliant BLOCK_STATUS
iotests: Refactor python NBD server setup
docs: Mention security considerations for NBD
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Convert the proof of concept test by TonySD into another case of the
iotest. This is yet another instance where a hard-coded exchange is
easier than forcing libnbd into producing an exchange that violates
the protocol. Swapping the order with the previous patch shows the
assertion failure that was previously reachable.
Based-on: https://gitlab.com/qemu-project/qemu/-/work_items/4843
Signed-off-by: Eric Blake <eblake@redhat.com>
Message-ID: <20261110155356.1520433-12-eblake@redhat.com>
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
The NBD protocol says that NBD_OPT_{LIST,SET}_META_CONTEXT sends
several lengths that must be consistent: an overall option reply
length, then a series of smaller lengths/data pairs representing the
export name and zero or more context names. If the smaller lengths
within the payload do not add up to the larger value, the client has
sent garbage bytes that will trigger the server's parse of the
client's next option to be out of sync. However, QEMU was dying with
an assertion failure rather than diagnosing the issue, which a
malicious client can then exploit to mount a denial-of-service attack
against QEMU as the NBD server.
As with several other recent NBD protocol violations, the likelihood
of this attack can be reduced by using TLS and x509 certs to reject
unwanted clients (a "trusted" client can still trigger the problem,
but you first have to compromise the trusted client into sending
arbitrary traffic).
Fixes: CVE-2026-125683
Fixes: e7b1948d51 ("nbd: BLOCK_STATUS for standard get_block_status function: server part", v2.12.0)
Reported-by: TonySD via https://gitlab.com/qemu-project/qemu/-/work_items/4843
CC: qemu-stable@nongnu.org
Signed-off-by: Eric Blake <eblake@redhat.com>
Message-ID: <20261110155356.1520433-11-eblake@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Convert the proof of concept test by Sunday Jiang into an iotest. I
tried to get libnbd to trigger the situation, but forcing a block
status command when no status has been initiated is not something that
libnbd is willing to do. So this results in a hard-coded sequence of
bytes sent over a raw socket. Swapping the order with the previous
patch shows the assertion failure that was previously reachable.
Based-on: https://gitlab.com/qemu-project/qemu/-/work_items/4091
Signed-off-by: Eric Blake <eblake@redhat.com>
Message-ID: <20261110155356.1520433-10-eblake@redhat.com>
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
The NBD spec is clear that a client must not send NBD_BLOCK_STATUS
requests to a server if it did not negotiate any metacontexts with
NBD_OPT_SET_META_CONTEXT for the current export. However, if the
non-compliant client uses NBD_OPT_EXTENDED_HEADERS and then passes in
the relatively new NBD_CMD_FLAG_PAYLOAD_LEN flag alongside an
inappropriate block status request, this was enough to trigger an
assertion in qemu. The assertion can also be tripped by initially
requesting the context for one export, then using NBD_OPT_GO on a
different export (nbd_check_meta_export() sets contexts.count to 0,
but did not wipe contexts.exp). Forcing the client command to be
rejected if contexts.count is 0 solves both triggers, and allows the
assertion to still operate cleanly at a later location.
If you do not use recommended practice to prevent unwanted clients
from connecting to QEMU's NBD server, then any client can cause a
denial of service with minimal effort. However, with TLS and x509
certs in place, an attacker must first chain in an attack to convince
the client to send unwanted traffic, which is a factor in declaring
this a lower-risk denial of service.
Fixes: CVE-2026-124559
Fixes: 2dcbb11b ("nbd/server: Add FLAG_PAYLOAD support to CMD_BLOCK_STATUS", v8.2.0)
Reported-by: Feifan Qian <bea1e@proton.me>
Reported-by: https://gitlab.com/qemu-project/qemu/-/work_items/3796
CC: Haotian Jiang <jianghaotian.sunday@gmail.com>
CC: qemu-stable@nongnu.org
Signed-off-by: Eric Blake <eblake@redhat.com>
Message-ID: <20261110155356.1520433-9-eblake@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Document a policy that NBD connections should strongly consider using
TLS and x509 certificates to filter out unwanted clients. If a
malicious server or client can trigger a QEMU assertion failure on a
plaintext connection, but can trivially have risk mitigated by
enabling TLS to weed out unknown partners (so that a full-on attack of
QEMU would first require chaining some other attack to convince a
"trusted" client to break protocol in the first place), then that
reduces the CVSS-BE score of the QEMU bug. In turn, our policy already
states that low severity scores can be fixed without an embargo.
Signed-off-by: Eric Blake <eblake@redhat.com>
Message-ID: <20261110155356.1520433-7-eblake@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
mshv fixes for 2026-11-11
# -----BEGIN PGP SIGNATURE-----
#
# iHUEABYIAB0WIQSIMd1XyYFq56tSq9Pd9deQOCwLigUCavTJGwAKCRDd9deQOCwL
# ijvWAQDJcT9mhQYuyW2dp5pboZg/dtJV8D5g16Y7EvP9YqrkIgD/bCJ98xNkgN06
# /lmiliI0P4YXo1Tqr6TSUt9PbYeWfwI=
# =KhYw
# -----END PGP SIGNATURE-----
# gpg: Signature made Wed 11 Nov 2026 12:59:23 PM MST
# gpg: using EDDSA key 8831DD57C9816AE7AB52ABD3DDF5D790382C0B8A
# gpg: Good signature from "Magnus Kulke (QEMU) <magnuskulke@linux.microsoft.com>" [unknown]
# 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: 5255 B617 7982 9168 7022 31CA 68D9 BB56 DD17 8417
# Subkey fingerprint: 8831 DD57 C981 6AE7 AB52 ABD3 DDF5 D790 382C 0B8A
* tag 'mkulke-pull-20261111' of https://github.com/mkulke/qemu:
target/i386/mshv: add MshvPutState for vcpu writes
accel/mshv: freeze time during TSC MSR write
target/i386/mshv: fix vCPU run result contract
accel/mshv: skip double unmap of mem regions
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
In accordance with QEMU's coding style guidelines, replace raw memory
allocation functions (malloc/free) with their GLib equivalents
(g_new/g_malloc0/g_free/g_clear_pointer).
Also removes the old generic error-handling code from
OPLOpenTable(), since the Glib functions abort the program automatically
if memory is exhausted.
Resolves: https://gitlab.com/qemu-project/qemu/-/work_items/1798
Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Signed-off-by: Lucas Cardoso <luc.fast2004@gmail.com>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Michael Tokarev <mjt@tls.msk.ru>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
Make qio_channel_file_close() set fd to -1 even if qemu_close() returns
an error so that qio_channel_file_finalize() doesn't call close again.
On Linux, close() always closes the fd, even when it returns an error.
Because the fd can be reused after it is closed, the close must not
be retried.
Signed-off-by: Filip Hejsek <filip.hejsek@gmail.com>
Reviewed-by: Michael Tokarev <mjt@tls.msk.ru>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
Currently QEMU marks a vcpu state as dirty also on merely inspectional
reads, e.g. via "info registers", which triggers a writeback to the
hypervisor. For MSRs that cause a side-effect when written to this is
undesired.
We introduce an MshvPutState flag into the writeback logic to differentiate
"runtime" from "full" and "reset" writebacks that should occur e.g. after
a migration or startup.
Discrete side-effectful MSRs are excluded in runtime writebacks. So far
we only mark one MSR as not runtime-safe, but probably more will be
added eventually.
Signed-off-by: Magnus Kulke <magnuskulke@linux.microsoft.com>
Reviewed-by: Wei Liu <wei.liu@kernel.org>
Reviewed-by: Mohamed Mediouni <mohamed@unpredictable.fr>
A regression was introduced when the HV_X64_REGISTER_TSC MSR state is
being written to the hypervisor as part of the migration framework. If
the MSR is written without the time being frozen, the tsc_page (a
hyper-v enlightenment) is zeroed out and cannot be used by a guest,
which results in a performance regression, because the guest falls back
to costly reads of HV_X64_MSR_TIME_REF_COUNT.
An implementation of pre_resume_vm hook was added to handle the clock
lifecycle, relying on the dirty_vcpu state to avoid redundant state
writes.
Fixes: d540dcc5e2 ("target/i386/mshv: migrate MSRs")
Signed-off-by: Magnus Kulke <magnuskulke@linux.microsoft.com>
Reviewed-by: Doru Blânzeanu <dblanzeanu@linux.microsoft.com>
Currently the return semantics of mshv_run_vcpu() are broken. They
return a mix of int and exit_reason, ignoring the out param *exit.
This change propagates errno's to the call site and sets the *exit value
accordingly. We also consider the case when an ioctl has return due to a
qemu-requested interruption of the call, this is a legitimate condition
that should not produce an error.
Fixes: 6dec60528c ("target/i386/mshv: Implement mshv_vcpu_run()")
Signed-off-by: Magnus Kulke <magnuskulke@linux.microsoft.com>
Reviewed-by: Doru Blânzeanu <dblanzeanu@linux.microsoft.com>
This change addresses a regression that was introduced when the dynamic
mapping handler was removed, from the MSHV controller, breaking OVMF
support.
We introduce a small uaddr-indexed table to track mapped regions. The
current logic turns an add into a remove op if a rom-device region is
currently not in romd_mode.
We could ignore both map + unmap for this condition, but this misses a
the case of a region transitioning from romd_mode=true => false. In this
case we still do want to unmap a region.
Fixes: 626e5dc999 ("accel/mshv: Remove remap overlapping mappings code")
Signed-off-by: Magnus Kulke <magnuskulke@linux.microsoft.com>
Reviewed-by: Doru Blânzeanu <dblanzeanu@linux.microsoft.com>
Add a check for the VIRTIO spec statement:
5.14.6.6.3.2 Driver Requirements: Stream Parameters
period_bytes MUST be a divider buffer_bytes, i.e. buffer_bytes % period_bytes == 0.
Reviewed-by: Jim MacArthur <jim.macarthur@linaro.org>
Signed-off-by: Manos Pitsidianakis <manos.pitsidianakis@linaro.org>
Do not blindly accept features for a stream, check them against what we
had reported to the guest with pcm_info.
Reviewed-by: Jim MacArthur <jim.macarthur@linaro.org>
Signed-off-by: Manos Pitsidianakis <manos.pitsidianakis@linaro.org>
Add macro to print the stream state in a human-understandable state,
since this is an internal enum and one would have to inspect the source
code to understand what a e.g. "2" state means in an error message.
Reviewed-by: Jim MacArthur <jim.macarthur@linaro.org>
Signed-off-by: Manos Pitsidianakis <manos.pitsidianakis@linaro.org>
virtio_error() also signals a RESET, which is not what we want: we want
the guest driver to read the VIRTIO_SND_S_BAD_MSG response.
If a guest sends an invalid command and we do virtio_error() and reply
with a BAD_MSG response, the guest needs to detect the device reset
otherwise it hangs forever waiting for the response.
Reviewed-by: Jim MacArthur <jim.macarthur@linaro.org>
Signed-off-by: Manos Pitsidianakis <manos.pitsidianakis@linaro.org>
Hexagon MMUs support 64-bit physical addresses. Describe the root and
/soc buses with two address cells and two size cells so their child reg
properties can represent the full address and size range.
Reviewed-by: Pierrick Bouvier <pierrick.bouvier@oss.qualcomm.com>
Signed-off-by: Brian Cain <brian.cain@oss.qualcomm.com>
-bios on virt only loaded a raw image of at most 64 KiB at address
zero. This is insufficient for H2 firmware, which is usually hundreds of
KiB.
Boot a kernel given with -kernel through the firmware given with -bios.
Load both ELFs at their declared physical addresses, place the device tree
and initrd after the kernel, and enter the firmware through a boot stub
that passes the device tree in r1:r0.
Fixes: 88a8bc7f43 ("hw/hexagon: Define hexagon "virt" machine")
Reviewed-by: Pierrick Bouvier <pierrick.bouvier@oss.qualcomm.com>
Signed-off-by: Brian Cain <brian.cain@oss.qualcomm.com>
The DSP subsystem machines boot a guest kernel through the hypervisor
firmware. Move that code, the DT nodes, guest timer, into hex-board so that
it can be used by virt.
No functional change, this will be used by a subsequent commit.
Reviewed-by: Pierrick Bouvier <pierrick.bouvier@oss.qualcomm.com>
Signed-off-by: Brian Cain <brian.cain@oss.qualcomm.com>
Describe ELF and raw-image loading, reset state, the DTB handoff to VM
host firmware, and initial thread state. Explain UART and semihosting
console routing.
Reviewed-by: Pierrick Bouvier <pierrick.bouvier@oss.qualcomm.com>
Signed-off-by: Brian Cain <brian.cain@oss.qualcomm.com>
Virtual RTE must restore status and branch to GELR without swapping
SP and GOSP. An implicit swap undoes the explicit exit SPSWAP and
resumes guest user code on the kernel stack.
Signed-off-by: Marco Liebel <marco.liebel@oss.qualcomm.com>
Reviewed-by: Brian Cain <brian.cain@oss.qualcomm.com>
Signed-off-by: Brian Cain <brian.cain@oss.qualcomm.com>
Hold the shared TLB mutex during ASID invalidation so it cannot
overwrite a concurrent entry replacement.
Route local IMASK reads and writes through BQL-protected helpers
to serialize them with cross-thread interrupt assignment. Apply
the pre-V81 writable-bit mask under the same lock.
Signed-off-by: Marco Liebel <marco.liebel@oss.qualcomm.com>
Signed-off-by: Brian Cain <brian.cain@oss.qualcomm.com>
Guest event entry must select BADVA0 or BADVA1 through SSR.BVS
instead of copying the stale BADVA array slot. It must also save
SSR.CFI into GSR.CFI so guest return can restore the interrupted
CFI state.
Signed-off-by: Marco Liebel <marco.liebel@oss.qualcomm.com>
Reviewed-by: Brian Cain <brian.cain@oss.qualcomm.com>
Signed-off-by: Brian Cain <brian.cain@oss.qualcomm.com>
Block layer patches
- qcow2: fix snapshot data corruption with discard-no-unref=on
- vmdk: Fix various bugs in handling malicious image files
- vhdx: Prevent out-of-bounds BAT accesses with malicious vhdx files
- iotests: add --quiet arg to hide env variable dump
# -----BEGIN PGP SIGNATURE-----
#
# iQJFBAABCgAvFiEE3D3rFZqa+V09dFb+fwmycsiPL9YFAmrx+EwRHGt3b2xmQHJl
# ZGhhdC5jb20ACgkQfwmycsiPL9Ziiw/+ORADnC0XFs85sEko+V831yp2NO99Gu+U
# GJ/C91rPaNpywIaCDajuPFcJN6xrVgKoMrRimsbTHoZnGN3J9Nd+k4ZMgefih3eD
# pA87hw7yvsngQVDtsmP4hT4vYocHBNTQBbLK9h6FmOaiBMMUn213bOFpbsq+wQ1S
# Yo64AUX6u3tbQP2ls+PV5IxtYYbnSWX9taD2UnA+HCdV24cIEfwrRhuBDspqjsVP
# DTkQwacXIDU9KZyW2tdXOH7l+JwhJL1JYOZJRODfv5xqhvxsetwxn50MKsBX/vXQ
# r2mIw+73FSw05tlrmomMIxE0ssWuMpxgf94L6FftVr8Wg5wgkxPw4Q13IDIyuPck
# gsoQ4sbsSS74AaJgwLuXmYU1M1q90Wviu3WN+MNdfdFIqjqwJCS/2JMu/KV0lkLA
# r2HA6oM/9M8GOcd40IVNcx1jW94OIQDyeP6uv8iPk7riXY76K2AAcYxgFGRqumwG
# 8aW0QiIyNc4dVY1sedL12xRHzPeaEMyZ9+L+tg3ibCjtM/CgzcR2vwFfkkthoGyc
# +bqByp1TX9f4H78IzqBv0c89pFn5mPBpoJzRrlBPE91FycLL76tx9o9MhVWjZpmS
# v5W0ZQwvQo/qhYSZ/AnZQOHW8tfkJv0jn7yLwf6JZbh9OuacY7H50nxMlBoBLMfG
# rDNsmuVL7BE=
# =gMMb
# -----END PGP SIGNATURE-----
# gpg: Signature made Mon 09 Nov 2026 08:43:56 AM PST
# gpg: using RSA key DC3DEB159A9AF95D3D7456FE7F09B272C88F2FD6
# gpg: issuer "kwolf@redhat.com"
# gpg: Good signature from "Kevin Wolf <kwolf@redhat.com>" [unknown]
# gpg: WARNING: The key's User ID is not certified with a trusted signature!
# gpg: There is no indication that the signature belongs to the owner.
# Primary key fingerprint: DC3D EB15 9A9A F95D 3D74 56FE 7F09 B272 C88F 2FD6
* tag 'for-upstream' of https://repo.or.cz/qemu/kevin:
block/vhdx: Prevent out-of-bounds BAT accesses with malicious vhdx files
iotests/290: add 'discard' and 'write -z -u' case with a snapshot
qcow2: fix snapshot data corruption with discard-no-unref=on
iotests/290: add test case to check 'discard-no-unref' option behavior
block: add missing coroutine_fn annotations
block/vmdk: Avoid overflowing multiplication in vmdk_open_vmdk4()
block/vmdk: Reject a zero cluster_sectors parameter
block/vmdk: Use larger types for byte counts in vmdk_read_extent()
block/vmdk: Avoid reading off the end of descriptor memory
block/vmdk: Avoid assertion if image file has no extents
iotests: add --quiet arg to hide env variable dump
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Fix vhost on s390x
# -----BEGIN PGP SIGNATURE-----
#
# iIsEABYKADMWIQQB3Dhbwk4ZE3uUN6KmTx4R4Fx3tAUCavHWwhUcZmFybWFuQGxp
# bnV4LmlibS5jb20ACgkQpk8eEeBcd7RABwEAmJd9ZeqdsXd1RdXBMEjMmMCIVogn
# xpCpzLKR/OBBsToA/jji9kFeGAtQ8b7vppxiH5pRvnWSAxAHit5zOgMr6H0M
# =SjK7
# -----END PGP SIGNATURE-----
# gpg: Signature made Mon 09 Nov 2026 06:20:50 AM PST
# gpg: using EDDSA key 01DC385BC24E19137B9437A2A64F1E11E05C77B4
# gpg: issuer "farman@linux.ibm.com"
# gpg: Good signature from "Eric Farman <farman@linux.ibm.com>" [unknown]
# gpg: WARNING: The key's User ID is not certified with a trusted signature!
# gpg: There is no indication that the signature belongs to the owner.
# Primary key fingerprint: D2C6 0504 C9E8 F568 CFE5 87B5 3827 B212 71BF 9562
# Subkey fingerprint: 01DC 385B C24E 1913 7B94 37A2 A64F 1E11 E05C 77B4
* tag 's390x-20261109' of https://gitlab.com/efarman/qemu:
vhost: only use config notifier when exists/initialized
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
target-arm queue:
* target/arm/ptw: check XN for ARMv6 in get_S1prot()
* hw/net/bcm2838_genet: various bugfixes
* arm/cpu: fix GIC v3 flag for a64fx
* hw/intc/arm_gic: do not hardcode GICv2 minimum binary point
* target/arm: Clear the local monitor on AArch32 (v8) exception returns
* hw/intc/hex-l2vic: avoid shift into sign bit
# -----BEGIN PGP SIGNATURE-----
#
# iQJNBAABCAA3FiEE4aXFk81BneKOgxXPPCUl7RQ2DN4FAmrx0v8ZHHBldGVyLm1h
# eWRlbGxAbGluYXJvLm9yZwAKCRA8JSXtFDYM3sQpD/9bO2J7p/Us50EJzpeEO15z
# 9r1hDTz9x1VvMjCuPOHcM6ByrzaZC0UOBnBNr/NgmSw26UEf/5KR4eukhVemKSkD
# tXnGbktuijzyMCVg4c1jTZXKnsLFi9kNKWM69GO2s8G4/LXiFE/uSXQi40BwIqyc
# aG21bTDplWbuH1DESAN6fge+P9F961Y7W5Qyw8LfTUWTE8XRB41WT6v3J+qEPWpN
# mJ3nyaD4dmh9m57UZQsYt91H9NWvPtkSxepdOXC1H4nhwFE+ZBcZ2dclITO2zPh1
# fWZ6mn5b8UbGwFKqMRNKUNAA54ktN0r1zzzRtCQ2+cMcHbmXRlRP0oCVFlKSN4zd
# cepYMneByqicjfuxaJcKO86TxuFUR5/bY3fTgwLFTQ+ydGAl9Ahv772eQdd4/bT1
# PVD6ebjSEEioS9+OpTuHyoLUuCPIEmFDDtsI/yhUd/k9dLBJGTPCEL2b7mErA+ig
# h6xTqAaIq/pepgAdiKqYLATIn1IStFNIMO5bxuDtJEGC1wyz8vcHQdw3mouVbP3w
# kNqU84veRlwv/4Pqm6MU1H0Drf6pIzRM1QdINq++wV+n0RQU9OsON2iJVZH2Zb+2
# DpeV6/U1P0YdJpPscQwLCp9CO43FbKBkqpl3qsCoyGtqa9vYpg4L5vxFPuvrheBJ
# AFQyJ1L9P3/O6WcVIE4XlQ==
# =9eMU
# -----END PGP SIGNATURE-----
# gpg: Signature made Mon 09 Nov 2026 06:04:47 AM PST
# gpg: using RSA key E1A5C593CD419DE28E8315CF3C2525ED14360CDE
# gpg: issuer "peter.maydell@linaro.org"
# gpg: Good signature from "Peter Maydell <peter.maydell@linaro.org>" [unknown]
# gpg: aka "Peter Maydell <pmaydell@gmail.com>" [unknown]
# gpg: aka "Peter Maydell <pmaydell@chiark.greenend.org.uk>" [unknown]
# gpg: aka "Peter Maydell <peter@archaic.org.uk>" [unknown]
# gpg: WARNING: The key's User ID is not certified with a trusted signature!
# gpg: There is no indication that the signature belongs to the owner.
# Primary key fingerprint: E1A5 C593 CD41 9DE2 8E83 15CF 3C25 25ED 1436 0CDE
* tag 'pull-target-arm-20261109' of https://gitlab.com/pm215/qemu:
hw/intc/hex-l2vic: avoid shift into sign bit
target/arm: Clear the local monitor on AArch32 (v8) exception returns
hw/intc/arm_gic: do not hardcode GICv2 minimum binary point
hw/intc/arm_gic: move num-priority-bits check
arm/cpu: fix GIC v3 flag for a64fx
hw/net/bcm2838_genet: fit the RX frame within the guest's buffer
hw/net/bcm2838_genet: hold RX frames while the ring is full
hw/net/bcm2838_genet: wrap the TX consumer index at 16 bits
target/arm/ptw: check XN for ARMv6 in get_S1prot()
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
whpx: QEMU 11.2 pull request
This is a cut-down version of the "whpx: i386: updates for QEMU 11.2" patchset
with fixes for QEMU 11.2.
These include:
- fixing reset
- CPUID fixes (leaf 0xd)
- handle systems where nested virt is advertised but not working
- xsave fixes
v1 -> v2:
- Adding Signed-off-by to all commits
- Rewording
# -----BEGIN PGP SIGNATURE-----
#
# iJEEABYKADkWIQQcss1Irh5YnrL54hsUIDoXkgPV/AUCavHKIBsUgAAAAAAEAA5t
# YW51MiwyLjUrMS4xMiwwLDMACgkQFCA6F5ID1fxmYwEAufhyj6bCQadi9Uwe7ibv
# IPjjMaHbJCNdN/04+SETImYBAOlRkkl5zldlOdCTTxBObgupIDqxPAR2f27cuIX1
# IUwA
# =ErmZ
# -----END PGP SIGNATURE-----
# gpg: Signature made Mon 09 Nov 2026 05:26:56 AM PST
# gpg: using EDDSA key 1CB2CD48AE1E589EB2F9E21B14203A179203D5FC
# gpg: Good signature from "Mohamed Mediouni <mohamed@unpredictable.fr>" [unknown]
# gpg: Signature notation: manu=2,2.5+1.12,0,3
# 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: 1CB2 CD48 AE1E 589E B2F9 E21B 1420 3A17 9203 D5FC
* tag 'whpx-fix-0-pull-request' of https://github.com/mediouni-m/qemu:
whpx: i386: fall back to xAPIC when the MSR exit bitmap is unavailable
whpx: i386: do not require ProcessorFeaturesBanks on legacy Windows
whpx: i386: forward the dynamic EBX of CPUID[0xD] sub-leaves 0 and 1, not 1 and 2
target/i386/whpx: handle processor reset
whpx: i386: avoid updating hflags for vmexits
target/i386/whpx: whpx_get_xsave_state error handling
target/i386/whpx: fix VMX capability MSR values
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
virtual_disk_size is read directly from a VHDX image's metadata region
and never checked for sane sizes. The 64 TiB limit (VHDX_MAX_IMAGE_SIZE)
is only enforced in vhdx_co_create(), so it limits images QEMU creates
but never images QEMU opens.
Without the bound, vhdx_calc_bat_entries() computes the block count
into a uint32_t, so a huge image size gets truncated and the BAT is
undersized relative to total_sectors.
vhdx_block_translate() then converts sector numbers into BAT indices
with no bounds check, allowing out-of-bounds access on the BAT array
from both the read and write paths.
To fix the problem, add a VHDX_MAX_IMAGE_SIZE check to vhdx_parse_metadata()
so images opened for reading are subject to the same limit as images
created by QEMU.
With this limit, the calculation in vhdx_calc_bat_entries() cannot get
truncated anymore (block_size is at least 1 MiB):
VHDX_MAX_IMAGE_SIZE / block_size = 64 TiB / 1 MiB = 64 MiB
... and 64 MiB fit nicely into 32 bits.
To be really on the safe side, let's also add an assertion in
vhdx_block_translate() to catch accesses that exceeds the allocated
entry count.
Buglink: https://gitlab.com/qemu-project/qemu/-/work_items/3762
Reported-by: Daniel Wade <danjwade95@gmail.com>
Resolves: https://gitlab.com/qemu-project/qemu/-/work_items/4470
Reported-by: Mayank Jangid (OpenSec)
Resolves: https://gitlab.com/qemu-project/qemu/-/work_items/4487
Reported-by: Ken Hsu, Royce Lu, and Bo Qu of Palo Alto Networks
Resolves: https://gitlab.com/qemu-project/qemu/-/work_items/4638
Reported-by: Thai Duong (Calif.io)
Resolves: https://gitlab.com/qemu-project/qemu/-/work_items/4733
Reported-by: Xiang Chen
Signed-off-by: Thomas Huth <thuth@redhat.com>
Message-ID: <20261023130023.539252-1-thuth@redhat.com>
Reviewed-by: Kevin Wolf <kwolf@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Whenever option discard-no-unref=on is enabled, we bypass refcount
machinery and unconditionally punch hole in the data on 'discard' and
'write -z -u' paths. However, when this same cluster is also referenced
by an internal snapshot, such operations lead to problems. The active L2
table is copied before it is changed, so the snapshot metadata stays
correct, but the host range under it is punched out and the snapshot reads
zeroes there afterwards. qemu-img check finds nothing wrong.
Fix this by guarding the 'keep_reference' flag by the presence of the
QCOW_OFLAG_COPIED bit. I.e. only proceed with unconditional data
punching if we own this cluster exclusively.
Cc: qemu-stable@nongnu.org
Fixes: 42a2890a76 ("qcow2: add discard-no-unref option")
Signed-off-by: Andrey Drobyshev <andrey.drobyshev@virtuozzo.com>
Reviewed-by: Denis V. Lunev <den@openvz.org>
Reviewed-by: Kevin Wolf <kwolf@redhat.com>
Message-ID: <20261105161515.794213-3-andrey.drobyshev@virtuozzo.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
We basically fill 2 images with identical data and perform discard
operations with and without 'discard-no-unref' enabled. Then we check
that images still read identically, that their disk usage is the same
(i.e. fallocate(FALLOC_FL_PUNCH_HOLE|FALLOC_FL_KEEP_SIZE) is called for
both) and that with the option enabled cluster is still marked as
allocated in "qemu-img map" output. We also check that the option
doesn't work with qcow2 v2 images.
Signed-off-by: Andrey Drobyshev <andrey.drobyshev@virtuozzo.com>
Message-ID: <20261105161515.794213-2-andrey.drobyshev@virtuozzo.com>
Reviewed-by: Kevin Wolf <kwolf@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
The functions call coroutine functions or are called by coroutine.
Add an assert() in qcow2_do_close() code path which calls a
no_coroutine_fn bdrv_graph_wrlock_drained().
Add an assert() in qcow2_update_options_commit() in the coroutine
path.
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Message-ID: <20260730171027.1023696-1-marcandre.lureau@redhat.com>
Reviewed-by: Kevin Wolf <kwolf@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>