[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH 16/26] hw/intc/arm_gicv3_its: Fix event ID bounds checks
From: |
Philippe Mathieu-Daudé |
Subject: |
Re: [PATCH 16/26] hw/intc/arm_gicv3_its: Fix event ID bounds checks |
Date: |
Mon, 13 Dec 2021 14:00:23 +0100 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.3.0 |
On 12/11/21 20:11, Peter Maydell wrote:
> In process_its_cmd() and process_mapti() we must check the
> event ID against a limit defined by the size field in the DTE,
> which specifies the number of ID bits minus one. Convert
> this code to our num_foo convention, fixing the off-by-one error.
>
> Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
> ---
> hw/intc/arm_gicv3_its.c | 14 +++++++-------
> 1 file changed, 7 insertions(+), 7 deletions(-)
> @@ -299,10 +299,10 @@ static bool process_its_cmd(GICv3ITSState *s, uint64_t
> value, uint32_t offset,
> dte_valid ? "valid" : "invalid",
> ite_valid ? "valid" : "invalid",
> cte_valid ? "valid" : "invalid");
> - } else if (eventid > max_eventid) {
> + } else if (eventid >= num_eventids) {
> qemu_log_mask(LOG_GUEST_ERROR,
> "%s: invalid command attributes: eventid %d > %d\n",
">=" in format.
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
> - __func__, eventid, max_eventid);
> + __func__, eventid, num_eventids);
- Re: [PATCH 11/26] hw/intc/arm_gicv3_its: Use 1ULL when shifting by (DTE.SIZE + 1), (continued)
- [PATCH 10/26] hw/intc/arm_gicv3_its: Use FIELD macros for DTEs, Peter Maydell, 2021/12/11
- [PATCH 08/26] hw/intc/arm_gicv3_its: Don't misuse GITS_TYPE_PHYSICAL define, Peter Maydell, 2021/12/11
- [PATCH 16/26] hw/intc/arm_gicv3_its: Fix event ID bounds checks, Peter Maydell, 2021/12/11
- [PATCH 18/26] hw/intc/arm_gicv3_its: Fix handling of process_its_cmd() return value, Peter Maydell, 2021/12/11
- [PATCH 07/26] hw/intc/arm_gicv3_its: Correct setting of TableDesc entry_sz, Peter Maydell, 2021/12/11
- [PATCH 09/26] hw/intc/arm_gicv3_its: Correct handling of MAPI, Peter Maydell, 2021/12/11