x86/microcode: Add missing unlock in microcode_update_helper()
PATCH 1/1 x86/microcode: Add missing unlock in microcode_update_helper()
microcode_update_helper() may return early while holding cpu_add_remove_lock, hence preventing any writers from taking it again.
Leave through the put label instead so it's properly released.
Signed-off-by Alejandro Vallejo <[email protected]>
--- xen/arch/x86/cpu/microcode/core.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
xen/arch/x86/cpu/microcode/core.c +2 -1
@@ -599,7 +599,8 @@ static long cf_check microcode_update_helper(void *data)printk (XENLOG_WARNING "CPU%u is expected to lead ucode loading (but got CPU%u)\n" , nmi_cpu,cpumask_first (&cpu_online_map)); -return -EPERM ; + ret = -EPERM ; + goto put; } patch =parse_blob (buffer->buffer, buffer->len);
Signature · 1 line
2.34.1
Quoted 4 lines · Alejandro Vallejo
microcode_update_helper()may return early while holdingcpu_add_remove_lock, hence preventing any writers from taking it again.Leave through the
putlabel instead so it's properly released.
Fixes 5ed12565aa32 ("microcode: rendezvous CPUs in NMI handler and load
ucode")
Quoted 1 line
Signed-off-by Alejandro Vallejo <[email protected]>
Reviewed-by Andrew Cooper <[email protected]>
I'll add the fixes on commit.
~Andrew