Skip to content

Commit 0927085

Browse files
author
Jianfeng Tan
committed
fix wrong SizeOfTCPInfo
Below command under hostinet network will lead to panic: $ cat /proc/net/tcp It's caused by the wrong SizeOfTCPInfo. #0 runtime.panicindex() google#1 encoding/binary.littleEndian.Uint64 google#2 encoding/binary.(*littleEndian).Uint64 google#3 gvisor.dev/gvisor/pkg/binary.unmarshal google#4 gvisor.dev/gvisor/pkg/binary.unmarshal google#5 gvisor.dev/gvisor/pkg/binary.Unmarshal google#6 gvisor.dev/gvisor/pkg/sentry/socket/hostinet.(*socketOperations).State google#7 gvisor.dev/gvisor/pkg/sentry/fs/proc.(*netTCP).ReadSeqFileData Correct SizeOfTCPInfo from 104 to 192 to fix it. Fixes google#640 Signed-off-by: Jianfeng Tan <[email protected]>
1 parent 6a1ac34 commit 0927085

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

pkg/abi/linux/socket.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -352,7 +352,7 @@ type TCPInfo struct {
352352
}
353353

354354
// SizeOfTCPInfo is the binary size of a TCPInfo struct.
355-
const SizeOfTCPInfo = 104
355+
const SizeOfTCPInfo = 192
356356

357357
// Control message types, from linux/socket.h.
358358
const (

0 commit comments

Comments
 (0)