[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH] target/s390x: Fix the accumulation of ccm in op_icm
From: |
David Hildenbrand |
Subject: |
Re: [PATCH] target/s390x: Fix the accumulation of ccm in op_icm |
Date: |
Mon, 4 Apr 2022 10:36:21 +0200 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.6.2 |
On 01.04.22 21:36, Richard Henderson wrote:
> Coverity rightly reports that 0xff << pos can overflow.
> This would affect the ICMH instruction.
>
> Fixes: Coverity CID 1487161
> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
> ---
> target/s390x/tcg/translate.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/target/s390x/tcg/translate.c b/target/s390x/tcg/translate.c
> index 5acfc0ff9b..ea7baf0832 100644
> --- a/target/s390x/tcg/translate.c
> +++ b/target/s390x/tcg/translate.c
> @@ -2622,7 +2622,7 @@ static DisasJumpType op_icm(DisasContext *s, DisasOps
> *o)
> tcg_gen_qemu_ld8u(tmp, o->in2, get_mem_index(s));
> tcg_gen_addi_i64(o->in2, o->in2, 1);
> tcg_gen_deposit_i64(o->out, o->out, tmp, pos, 8);
> - ccm |= 0xff << pos;
> + ccm |= 0xffull << pos;
> }
> m3 = (m3 << 1) & 0xf;
> pos -= 8;
Reviewed-by: David Hildenbrand <david@redhat.com>
--
Thanks,
David / dhildenb