qemu-devel
[Top][All Lists]
Advanced

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

Re: [PATCH] target/mips: tcg: detect out-of-bounds accesses to cpu_gpr a


From: Richard Henderson
Subject: Re: [PATCH] target/mips: tcg: detect out-of-bounds accesses to cpu_gpr and cpu_gpr_hi
Date: Mon, 3 Apr 2023 11:21:51 -0700
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.9.0

On 4/3/23 10:29, Paolo Bonzini wrote:
In some cases (for example gen_compute_branch_nm in
nanomips_translate.c.inc) registers can be unused
on some paths and a negative value is passed in that case:

         gen_compute_branch_nm(ctx, OPC_BPOSGE32, 4, -1, -2,
                               imm << 1);

To avoid an out of bounds access in those cases, introduce
assertions.

Signed-off-by: Paolo Bonzini<pbonzini@redhat.com>
---
  target/mips/tcg/translate.c | 4 ++++
  1 file changed, 4 insertions(+)

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

r~



reply via email to

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