summary refs log tree commit diff stats
path: root/scripts/qapi
diff options
context:
space:
mode:
authorPeter Maydell <peter.maydell@linaro.org>2024-08-30 18:34:52 +0100
committerThomas Huth <huth@tuxfamily.org>2024-09-08 11:49:49 +0200
commitdf827aace663fdd9c432e2ff76fb13d20cbc0ca4 (patch)
tree7de5e9ae24e16716faaa3fa01776fe3b65f895a3 /scripts/qapi
parent175f5a5b48033579d4de5c904a9f43c0d327152e (diff)
downloadfocaccia-qemu-df827aace663fdd9c432e2ff76fb13d20cbc0ca4.tar.gz
focaccia-qemu-df827aace663fdd9c432e2ff76fb13d20cbc0ca4.zip
hw/nubus/nubus-device: Range check 'slot' property
The TYPE_NUBUS_DEVICE class lets the user specify the nubus slot
using an int32 "slot" QOM property.  Its realize method doesn't do
any range checking on this value, which Coverity notices by way of
the possibility that 'nd->slot * NUBUS_SUPER_SLOT_SIZE' might
overflow the 32-bit arithmetic it is using.

Constrain the slot value to be less than NUBUS_SLOT_NB (16).

Resolves: Coverity CID 1464070
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Message-ID: <20240830173452.2086140-4-peter.maydell@linaro.org>
Reviewed-by: Thomas Huth <huth@tuxfamily.org>
Reviewed-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
Signed-off-by: Thomas Huth <huth@tuxfamily.org>
Diffstat (limited to 'scripts/qapi')
0 files changed, 0 insertions, 0 deletions