fix: add security comment for TCP_INFO syscall in platformGetRTT function
Some checks failed
Go Build Multi-Platform / build (amd64, darwin) (push) Failing after 23s
Go Build Multi-Platform / build (amd64, freebsd) (push) Failing after 24s
Go Build Multi-Platform / build (amd64, windows) (push) Failing after 39s
Go Build Multi-Platform / build (amd64, linux) (push) Failing after 41s
Go Build Multi-Platform / build (arm64, freebsd) (push) Has been cancelled
Go Build Multi-Platform / build (arm64, linux) (push) Has been cancelled
Go Build Multi-Platform / build (arm64, windows) (push) Has been cancelled
Go Build Multi-Platform / Create Release (push) Has been cancelled
Go Build Multi-Platform / build (arm, linux) (push) Has been cancelled
Go Build Multi-Platform / build (arm, windows) (push) Has been cancelled
Go Revive Lint / lint (push) Has been cancelled
Go Build Multi-Platform / build (arm, freebsd) (push) Has been cancelled
Go Test Multi-Platform / Test (macos-latest, amd64) (push) Has been cancelled
Go Test Multi-Platform / Test (ubuntu-latest, amd64) (push) Has been cancelled
Go Test Multi-Platform / Test (windows-latest, amd64) (push) Has been cancelled
Go Test Multi-Platform / Test (macos-latest, arm64) (push) Has been cancelled
Go Test Multi-Platform / Test (ubuntu-latest, arm64) (push) Has been cancelled
Go Build Multi-Platform / build (arm64, darwin) (push) Has been cancelled
Run Gosec / tests (push) Has been cancelled

This commit is contained in:
2025-11-20 18:21:14 -06:00
parent 24aa4fa88b
commit b0fad14504

View File

@@ -81,13 +81,14 @@ func platformGetRTT(fd uintptr) time.Duration {
infoLen := uint32(unsafe.Sizeof(info))
// TCP_INFO is 11 on Linux
// #nosec G103
_, _, errno := syscall.Syscall6(
syscall.SYS_GETSOCKOPT,
fd,
syscall.IPPROTO_TCP,
11, // TCP_INFO
uintptr(unsafe.Pointer(&info)), //nolint:gosec
uintptr(unsafe.Pointer(&infoLen)), //nolint:gosec
uintptr(unsafe.Pointer(&info)),
uintptr(unsafe.Pointer(&infoLen)),
0,
)