Commit 954d4f47 authored by Joerg Roedel's avatar Joerg Roedel Committed by Zheng Zengkai
Browse files

x86/sev-es: Don't return NULL from sev_es_get_ghcb()



stable inclusion
from stable-5.10.40
commit be4cba71b2d068f783ede32775212ef4da3238c4
bugzilla: 51882
CVE: NA

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

commit b250f2f7 upstream.

sev_es_get_ghcb() is called from several places but only one of them
checks the return value. The reaction to returning NULL is always the
same: calling panic() and kill the machine.

Instead of adding checks to all call sites, move the panic() into the
function itself so that it will no longer return NULL.

Fixes: 0786138c ("x86/sev-es: Add a Runtime #VC Exception Handler")
Signed-off-by: default avatarJoerg Roedel <jroedel@suse.de>
Signed-off-by: default avatarBorislav Petkov <bp@suse.de>
Cc: stable@vger.kernel.org # v5.10+
Link: https://lkml.kernel.org/r/20210519135251.30093-2-joro@8bytes.org


Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: default avatarChen Jun <chenjun102@huawei.com>
Acked-by: default avatarWeilong Chen <chenweilong@huawei.com>
Signed-off-by: default avatarZheng Zengkai <zhengzengkai@huawei.com>
parent f168ef65
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment