mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-06 02:50:49 +09:00
x86/bugs: Fix use of possibly uninit value in amd_check_tsa_microcode()
For kernels compiled with CONFIG_INIT_STACK_NONE=y, the value of __reserved
field in zen_patch_rev union on the stack may be garbage. If so, it will
prevent correct microcode check when consulting p.ucode_rev, resulting in
incorrect mitigation selection.
This is a stable-only fix.
Cc: <stable@vger.kernel.org>
Signed-off-by: Michael Zhivich <mzhivich@akamai.com>
Fixes: 90293047df ("x86/bugs: Add a Transient Scheduler Attacks mitigation")
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
f9377bdf86
commit
98be604d96
@@ -549,6 +549,8 @@ static bool amd_check_tsa_microcode(void)
|
||||
p.model = c->x86_model;
|
||||
p.ext_model = c->x86_model >> 4;
|
||||
p.stepping = c->x86_stepping;
|
||||
/* reserved bits are expected to be 0 in test below */
|
||||
p.__reserved = 0;
|
||||
|
||||
if (cpu_has(c, X86_FEATURE_ZEN3) ||
|
||||
cpu_has(c, X86_FEATURE_ZEN4)) {
|
||||
|
||||
Reference in New Issue
Block a user