Files
sys/windows
thepudds 6a85559a3f windows: fix dangling pointers in (*SECURITY_DESCRIPTOR).ToAbsolute
Prior to this CL, a byte slice was allocated via make to use as the
absoluteSD argument passed to the Windows API MakeAbsoluteSD.

MakeAbsoluteSD then sets pointers outside the view of the GC, including
pointers within absoluteSD that point to other chunks of memory
we pass into MakeAbsoluteSD.

CL 653856 recently allowed more make results to be stack allocated,
which worsened the problems here and made it easier for those
pointers in absoluteSD to become dangling pointers, though the
core problems here existed before.

This CL instead allocates absoluteSD as a proper SECURITY_DESCRIPTOR
struct so that the GC can be aware of its pointers. We also verify the
pointers are as we expect, and then set them explicitly
in view of the GC.

Updates golang/go#73199

Change-Id: Id8038d38a887bb8ff3ffc6eae603589b97e92cdc
Reviewed-on: https://go-review.googlesource.com/c/sys/+/663355
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Keith Randall <khr@google.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
Auto-Submit: Dmitri Shuralyov <dmitshur@golang.org>
Reviewed-by: Keith Randall <khr@golang.org>
2025-04-09 11:19:55 -07:00
..
2023-10-11 21:54:30 +00:00
2023-10-11 21:54:30 +00:00
2023-10-11 21:54:30 +00:00
2023-10-11 21:54:30 +00:00
2023-10-11 21:54:30 +00:00
2023-10-11 21:54:30 +00:00
2023-10-11 21:54:30 +00:00
2021-02-18 14:52:45 +00:00