x86/bugs: Fix use of possibly uninit value in amd_check_tsa_microcode()
authorMichael Zhivich <mzhivich@akamai.com>
Wed, 23 Jul 2025 13:40:19 +0000 (09:40 -0400)
committerSalvatore Bonaccorso <carnil@debian.org>
Sat, 2 Aug 2025 13:13:02 +0000 (15:13 +0200)
commite6566b359b3a2284199b4958ec62cbc7cdc06f02
tree1c42ff33f35f0fa1721d923e01916ee231516642
parent5477765fcdf9d53b0c84e2dac45bec7064cab459
x86/bugs: Fix use of possibly uninit value in amd_check_tsa_microcode()

Origin: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git/commit?id=ab2c2b383f0b1a2a37d06219952f59ed0e88fa02

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: d12145e8454f ("x86/bugs: Add a Transient Scheduler Attacks mitigation")
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Gbp-Pq: Topic bugfix/x86
Gbp-Pq: Name x86-bugs-Fix-use-of-possibly-uninit-value-in-amd_che.patch
arch/x86/kernel/cpu/amd.c