diff --git a/pkg/tcpip/stack/conntrack.go b/pkg/tcpip/stack/conntrack.go index ef5474007b..31ecb50f1f 100644 --- a/pkg/tcpip/stack/conntrack.go +++ b/pkg/tcpip/stack/conntrack.go @@ -224,6 +224,15 @@ type ConnTrack struct { // seed is a one-time random value initialized at stack startup // and is used in the calculation of hash keys for the list of buckets. // It is immutable. + // + // TODO(gvisor.dev/issue/4595): When Stack.tables becomes savable and + // ConnTrack flows into checkpoint state, this seed must be redrawn + // from secureRNG during restore AND the entries in buckets must be + // rehashed under the new seed. bucket_index = jenkins.Sum32(seed) % + // len(buckets) couples the seed value to bucket layout; redrawing the + // seed without rehashing leaves restored entries unreachable by + // Lookup. Persisting the pre-checkpoint seed extends the brute-force + // window across save boundaries. seed uint32 // clock provides timing used to determine conntrack reapings.