提交 d8ad0fc2 编写于 作者: J James Morse 提交者: Zheng Zengkai

arm64: kvm: Fix copy-and-paste error in bhb templates for v5.10 stable

stable inclusion
from stable-v5.10.107
commit 7a0d13ef67a1084e1a77bf4d2334cc482699f861
category: bugfix
bugzilla: 186460 https://gitee.com/src-openeuler/kernel/issues/I53MHA
CVE: CVE-2022-23960

Reference: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=7a0d13ef67a1084e1a77bf4d2334cc482699f861

--------------------------------

KVM's infrastructure for spectre mitigations in the vectors in v5.10 and
earlier is different, it uses templates which are used to build a set of
vectors at runtime.

There are two copy-and-paste errors in the templates: __spectre_bhb_loop_k24
should loop 24 times and __spectre_bhb_loop_k32 32.

Fix these.
Reported-by: NPavel Machek <pavel@denx.de>
Link: https://lore.kernel.org/all/20220310234858.GB16308@amd/Signed-off-by: NJames Morse <james.morse@arm.com>
Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: NChen Jiahao <chenjiahao16@huawei.com>
Reviewed-by: NLiao Chang <liaochang1@huawei.com>
Signed-off-by: NZheng Zengkai <zhengzengkai@huawei.com>
上级 082ba1be
...@@ -68,7 +68,7 @@ SYM_DATA_START(__spectre_bhb_loop_k24) ...@@ -68,7 +68,7 @@ SYM_DATA_START(__spectre_bhb_loop_k24)
esb esb
sub sp, sp, #(8 * 2) sub sp, sp, #(8 * 2)
stp x0, x1, [sp, #(8 * 0)] stp x0, x1, [sp, #(8 * 0)]
mov x0, #8 mov x0, #24
2: b . + 4 2: b . + 4
subs x0, x0, #1 subs x0, x0, #1
b.ne 2b b.ne 2b
...@@ -85,7 +85,7 @@ SYM_DATA_START(__spectre_bhb_loop_k32) ...@@ -85,7 +85,7 @@ SYM_DATA_START(__spectre_bhb_loop_k32)
esb esb
sub sp, sp, #(8 * 2) sub sp, sp, #(8 * 2)
stp x0, x1, [sp, #(8 * 0)] stp x0, x1, [sp, #(8 * 0)]
mov x0, #8 mov x0, #32
2: b . + 4 2: b . + 4
subs x0, x0, #1 subs x0, x0, #1
b.ne 2b b.ne 2b
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册