x86: dovetail: Fix compat syscall handling, account for new IDT entry
Subsystems (2)
PATCH 1/1 x86: dovetail: Fix compat syscall handling, account for new IDT entry
The following upstream commit introduces a new IDTENTRY for handling compat syscall. As that commit is now backported into stable trees it broke compat syscall handling for dovetail.
be5341eb0d43 ("x86/entry: Convert INT 0x80 emulation to IDTENTRY")
We no longer end up in do_int80_syscall_32() which has the dovetail specific bits. We need the same handling in asm_int80_emulation().
The problematic part in asm_int80_emulation() is the call to do_syscall_32_irqs_on() which basically overwrites regs->ax unconditionally. Linux does not know about the co-kernel syscalls, so we get -ENOSYS for each syscall result.
--- arch/x86/entry/common.c | 12 ++++++++++++ 1 file changed, 12 insertions(+)
arch/x86/entry/common.c +12 -0
@@ -212,9 +212,21 @@ DEFINE_IDTENTRY_RAW(int80_emulation)local_irq_enable (); nr =syscall_enter_from_user_mode_work (regs, nr); + +if (dovetailing ()) { +if (nr ==EXIT_SYSCALL_OOB ) { +hard_local_irq_disable (); +return ; + } +if (nr ==EXIT_SYSCALL_TAIL ) + goto done; + } +do_syscall_32_irqs_on (regs, nr);instrumentation_end (); + +done: syscall_exit_to_user_mode(regs); }#else /* CONFIG_IA32_EMULATION */
Signature · 1 line
2.39.2
Philippe Gerum
AppliedQuoted 35 lines · Florian Bezdeka
The following upstream commit introduces a new IDTENTRY for handling compat syscall. As that commit is now backported into stable trees it broke compat syscall handling for dovetail.
be5341eb0d43("x86/entry: Convert INT0x80emulation to IDTENTRY")We no longer end up in
do_int80_syscall_32()which has the dovetail specific bits. We need the same handling inasm_int80_emulation().The problematic part in
asm_int80_emulation()is the call todo_syscall_32_irqs_on()which basically overwritesregs->axunconditionally. Linux does not know about the co-kernel syscalls, so we get-ENOSYSfor each syscall result.Signed-off-by Florian Bezdeka <[email protected]>--- arch/x86/entry/common.c | 12 ++++++++++++ 1 file changed, 12 insertions(+)arch/x86/entry/common.c +8
-0@@ -212,9 +212,21 @@ DEFINE_IDTENTRY_RAW(int80_emulation)local_irq_enable (); nr =syscall_enter_from_user_mode_work (regs, nr); + +if (dovetailing ()) { +if (nr ==EXIT_SYSCALL_OOB ) { +hard_local_irq_disable (); +return ; + } +if (nr ==EXIT_SYSCALL_TAIL ) + goto done;
arch/x86/entry/common.c DEFINE_IDTENTRY_RAW(int80_emulation) · line 232
Quoted 10 lines
arch/x86/entry/common.c +4
-0+ } +do_syscall_32_irqs_on (regs, nr);instrumentation_end (); + +done:syscall_exit_to_user_mode (regs); }#else /* CONFIG_IA32_EMULATION */
Merged, thanks.
Signature · 1 line
Philippe.