mirror of
https://github.com/netbirdio/gvisor.git
synced 2026-05-22 17:12:49 -07:00
Fix improper use of RawSyscall in KVM
futex wait needs to be called surrounded by syscall.Entersyscall() and syscall.Exitsyscall(), which RawSyscall does not do. It was a mistake to substitute it. PiperOrigin-RevId: 681629844
This commit is contained in:
committed by
gVisor bot
parent
ca8d05a657
commit
d3ce23c224
@@ -138,11 +138,12 @@ func (c *vCPU) notify() {
|
||||
//
|
||||
// This panics on error.
|
||||
func (c *vCPU) waitUntilNot(state uint32) {
|
||||
errno := hostsyscall.RawSyscallErrno(
|
||||
_, _, errno := unix.Syscall6(
|
||||
unix.SYS_FUTEX,
|
||||
uintptr(unsafe.Pointer(&c.state)),
|
||||
linux.FUTEX_WAIT|linux.FUTEX_PRIVATE_FLAG,
|
||||
uintptr(state))
|
||||
uintptr(state),
|
||||
0, 0, 0)
|
||||
if errno != 0 && errno != unix.EINTR && errno != unix.EAGAIN {
|
||||
panic("futex wait error")
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user