From: Cherry Mui Date: Sun, 22 Jun 2025 19:01:27 +0000 (-0400) Subject: [release-branch.go1.24] runtime: add missing unlock in sysReserveAlignedSbrk X-Git-Tag: go1.24.5~7 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=1575127ef82d9a49c620734112fa2c72b74c6a55;p=gostls13.git [release-branch.go1.24] runtime: add missing unlock in sysReserveAlignedSbrk sysReserveAlignedSbrk locks memlock at entry, but it is not unlocked at one of the return path. Add the missing unlock. Updates #74339. Fixes #74346. Change-Id: Ib641bc348aca41494ec410e2c4eb9857f3362484 Reviewed-on: https://go-review.googlesource.com/c/go/+/683295 LUCI-TryBot-Result: Go LUCI Reviewed-by: David Chase Reviewed-by: Michael Knyszek (cherry picked from commit 456a90aa1618a6c3aa49ecba46969128e2bfa26f) Reviewed-on: https://go-review.googlesource.com/c/go/+/684016 Auto-Submit: Dmitri Shuralyov --- diff --git a/src/runtime/mem_sbrk.go b/src/runtime/mem_sbrk.go index cfca891086..270255a19a 100644 --- a/src/runtime/mem_sbrk.go +++ b/src/runtime/mem_sbrk.go @@ -231,6 +231,7 @@ func sysReserveAlignedSbrk(size, align uintptr) (unsafe.Pointer, uintptr) { memFree(unsafe.Pointer(end), endLen) } memCheck() + unlock(&memlock) return unsafe.Pointer(pAligned), size }