x86/emul: Correct the handling of eflags with SYSCALL
authorAndrew Cooper <andrew.cooper3@citrix.com>
Sun, 18 Dec 2016 15:42:59 +0000 (15:42 +0000)
committerAndrew Cooper <andrew.cooper3@citrix.com>
Mon, 19 Dec 2016 15:44:32 +0000 (15:44 +0000)
commitb9a8061bc28930b0c922a5d828447c52e4e873c2
tree0a41f3097104e36ff71bd77af8f0a0f5b9e3d5d6
parent7469686ccc959765542cd10551f9bd7a602f2cbd
x86/emul: Correct the handling of eflags with SYSCALL

A singlestep #DB is determined by the resulting eflags value from the
execution of SYSCALL, not the original eflags value.

By using the original eflags value, we negate the guest kernels attempt to
protect itself from a privilege escalation by masking TF.

(re)introduce a singlestep boolean, defaulting to the original eflags state,
but have the SYSCALL emulation recalculate it after masking has occurred.

This is XSA-204

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
xen/arch/x86/x86_emulate/x86_emulate.c