mirror of
https://github.com/slackhq/nebula.git
synced 2026-05-16 04:47:38 +02:00
The Poll fallback (used when IFF_VNET_HDR can't be enabled) has the same unsafe-pointer-via-uintptr pattern as Offload.rawWrite: readOne/writeOne build a [2]syscall.Iovec on the stack, pass it to syscall.Syscall as uintptr, and the kernel then DMAs in/out of the to/from slices whose Base pointers the iovec holds. Escape analysis can't see that use, so under GC pressure the backing memory could be collected or moved mid-syscall. Add runtime.KeepAlive on the iovec and the user buffer around both the SYS_READV and SYS_WRITEV syscalls. Same pattern and rationale as the prior commit on the offload path.