All of lore.kernel.org
 help / color / mirror / Atom feed
From: Richard Henderson <richard.henderson@linaro.org>
To: qemu-devel@nongnu.org
Cc: Thomas Huth <thuth@redhat.com>, David Hildenbrand <david@redhat.com>
Subject: [PULL 2/6] target/s390x: Fix the accumulation of ccm in op_icm
Date: Tue, 26 Apr 2022 21:39:38 -0700	[thread overview]
Message-ID: <20220427043942.294654-3-richard.henderson@linaro.org> (raw)
In-Reply-To: <20220427043942.294654-1-richard.henderson@linaro.org>

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>
Reviewed-by: David Hildenbrand <david@redhat.com>
Reviewed-by: Thomas Huth <thuth@redhat.com>
Message-Id: <20220401193659.332079-1-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 ae70368966..8f092dab95 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;
-- 
2.34.1



  parent reply	other threads:[~2022-04-27  4:42 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-04-27  4:39 [PULL 0/6] Coverity patch queue Richard Henderson
2022-04-27  4:39 ` [PULL 1/6] accel/tcg: Assert mmu_idx in range before use in cputlb Richard Henderson
2022-04-27  4:39 ` Richard Henderson [this message]
2022-04-27  4:39 ` [PULL 3/6] target/i386: Suppress coverity warning on fsave/frstor Richard Henderson
2022-04-27  4:39 ` [PULL 4/6] softfloat: Fix declaration of partsN_compare Richard Henderson
2022-04-27  4:39 ` [PULL 5/6] softfloat: Use FloatRelation within partsN_compare Richard Henderson
2022-04-27  4:39 ` [PULL 6/6] softfloat: Use FloatRelation for fracN_cmp Richard Henderson
2022-04-27  5:54 ` [PULL 0/6] Coverity patch queue Richard Henderson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220427043942.294654-3-richard.henderson@linaro.org \
    --to=richard.henderson@linaro.org \
    --cc=david@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=thuth@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.