[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH 07/26] hw/intc/arm_gicv3_its: Correct setting of TableDesc en
From: |
Alex Bennée |
Subject: |
Re: [PATCH 07/26] hw/intc/arm_gicv3_its: Correct setting of TableDesc entry_sz |
Date: |
Mon, 13 Dec 2021 11:37:42 +0000 |
User-agent: |
mu4e 1.7.5; emacs 28.0.90 |
Peter Maydell <peter.maydell@linaro.org> writes:
> We set the TableDesc entry_sz field from the appropriate
> GITS_BASER.ENTRYSIZE field. That ID register field specifies the
> number of bytes per table entry minus one. However when we use
> td->entry_sz we assume it to be the number of bytes per table entry
> (for instance we calculate the number of entries in a page by
> dividing the page size by the entry size).
>
> The effects of this bug are:
> * we miscalculate the maximum number of entries in the table,
> so our checks on guest index values are wrong (too lax)
> * when looking up an entry in the second level of an indirect
> table, we calculate an incorrect index into the L2 table.
> Because we make the same incorrect calculation on both
> reads and writes of the L2 table, the guest won't notice
> unless it's unlucky enough to use an index value that
> causes us to index off the end of the L2 table page and
> cause guest memory corruption in whatever follows
>
> Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Alex Bennée <alex.bennee@linaro.org>
--
Alex Bennée
- Re: [PATCH 08/26] hw/intc/arm_gicv3_its: Don't misuse GITS_TYPE_PHYSICAL define, (continued)
- [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
- [PATCH 14/26] hw/intc/arm_gicv3_its: Fix various off-by-one errors, Peter Maydell, 2021/12/11
- [PATCH 12/26] hw/intc/arm_gicv3_its: Correct comment about CTE RDBase field size, Peter Maydell, 2021/12/11
- [PATCH 17/26] hw/intc/arm_gicv3_its: Convert int ID check to num_intids convention, Peter Maydell, 2021/12/11