qemu-devel
[Top][All Lists]
Advanced

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

Re: [PATCH] target/mips: Fix potential integer overflow (CID 1452921)


From: Richard Henderson
Subject: Re: [PATCH] target/mips: Fix potential integer overflow (CID 1452921)
Date: Thu, 6 May 2021 10:59:43 -0700
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.7.1

On 5/5/21 2:51 PM, Philippe Mathieu-Daudé wrote:
Use the BIT_ULL() macro to ensure we use 64-bit arithmetic.
This fixes the following Coverity issue (OVERFLOW_BEFORE_WIDEN):

   CID 1452921:  Integer handling issues:

     Potentially overflowing expression "1 << w" with type "int"
     (32 bits, signed) is evaluated using 32-bit arithmetic, and
     then used in a context that expects an expression of type
     "uint64_t" (64 bits, unsigned).

Fixes: 074cfcb4dae ("target/mips: Implement hardware page table walker")
Signed-off-by: Philippe Mathieu-Daudé<f4bug@amsat.org>
---
  target/mips/tcg/sysemu/tlb_helper.c | 3 ++-
  1 file changed, 2 insertions(+), 1 deletion(-)

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

r~



reply via email to

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