]> Cypherpunks repositories - gostls13.git/commit
syscall: fix dangling pointers in Windows' process attributes
authorqmuntal <quimmuntal@gmail.com>
Tue, 8 Apr 2025 09:19:57 +0000 (11:19 +0200)
committerQuim Muntal <quimmuntal@gmail.com>
Tue, 8 Apr 2025 14:56:17 +0000 (07:56 -0700)
commit3a4f077710b96ee72fcd4214280a41a7c355205b
tree23c416f7bd9e686085aa72daf08dffa929da7324
parent58b6891108fa75f5856750e13dff3fa980987f07
syscall: fix dangling pointers in Windows' process attributes

Windows' _PROC_THREAD_ATTRIBUTE_LIST can contain pointers to memory
owned by Go, but the GC is not aware of this. This can lead to the
memory being freed while the _PROC_THREAD_ATTRIBUTE_LIST is still in
use.

This CL uses the same approach as in x/sys/windows to ensure that the
attributes are not collected by the GC.

Fixes #73170.
Updates #73199.

Cq-Include-Trybots: luci.golang.try:gotip-windows-amd64-longtest
Change-Id: I7dca8d386aed4c02fdcd4a631d0fa4dc5747a96f
Reviewed-on: https://go-review.googlesource.com/c/go/+/663715
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
Reviewed-by: Keith Randall <khr@golang.org>
Reviewed-by: Keith Randall <khr@google.com>
src/syscall/exec_windows.go
src/syscall/syscall_windows.go
src/syscall/types_windows.go
src/syscall/zsyscall_windows.go