[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH] accel/tcg: Assert mmu_idx in range before use in cputlb
From: |
Peter Maydell |
Subject: |
Re: [PATCH] accel/tcg: Assert mmu_idx in range before use in cputlb |
Date: |
Fri, 22 Apr 2022 14:32:27 +0100 |
On Fri, 1 Apr 2022 at 18:08, Richard Henderson
<richard.henderson@linaro.org> wrote:
>
> Coverity reports out-of-bound accesses within cputlb.c.
> This should be a false positive due to how the index is
> decoded from MemOpIdx. To be fair, nothing is checking
> the correct bounds during encoding either.
>
> Assert index in range before use, both to catch user errors
> and to pacify static analysis.
>
> Fixes: Coverity CID 1487120, 1487127, 1487170, 1487196, 1487215, 1487238
> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
> ---
> accel/tcg/cputlb.c | 40 +++++++++++++++++++++++++++-------------
> 1 file changed, 27 insertions(+), 13 deletions(-)
>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
thanks
-- PMM