From f442b1f0811c0da01e8cf709c65c556575206b1d Mon Sep 17 00:00:00 2001 From: "Russell King (Oracle)" Date: Thu, 28 Apr 2022 08:13:04 +0000 Subject: [PATCH] ARM: fix Thumb2 regression with Spectre BHB stable inclusion from stable-v4.19.235 commit 691f354689e94571853c79ac3d7d6e7f27dfb87b category: bugfix bugzilla: 186460, https://gitee.com/src-openeuler/kernel/issues/I53MHA CVE: CVE-2022-23960 -------------------------------- commit 6c7cb60bff7aec24b834343ff433125f469886a3 upstream. When building for Thumb2, the vectors make use of a local label. Sadly, the Spectre BHB code also uses a local label with the same number which results in the Thumb2 reference pointing at the wrong place. Fix this by changing the number used for the Spectre BHB local label. Fixes: b9baf5c8c5c3 ("ARM: Spectre-BHB workaround") Tested-by: Nathan Chancellor Signed-off-by: Russell King (Oracle) Signed-off-by: Linus Torvalds Signed-off-by: Greg Kroah-Hartman Reviewed-by: Xiu Jianfeng Reviewed-by: Liao Chang Signed-off-by: Yongqiang Liu --- arch/arm/kernel/entry-armv.S | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/arm/kernel/entry-armv.S b/arch/arm/kernel/entry-armv.S index ffcff378e3c8..c2d36d31e908 100644 --- a/arch/arm/kernel/entry-armv.S +++ b/arch/arm/kernel/entry-armv.S @@ -1076,9 +1076,9 @@ vector_bhb_loop8_\name: @ bhb workaround mov r0, #8 -1: b . + 4 +3: b . + 4 subs r0, r0, #1 - bne 1b + bne 3b dsb isb b 2b -- GitLab