Re: [PATCH] hw/tpm/tpm_tis_common.c: Assert that locty is in range

2022-05-18 Thread Peter Maydell
On Wed, 18 May 2022 at 14:46, Stefan Berger wrote: > > > > On 5/13/22 12:38, Peter Maydell wrote: > > In tpm_tis_mmio_read(), tpm_tis_mmio_write() and > > tpm_tis_dump_state(), we calculate a locality index with > > tpm_tis_locality_from_addr() and then use it as an index into the > > s->loc[] arr

Re: [PATCH] hw/tpm/tpm_tis_common.c: Assert that locty is in range

2022-05-18 Thread Stefan Berger
On 5/13/22 12:38, Peter Maydell wrote: In tpm_tis_mmio_read(), tpm_tis_mmio_write() and tpm_tis_dump_state(), we calculate a locality index with tpm_tis_locality_from_addr() and then use it as an index into the s->loc[] array. In all these cases, the array index can't overflow because the Mem

Re: [PATCH] hw/tpm/tpm_tis_common.c: Assert that locty is in range

2022-05-13 Thread Philippe Mathieu-Daudé via
On Fri, May 13, 2022 at 6:43 PM Peter Maydell wrote: > > In tpm_tis_mmio_read(), tpm_tis_mmio_write() and > tpm_tis_dump_state(), we calculate a locality index with > tpm_tis_locality_from_addr() and then use it as an index into the > s->loc[] array. In all these cases, the array index can't over

[PATCH] hw/tpm/tpm_tis_common.c: Assert that locty is in range

2022-05-13 Thread Peter Maydell
In tpm_tis_mmio_read(), tpm_tis_mmio_write() and tpm_tis_dump_state(), we calculate a locality index with tpm_tis_locality_from_addr() and then use it as an index into the s->loc[] array. In all these cases, the array index can't overflow because the MemoryRegion is sized to be TPM_TIS_NUM_LOCALIT