You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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 <[email protected]>
Reviewed-by: Keith Randall <[email protected]>
Reviewed-by: Dmitri Shuralyov <[email protected]>
Auto-Submit: Dmitri Shuralyov <[email protected]>
Reviewed-by: Keith Randall <[email protected]>
0 commit comments