You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
qemu/target/ppc/translate
Denis Sergeev 6c51df580d
target/ppc: use MAKE_64BIT_MASK for mcrfs exception clear mask
In gen_mcrfs() the FPSCR nibble mask is computed as:
      `~((0xF << shift) & FP_EX_CLEAR_BITS)`

Here, 0xF is of type int, so the left shift is performed in
32-bit signed arithmetic. For bfa=0 we get shift=28,
and (0xF << 28) = 0xF0000000, which is not representable as a 32-bit
signed int. Static analyzers flag this as a potential integer
overflow.

Found by Linux Verification Center (linuxtesting.org) with SVACE.

Signed-off-by: Denis Sergeev <zeff@altlinux.org>
Reviewed-by: Chinmay Rath <rathc@linux.ibm.com>
Signed-off-by: Harsh Prateek Bora <harshpb@linux.ibm.com>
Link: https://lore.kernel.org/r/20250915080118.29898-1-zeff@altlinux.org
Message-ID: <20250915080118.29898-1-zeff@altlinux.org>
2 weeks ago
..
bhrb-impl.c.inc target/ppc: Add clrbhrb and mfbhrbe instructions 1 year ago
branch-impl.c.inc target/ppc: Add recording of taken branches to BHRB 1 year ago
dfp-impl.c.inc tcg: Rename cpu_env to tcg_env 2 years ago
fixedpoint-impl.c.inc target/ppc: Move logical fixed-point instructions to decodetree. 1 year ago
fp-impl.c.inc target/ppc: use MAKE_64BIT_MASK for mcrfs exception clear mask 2 weeks ago
fp-ops.c.inc target/ppc: Move remaining floating-point move instructions to decodetree. 2 weeks ago
misc-impl.c.inc target/ppc: Implement attn instruction on BookS 64-bit processors 1 year ago
ppe-impl.c.inc target/ppc: Add IBM PPE42 special instructions 2 weeks ago
processor-ctrl-impl.c.inc target/ppc: add SMT support to msgsnd broadcast 1 year ago
spe-impl.c.inc tcg: Rename cpu_env to tcg_env 2 years ago
spe-ops.c.inc meson: rename included C source files to .c.inc 5 years ago
storage-ctrl-impl.c.inc target/ppc: Fix broadcast tlbie synchronisation 1 year ago
vmx-impl.c.inc target/ppc: Fix facility interrupt checks for VSX 7 months ago
vmx-ops.c.inc target/ppc: Move VMX integer add/sub saturate insns to decodetree. 1 year ago
vsx-impl.c.inc target/ppc: Fix facility interrupt checks for VSX 7 months ago
vsx-ops.c.inc target/ppc: Move VSX fp compare insns to decodetree. 1 year ago