mirror of
https://github.com/opnsense/src.git
synced 2026-06-10 17:22:46 -04:00
linux(4): Preserve %rcx (return address) like a Linux do
Perhaps, this does not makes much sense as destroyng %rcx declared by the x86_64 Linux syscall ABI. However,: a) if we get a signal while we are in the kernel, we should restore tf_rcx when preparing machine context for signal handlers. b) the Linux world is strange, someone can depend on %rcx value after syscall, something like go. Differential Revision: https://reviews.freebsd.org/D40155 MFC after: 1 month
This commit is contained in:
parent
185bd9fa30
commit
037b60fb0f
1 changed files with 2 additions and 0 deletions
|
|
@ -169,6 +169,8 @@ linux_fetch_syscall_args(struct thread *td)
|
|||
|
||||
/* Restore r10 earlier to avoid doing this multiply times. */
|
||||
frame->tf_r10 = frame->tf_rcx;
|
||||
/* Restore %rcx for machine context. */
|
||||
frame->tf_rcx = frame->tf_rip;
|
||||
|
||||
td->td_retval[0] = 0;
|
||||
return (0);
|
||||
|
|
|
|||
Loading…
Reference in a new issue