diff options
author | kib <kib@FreeBSD.org> | 2013-09-24 12:24:48 +0000 |
---|---|---|
committer | kib <kib@FreeBSD.org> | 2013-09-24 12:24:48 +0000 |
commit | 2346155b1e1ec03137ae64ce08cfe2d7803df47e (patch) | |
tree | 24aa569225f98dc8bf421ebe85bd1fa0289b80b6 /sys/amd64 | |
parent | 1f2c9d2f151b16756e44d66eae8539c76972567d (diff) | |
download | FreeBSD-src-2346155b1e1ec03137ae64ce08cfe2d7803df47e.zip FreeBSD-src-2346155b1e1ec03137ae64ce08cfe2d7803df47e.tar.gz |
Ensure that the ERESTART return from the syscall reloads the
registers, to make the restarted syscall instruction pass the correct
arguments.
PR: kern/182161
Reported by: Russ Cox <rsc@swtch.com>
Sponsored by: The FreeBSD Foundation
MFC after: 3 days
Approved by: re (marius)
Diffstat (limited to 'sys/amd64')
-rw-r--r-- | sys/amd64/amd64/vm_machdep.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/sys/amd64/amd64/vm_machdep.c b/sys/amd64/amd64/vm_machdep.c index b7c2b67..1e3d8f5 100644 --- a/sys/amd64/amd64/vm_machdep.c +++ b/sys/amd64/amd64/vm_machdep.c @@ -400,9 +400,13 @@ cpu_set_syscall_retval(struct thread *td, int error) * for the next iteration. * %r10 restore is only required for freebsd/amd64 processes, * but shall be innocent for any ia32 ABI. + * + * Require full context restore to get the arguments + * in the registers reloaded at return to usermode. */ td->td_frame->tf_rip -= td->td_frame->tf_err; td->td_frame->tf_r10 = td->td_frame->tf_rcx; + set_pcb_flags(td->td_pcb, PCB_FULL_IRET); break; case EJUSTRETURN: |