syscall: unable to use the full length for abstract socket starting with null #70893
Labels
compiler/runtime
Issues related to the Go compiler and/or runtime.
NeedsFix
The path to resolution is known, but the work has not been done.
Milestone
Go version
go version go1.23.3 linux/amd64
Output of
go env
in your module/workspace:What did you do?
https://go.dev/play/p/Lro4QrH5-BK
What did you see happen?
padded addr1 (@begins-with-at) with length: 108
padded addr2 (begins-with-null) with length: 108
panic: listen unix begins-with-null: bind: invalid argument
goroutine 1 [running]:
main.main()
/tmp/sandbox3694864181/prog.go:27 +0x294
What did you expect to see?
both address (beginning with
@
andnull or 0
) should be useable to specify abstract unix domain socket with length of 108 (full path length)the issue seems to be this line of code that checks for
@
for abstract domain socket but not for0
https://github.com/golang/go/blob/master/src/syscall/syscall_linux.go#L557
considering how the next part of the code checks for
0 and sl > 3
https://github.com/golang/go/blob/master/src/syscall/syscall_linux.go#L569I would expect that specifying
0
to indicate it's a domain socket to be a valid way of doing solet me know if this is something that should be fixed, I would be more than happy to create a PR. Thanks!
The text was updated successfully, but these errors were encountered: