KVM: VMX: don't allow memory operands for inline asm that modifies SP
THUNK_TARGET defines [thunk_target] as having "rm" input constraints
when CONFIG_RETPOLINE is not set, which isn't constrained enough for
this specific case.
For inline assembly that modifies the stack pointer before using this
input, the underspecification of constraints is dangerous, and results
in an indirect call to a previously pushed flags register.
In this case `entry`'s stack slot is good enough to satisfy the "m"
constraint in "rm", but the inline assembly in
handle_external_interrupt_irqoff() modifies the stack pointer via
push+pushf before using this input, which in this case results in
calling what was the previous state of the flags register, rather than
Be more specific in the constraints by requiring `entry` be in a
register, and not a memory operand.
Reported-by: Dmitry Vyukov <email@example.com>
Debugged-by: Alexander Potapenko <firstname.lastname@example.org>
Debugged-by: Paolo Bonzini <email@example.com>
Debugged-by: Sean Christopherson <firstname.lastname@example.org>
Signed-off-by: Nick Desaulniers <email@example.com>
Signed-off-by: Paolo Bonzini <firstname.lastname@example.org>
1 file changed