From 08e54827f6706016347e1e4f4866b84126842b20 Mon Sep 17 00:00:00 2001 From: Florian Zenker Date: Tue, 25 Nov 2025 15:13:51 +0000 Subject: [PATCH] unix: fix out of bounds memory access in tests sockaddrIUCVToAny used the wrong size to for copying to RawSockaddrAny. We found this by running the test with ASAN. Change-Id: I2a2ec28f9bd55aeba4ddcb4243ad61ec010087df Reviewed-on: https://go-review.googlesource.com/c/sys/+/724280 Reviewed-by: Michael Stapelberg LUCI-TryBot-Result: Go LUCI --- unix/syscall_internal_linux_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/unix/syscall_internal_linux_test.go b/unix/syscall_internal_linux_test.go index e8b74917..8798d1bf 100644 --- a/unix/syscall_internal_linux_test.go +++ b/unix/syscall_internal_linux_test.go @@ -909,7 +909,7 @@ func sockaddrIUCVToAny(in RawSockaddrIUCV) *RawSockaddrAny { var out RawSockaddrAny copy( (*(*[SizeofSockaddrAny]byte)(unsafe.Pointer(&out)))[:], - (*(*[SizeofSockaddrUnix]byte)(unsafe.Pointer(&in)))[:], + (*(*[SizeofSockaddrIUCV]byte)(unsafe.Pointer(&in)))[:], ) return &out }