qemu-arm
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH v2 13/13] hw/intc/arm_gicv3_its: Range-check ICID before inde


From: Richard Henderson
Subject: Re: [PATCH v2 13/13] hw/intc/arm_gicv3_its: Range-check ICID before indexing into collection table
Date: Fri, 28 Jan 2022 12:44:12 +1100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.5.0

On 1/12/22 04:10, Peter Maydell wrote:
In process_its_cmd(), we read an ICID out of the interrupt table
entry, and then use it as an index into the collection table.  Add a
check that it is within range for the collection table first.

This check is not strictly necessary, because:
  * we range check the ICID from the guest before writing it into
    the interrupt table entry, so the the only way to get an
    out of range ICID in process_its_cmd() is if a badly-behaved
    guest is writing directly to the interrupt table memory
  * the collection table is in guest memory, so QEMU won't fall
    over if we read off the end of it

However, it seems clearer to include the check.

Signed-off-by: Peter Maydell<peter.maydell@linaro.org>
---
  hw/intc/arm_gicv3_its.c | 7 +++++++
  1 file changed, 7 insertions(+)

Reviewed-by: Richard Henderson <richard.henderson@linaro.org>

r~



reply via email to

[Prev in Thread] Current Thread [Next in Thread]