]> Cypherpunks repositories - gostls13.git/commit
internal/syscall/windows: define NtQueryInformationFile buffer as unsafe.Pointer
authorqmuntal <quimmuntal@gmail.com>
Thu, 3 Apr 2025 12:55:21 +0000 (14:55 +0200)
committerGopher Robot <gobot@golang.org>
Thu, 3 Apr 2025 19:20:27 +0000 (12:20 -0700)
commitce94e916fe262a51c398153b03dd9a657418bbe8
tree2ac4d2330e7af513b1267922a47d5ef7bcd43546
parent9302a57134a698b62576cd3b849017a02c731c98
internal/syscall/windows: define NtQueryInformationFile buffer as unsafe.Pointer

The unsafe.Pointer -> uintptr conversion must happen when calling
syscall.Syscall, not when calling the auto-generated wrapper function,
else the Go compiler doesn't know that it has to keep the pointer alive.

This can cause undefined behavior and stack corruption.

Fixes #73135.
Fixes #73112 (potentially).
Fixes #73128 (potentially).

Cq-Include-Trybots: luci.golang.try:gotip-windows-amd64-race
Change-Id: Ib3ad8b99618d8997bfd0742c0e44aeda696856c4
Reviewed-on: https://go-review.googlesource.com/c/go/+/662575
Reviewed-by: Alan Donovan <adonovan@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Carlos Amedee <carlos@golang.org>
Auto-Submit: Carlos Amedee <carlos@golang.org>
src/internal/poll/fd_windows.go
src/internal/syscall/windows/syscall_windows.go
src/internal/syscall/windows/zsyscall_windows.go