[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-commits] [qemu/qemu] 49e51f: parallels: fix possible int overflow
From: |
Peter Maydell |
Subject: |
[Qemu-commits] [qemu/qemu] 49e51f: parallels: fix possible int overflow |
Date: |
Tue, 19 Nov 2024 09:36:42 -0800 |
Branch: refs/heads/staging
Home: https://github.com/qemu/qemu
Commit: 49e51fc328bf3c9374f684cf98a5682d71cb73bc
https://github.com/qemu/qemu/commit/49e51fc328bf3c9374f684cf98a5682d71cb73bc
Author: Dmitry Frolov <frolov@swemel.ru>
Date: 2024-11-19 (Tue, 19 Nov 2024)
Changed paths:
M block/parallels.c
Log Message:
-----------
parallels: fix possible int overflow
The sum "cluster_index + count" may overflow uint32_t.
Found by Linux Verification Center (linuxtesting.org) with SVACE.
Signed-off-by: Dmitry Frolov <frolov@swemel.ru>
Message-ID: <20241106080521.219255-2-frolov@swemel.ru>
Reviewed-by: Kevin Wolf <kwolf@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Commit: 8fa028c5f817424b4d9df2fb75f50224fa620901
https://github.com/qemu/qemu/commit/8fa028c5f817424b4d9df2fb75f50224fa620901
Author: John Snow <jsnow@redhat.com>
Date: 2024-11-19 (Tue, 19 Nov 2024)
Changed paths:
M tests/qemu-iotests/iotests.py
Log Message:
-----------
iotests: reflow ReproducibleTestRunner arguments
Trivial reflow to let the type names breathe.
(I need to add a longer type name.)
Signed-off-by: John Snow <jsnow@redhat.com>
Message-ID: <20241101173700.965776-2-jsnow@redhat.com>
Reviewed-by: Kevin Wolf <kwolf@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Commit: 190d5158cd74da3832b5173b7023b31c390ab379
https://github.com/qemu/qemu/commit/190d5158cd74da3832b5173b7023b31c390ab379
Author: John Snow <jsnow@redhat.com>
Date: 2024-11-19 (Tue, 19 Nov 2024)
Changed paths:
M tests/qemu-iotests/iotests.py
Log Message:
-----------
iotests: correct resultclass type in ReproducibleTestRunner
I have a vague memory that I suggested this base class to Vladimir and
said "Maybe someday it will break, and I'll just fix it then." Guess
that's today.
Fixes various mypy errors in the "make check-tox" python test for at
least Python3.8; seemingly requires a fairly modern mypy and/or Python
base version to trigger.
Signed-off-by: John Snow <jsnow@redhat.com>
Message-ID: <20241101173700.965776-3-jsnow@redhat.com>
Reviewed-by: Kevin Wolf <kwolf@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Commit: 9fbaaf67b03546f9fc8987f6aa4c0ae187ce9d50
https://github.com/qemu/qemu/commit/9fbaaf67b03546f9fc8987f6aa4c0ae187ce9d50
Author: John Snow <jsnow@redhat.com>
Date: 2024-11-19 (Tue, 19 Nov 2024)
Changed paths:
M python/setup.cfg
M tests/qemu-iotests/pylintrc
Log Message:
-----------
python: disable too-many-positional-arguments warning
Newest versions of pylint complain about specifically positional
arguments in addition to too many in general. We already disable the
general case, so silence this new warning too.
Signed-off-by: John Snow <jsnow@redhat.com>
Message-ID: <20241101173700.965776-4-jsnow@redhat.com>
Reviewed-by: Kevin Wolf <kwolf@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Commit: 75607805d826b876bca2530eb2eb7be46c056f81
https://github.com/qemu/qemu/commit/75607805d826b876bca2530eb2eb7be46c056f81
Author: John Snow <jsnow@redhat.com>
Date: 2024-11-19 (Tue, 19 Nov 2024)
Changed paths:
M python/scripts/mkvenv.py
Log Message:
-----------
python: silence pylint raising-non-exception error
As of (at least) pylint 3.3.1, this code trips pylint up into believing
we are raising something other than an Exception. We are not: the first
two values may indeed be "None", but the last and final value must by
definition be a SystemExit exception.
Signed-off-by: John Snow <jsnow@redhat.com>
Message-ID: <20241101173700.965776-5-jsnow@redhat.com>
Reviewed-by: Kevin Wolf <kwolf@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Commit: d70d4a6a585c937a5cd41f924ea6606b45813ece
https://github.com/qemu/qemu/commit/d70d4a6a585c937a5cd41f924ea6606b45813ece
Author: Kevin Wolf <kwolf@redhat.com>
Date: 2024-11-19 (Tue, 19 Nov 2024)
Changed paths:
M hw/core/qdev-properties-system.c
Log Message:
-----------
qdev: Fix set_pci_devfn() to visit option only once
pci_devfn properties accept either a string or an integer as input. To
implement this, set_pci_devfn() first tries to visit the option as a
string, and if that fails, it visits it as an integer instead. While the
QemuOpts visitor happens to accept this, it is invalid according to the
visitor interface. QObject input visitors run into an assertion failure
when this is done.
QObject input visitors are used with the JSON syntax version of -device
on the command line:
$ ./qemu-system-x86_64 -enable-kvm -M q35 -device
pcie-pci-bridge,id=pci.1,bus=pcie.0 -blockdev null-co,node-name=disk -device '{
"driver": "virtio-blk-pci", "drive": "disk", "id": "virtio-disk0", "bus":
"pci.1", "addr": 1 }'
qemu-system-x86_64: ../qapi/qobject-input-visitor.c:143: QObject
*qobject_input_try_get_object(QObjectInputVisitor *, const char *, _Bool):
Assertion `removed' failed.
The proper way to accept both strings and integers is using the
alternate mechanism, which tells us the type of the input before it's
visited. With this information, we can directly visit it as the right
type.
This fixes set_pci_devfn() by using the alternate mechanism.
Cc: qemu-stable@nongnu.org
Reported-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Message-ID: <20241119120353.57812-1-kwolf@redhat.com>
Acked-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Commit: bd5dbfc72cc25c557e7b6a1bbe6da7ed012b3f57
https://github.com/qemu/qemu/commit/bd5dbfc72cc25c557e7b6a1bbe6da7ed012b3f57
Author: Stefan Hajnoczi <stefanha@redhat.com>
Date: 2024-11-19 (Tue, 19 Nov 2024)
Changed paths:
M system/qdev-monitor.c
Log Message:
-----------
qdev-monitor: avoid QemuOpts in QMP device_add
The QMP device_add monitor command converts the QDict arguments to
QemuOpts and then back again to QDict. This process only supports scalar
types. Device properties like virtio-blk-pci's iothread-vq-mapping (an
array of objects) are silently dropped by qemu_opts_from_qdict() during
the QemuOpts conversion even though QAPI is capable of validating them.
As a result, hotplugging virtio-blk-pci devices with the
iothread-vq-mapping property does not work as expected (the property is
ignored).
Get rid of the QemuOpts conversion in qmp_device_add() and call
qdev_device_add_from_qdict() with from_json=true. Using the QMP
command's QDict arguments directly allows non-scalar properties.
The HMP is also adjusted since qmp_device_add()'s now expects properly
typed JSON arguments and cannot be used from HMP anymore. Move the code
that was previously in qmp_device_add() (with QemuOpts conversion and
from_json=false) into hmp_device_add() so that its behavior is
unchanged.
This patch changes the behavior of QMP device_add but not HMP
device_add. QMP clients that sent incorrectly typed device_add QMP
commands no longer work. This is a breaking change but clients should be
using the correct types already. See the netdev_add QAPIfication in
commit db2a380c8457 for similar reasoning and object-add in commit
9151e59a8b6e. Unlike those commits, we continue to rely on 'gen': false
for the time being.
Markus helped me figure this out and even provided a draft patch. The
code ended up very close to what he suggested.
Suggested-by: Markus Armbruster <armbru@redhat.com>
Cc: Daniel P. Berrangé <berrange@redhat.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Message-ID: <20240827192751.948633-2-stefanha@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Reviewed-by: Kevin Wolf <kwolf@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Commit: c77fc64e67f3f3050ccd487706eb5f1dcc3ec7d5
https://github.com/qemu/qemu/commit/c77fc64e67f3f3050ccd487706eb5f1dcc3ec7d5
Author: Stefan Hajnoczi <stefanha@redhat.com>
Date: 2024-11-19 (Tue, 19 Nov 2024)
Changed paths:
M system/vl.c
Log Message:
-----------
vl: use qmp_device_add() in qemu_create_cli_devices()
qemu_create_cli_devices() should use qmp_device_add() to match the
behavior of the QMP monitor. A comment explained that libvirt changes
implementing strict CLI syntax were needed.
Peter Krempa <pkrempa@redhat.com> has confirmed that modern libvirt uses
the same JSON for -device (CLI) and device_add (QMP). Go ahead and use
qmp_device_add().
Cc: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Message-ID: <20240827192751.948633-3-stefanha@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Reviewed-by: Kevin Wolf <kwolf@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Commit: 5b3f601bc1e1632f1c3dfce916bf52396a6cae1d
https://github.com/qemu/qemu/commit/5b3f601bc1e1632f1c3dfce916bf52396a6cae1d
Author: Peter Maydell <peter.maydell@linaro.org>
Date: 2024-11-19 (Tue, 19 Nov 2024)
Changed paths:
M block/parallels.c
M hw/core/qdev-properties-system.c
M python/scripts/mkvenv.py
M python/setup.cfg
M system/qdev-monitor.c
M system/vl.c
M tests/qemu-iotests/iotests.py
M tests/qemu-iotests/pylintrc
Log Message:
-----------
Merge tag 'for-upstream' of https://repo.or.cz/qemu/kevin into staging
Block layer patches
- Fix qmp_device_add() to not throw non-scalar options away (fixes
iothread-vq-mapping being silently ignored in device_add)
- Fix qdev property crash with integer PCI addresses and JSON -device
- iotests: Fix mypy failure
- parallels: Avoid potential integer overflow
- Fix crash in migration_is_running()
# -----BEGIN PGP SIGNATURE-----
#
# iQJFBAABCAAvFiEE3D3rFZqa+V09dFb+fwmycsiPL9YFAmc8yigRHGt3b2xmQHJl
# ZGhhdC5jb20ACgkQfwmycsiPL9aS1BAAwqyssV4Cht4NIfj9IQwlgbnX29PDL/ik
# p3MpAqNp9kUtSJ1+ftfDNJ5p0xYJHBCJudft7/C+eXGX3GtRJZe8VhHWm9OYbLj+
# at2nyxkYovhAe02hG71BoNIanwFFNEVW+U6b/hk4R/xSrhfT5DXPk+ClUonSME6A
# Z3doeCwDUAnFPLOQ2MMlQmWysJBQFYvGvT95J96+ajZPIm9Fbbh3/IDKZZDjfSdK
# 4xKNpy/4CckIDoETjeP4a1CtgXx1ro98DbZsbqGir0D29b6u1DMx6R8rQIVmL+Vn
# 0zy6HUOSdRYRtkV80s7YZjXKK2zUxGCLclxYhk7TVeY08H+iWMqP0wS9UeqRvucD
# 15jTc9rN9ovnJ6QbXjHpRTFH1itzhg4Ku1qSoF83b96lv0Jbu8FcCJdgXZdxnuAj
# 5qais5N+6NSiFnCkrq5BLxPUdkeWPrRlF9unYTee2djbGWLz8ff9EI4sj9BLlKac
# LP0sy5HtVQSyZ3vqGPACJyPWzh0R5Op4osVcA995BMBSiIsH0VuSXBncx713bZN7
# 1lSBDQKvM0Ze0LijQgzcz79zf3wBLsWPuq/Kt4rKRne5ZxOqXW5g+8mRCsAuEp3L
# wpXMmT20dcfKZrVxE4elGtGLWEvAs+AKT9rl/tgr4xzHoywHVwctZv6gyV+ncI7c
# dxQkcIr0ekM=
# =J7rn
# -----END PGP SIGNATURE-----
# gpg: Signature made Tue 19 Nov 2024 17:26:00 GMT
# gpg: using RSA key DC3DEB159A9AF95D3D7456FE7F09B272C88F2FD6
# gpg: issuer "kwolf@redhat.com"
# gpg: Good signature from "Kevin Wolf <kwolf@redhat.com>" [full]
# Primary key fingerprint: DC3D EB15 9A9A F95D 3D74 56FE 7F09 B272 C88F 2FD6
* tag 'for-upstream' of https://repo.or.cz/qemu/kevin:
vl: use qmp_device_add() in qemu_create_cli_devices()
qdev-monitor: avoid QemuOpts in QMP device_add
qdev: Fix set_pci_devfn() to visit option only once
python: silence pylint raising-non-exception error
python: disable too-many-positional-arguments warning
iotests: correct resultclass type in ReproducibleTestRunner
iotests: reflow ReproducibleTestRunner arguments
parallels: fix possible int overflow
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Compare: https://github.com/qemu/qemu/compare/e6459afb1ff4...5b3f601bc1e1
To unsubscribe from these emails, change your notification settings at
https://github.com/qemu/qemu/settings/notifications
- [Qemu-commits] [qemu/qemu] 49e51f: parallels: fix possible int overflow,
Peter Maydell <=