kernel_samsung_a53x/drivers/edac
Priyanka Singh c97db1a208 EDAC/fsl_ddr: Fix bad bit shift operations
[ Upstream commit 9ec22ac4fe766c6abba845290d5139a3fbe0153b ]

Fix undefined behavior caused by left-shifting a negative value in the
expression:

    cap_high ^ (1 << (bad_data_bit - 32))

The variable bad_data_bit ranges from 0 to 63. When it is less than 32,
bad_data_bit - 32 becomes negative, and left-shifting by a negative
value in C is undefined behavior.

Fix this by combining cap_high and cap_low into a 64-bit variable.

  [ bp: Massage commit message, simplify error bits handling. ]

Fixes: ea2eb9a8b620 ("EDAC, fsl-ddr: Separate FSL DDR driver from MPC85xx")
Signed-off-by: Priyanka Singh <priyanka.singh@nxp.com>
Signed-off-by: Li Yang <leoyang.li@nxp.com>
Signed-off-by: Frank Li <Frank.Li@nxp.com>
Signed-off-by: Borislav Petkov (AMD) <bp@alien8.de>
Link: https://lore.kernel.org/r/20241016-imx95_edac-v3-3-86ae6fc2756a@nxp.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
2024-12-17 13:23:59 +01:00
..
al_mc_edac.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
altera_edac.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
altera_edac.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
amd64_edac.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
amd64_edac.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
amd64_edac_dbg.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
amd64_edac_inj.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
amd76x_edac.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
amd8111_edac.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
amd8111_edac.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
amd8131_edac.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
amd8131_edac.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
armada_xp_edac.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
aspeed_edac.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
bluefield_edac.c EDAC/bluefield: Fix potential integer overflow 2024-12-17 13:23:59 +01:00
cell_edac.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
cpc925_edac.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
debugfs.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
dmc520_edac.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
e7xxx_edac.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
e752x_edac.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
edac_device.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
edac_device.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
edac_device_sysfs.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
edac_mc.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
edac_mc.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
edac_mc_sysfs.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
edac_module.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
edac_module.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
edac_pci.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
edac_pci.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
edac_pci_sysfs.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
fsl_ddr_edac.c EDAC/fsl_ddr: Fix bad bit shift operations 2024-12-17 13:23:59 +01:00
fsl_ddr_edac.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
ghes_edac.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
highbank_l2_edac.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
highbank_mc_edac.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
i7core_edac.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
i10nm_base.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
i3000_edac.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
i3200_edac.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
i5000_edac.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
i5100_edac.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
i5400_edac.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
i7300_edac.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
i82443bxgx_edac.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
i82860_edac.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
i82875p_edac.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
i82975x_edac.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
ie31200_edac.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
Kconfig Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
layerscape_edac.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
Makefile EDAC, i10nm: make skx_common.o a separate module 2024-11-23 23:19:56 +01:00
mce_amd.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
mce_amd.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
mpc85xx_edac.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
mpc85xx_edac.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
mv64x60_edac.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
mv64x60_edac.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
octeon_edac-l2c.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
octeon_edac-lmc.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
octeon_edac-pc.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
octeon_edac-pci.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
pasemi_edac.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
pnd2_edac.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
pnd2_edac.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
ppc4xx_edac.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
ppc4xx_edac.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
qcom_edac.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
r82600_edac.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
sb_edac.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
sifive_edac.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
skx_base.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
skx_common.c EDAC, i10nm: make skx_common.o a separate module 2024-11-23 23:19:56 +01:00
skx_common.h EDAC, i10nm: make skx_common.o a separate module 2024-11-23 23:19:56 +01:00
synopsys_edac.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
thunderx_edac.c EDAC/thunderx: Fix possible out-of-bounds string access 2024-11-18 12:12:19 +01:00
ti_edac.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
wq.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
x38_edac.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
xgene_edac.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00