Merge branch 'sysretq-fix' into 'master'

Fix mistyped instructions in sysretq

See merge request redox-os/kernel!169
This commit is contained in:
Jeremy Soller
2021-02-15 19:12:05 +00:00

View File

@@ -108,11 +108,11 @@ function!(syscall_instruction => {
// If ZF was set, i.e. the address was invalid higher-half, so jump to the slower iretq and
// handle the error without being able to execute attacker-controlled code!
jmp 1f
jnz 1f
// Otherwise, continue with the fast sysretq.
sub rsp, 8 // Pop fake userspace CS
add rsp, 8 // Pop fake userspace CS
pop r11 // Pop rflags
pop QWORD PTR gs:[0x70] // Pop userspace stack pointer
mov rsp, gs:[0x70] // Restore userspace stack pointer