Commit 51c70a7c authored by Rishabh Bhatnagar's avatar Rishabh Bhatnagar Committed by sanglipeng
Browse files

KVM: x86: move guest_pv_has out of user_access section

stable inclusion
from stable-v5.10.180
commit fcfe05990a5ce95361dbcae308632861d3c40dfd
category: bugfix
bugzilla: https://gitee.com/openeuler/kernel/issues/I8FC2O

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



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

From: Paolo Bonzini <pbonzini@redhat.com>

commit 3e067fd8 upstream.

When UBSAN is enabled, the code emitted for the call to guest_pv_has
includes a call to __ubsan_handle_load_invalid_value.  objtool
complains that this call happens with UACCESS enabled; to avoid
the warning, pull the calls to user_access_begin into both arms
of the "if" statement, after the check for guest_pv_has.

Reported-by: default avatarStephen Rothwell <sfr@canb.auug.org.au>
Cc: David Woodhouse <dwmw2@infradead.org>
Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
Signed-off-by: default avatarRishabh Bhatnagar <risbhat@amazon.com>
Tested-by: default avatarAllen Pais <apais@linux.microsoft.com>
Acked-by: default avatarSean Christopherson <seanjc@google.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: default avatarsanglipeng <sanglipeng1@jd.com>
parent d2a9b5d3
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment