android_kernel_motorola_sm6375/arch/arm64
Repository files (latest commit first)
Filename Latest commit message Latest commit date
D Scott Phillips 1db90f97d7 arm64: Fix bit-shifting UB in the MIDR_CPU_MODEL() macro
commit 8ec8490a1950efeccb00967698cf7cb2fcd25ca7 upstream.

CONFIG_UBSAN_SHIFT with gcc-5 complains that the shifting of
ARM_CPU_IMP_AMPERE (0xC0) into bits [31:24] by MIDR_CPU_MODEL() is
undefined behavior. Well, sort of, it actually spells the error as:

 arch/arm64/kernel/proton-pack.c: In function 'spectre_bhb_loop_affected':
 arch/arm64/include/asm/cputype.h:44:2: error: initializer element is not constant
   (((imp)   << MIDR_IMPLEMENTOR_SHIFT) | \
   ^

This isn't an issue for other Implementor codes, as all the other codes
have zero in the top bit and so are representable as a signed int.

Cast the implementor code to unsigned in MIDR_CPU_MODEL to remove the
undefined behavior.

Fixes: 0e5d5ae837c8 ("arm64: Add AMPERE1 to the Spectre-BHB affected list")
Reported-by: Geert Uytterhoeven <[email protected]>
Signed-off-by: D Scott Phillips <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Catalin Marinas <[email protected]>
Signed-off-by: Ovidiu Panait <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
2023-08-11 11:53:54 +02:00
..
boot arm64: dts: renesas: ulcb-kf: Remove flow control for SCIF1 2023-07-27 08:37:14 +02:00
configs
crypto crypto: arm64/gcm - Select AEAD for GHASH_ARM64_CE 2022-08-25 11:17:41 +02:00
include arm64: Fix bit-shifting UB in the MIDR_CPU_MODEL() macro 2023-08-11 11:53:54 +02:00
kernel arm64: Add AMPERE1 to the Spectre-BHB affected list 2023-08-11 11:53:54 +02:00
kvm arm64: Use the clearbhb instruction in mitigations 2022-03-19 13:40:15 +01:00
lib
mm arm64: mm: fix VA-range sanity check 2023-07-27 08:37:42 +02:00
net bpf, arm64: Clear prog->jited_len along prog->jited 2022-06-14 18:11:57 +02:00
xen
Kbuild
Kconfig arm64: errata: Remove AES hwcap for COMPAT tasks 2022-10-29 10:20:35 +02:00
Kconfig.debug
Kconfig.platforms irqchip/exiu: Fix acknowledgment of edge triggered interrupts 2022-06-14 18:11:35 +02:00
Makefile