From 2d7e563c39c796a5b720935e955a2ce751cfabcc Mon Sep 17 00:00:00 2001 From: Konstantin Belousov Date: Thu, 5 Apr 2018 11:03:21 +0000 Subject: [PATCH] Fix ERESTART for lcall $7,$0 syscalls. The lcall trampoline enters kernel by int $0x80, which sets up invalid length of the instruction for %rip rewind. Reviewed by: bde Sponsored by: The FreeBSD Foundation MFC after: 1 week --- sys/amd64/ia32/ia32_syscall.c | 1 + 1 file changed, 1 insertion(+) diff --git a/sys/amd64/ia32/ia32_syscall.c b/sys/amd64/ia32/ia32_syscall.c index b8275b3fe7e..f5ee91cbf5d 100644 --- a/sys/amd64/ia32/ia32_syscall.c +++ b/sys/amd64/ia32/ia32_syscall.c @@ -146,6 +146,7 @@ ia32_fetch_syscall_args(struct thread *td) frame->tf_rip = eip; frame->tf_cs = cs; frame->tf_rsp += 2 * sizeof(u_int32_t); + frame->tf_err = 7; /* size of lcall $7,$0 */ } #endif