]> git.ipfire.org Git - thirdparty/qemu.git/commit
target/i386/tcg: Use DPL-level accesses for interrupts and call gates
authorPaolo Bonzini <pbonzini@redhat.com>
Tue, 18 Jun 2024 06:53:19 +0000 (08:53 +0200)
committerPaolo Bonzini <pbonzini@redhat.com>
Thu, 17 Oct 2024 17:41:30 +0000 (19:41 +0200)
commite136648c5c95ee4ea233cccf999c07e065bef26d
tree08a7b91fc113892d1d8662ca0c06212c96fdddce
parent943c742868c739c0b14fd996bad3adf744156fec
target/i386/tcg: Use DPL-level accesses for interrupts and call gates

Stack accesses should be explicit and use the privilege level of the
target stack.  This ensures that SMAP is not applied when the target
stack is in ring 3.

This fixes a bug wherein i386/tcg assumed that an interrupt return, or a
far call using the CALL or JMP instruction, was always going from kernel
or user mode to kernel mode when using a call gate. This assumption is
violated if the call gate has a DPL that is greater than 0.

Analyzed-by: Robert R. Henry <rrh.henry@gmail.com>
Resolves: https://gitlab.com/qemu-project/qemu/-/issues/249
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
target/i386/tcg/seg_helper.c