summary refs log tree commit diff stats
path: root/include/hw/xen/interface/sched.h
diff options
context:
space:
mode:
authorPeter Maydell <peter.maydell@linaro.org>2025-02-28 17:47:59 +0000
committerPhilippe Mathieu-Daudé <philmd@linaro.org>2025-03-11 20:01:27 +0100
commit2fa3a5b9469615d06091cf473d172794148e1248 (patch)
tree4bf93381adb05ea5e769cb4db1bbee3e2e57fc3f /include/hw/xen/interface/sched.h
parent822405b1fea4f0f404df418bd70da0588b9207ce (diff)
downloadfocaccia-qemu-2fa3a5b9469615d06091cf473d172794148e1248.tar.gz
focaccia-qemu-2fa3a5b9469615d06091cf473d172794148e1248.zip
hw/net/smc91c111: Sanitize packet numbers
The smc91c111 uses packet numbers as an index into its internal
s->data[][] array. Valid packet numbers are between 0 and 3, but
the code does not generally check this, and there are various
places where the guest can hand us an arbitrary packet number
and cause an out-of-bounds access to the data array.

Add validation of packet numbers. The datasheet is not very
helpful about how guest errors like this should be handled:
it says nothing on the subject, and none of the documented
error conditions are relevant. We choose to log the situation
with LOG_GUEST_ERROR and silently ignore the attempted operation.

In the places where we are about to access the data[][] array
using a packet number and we know the number is valid because
we got it from somewhere that has already validated, we add
an assert() to document that belief.

Cc: qemu-stable@nongnu.org
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Message-ID: <20250228174802.1945417-2-peter.maydell@linaro.org>
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Diffstat (limited to 'include/hw/xen/interface/sched.h')
0 files changed, 0 insertions, 0 deletions