snapshot: sagernet/gvisor v0.0.0-20260727.0-sing-box-mod.1 + SPEC 048 guard

Обновление снапшота с v0.0.0-20250811.0 на пин, которого требует
sing-box после мержа 235 коммитов (upstream d620bbbf2 "Update gvisor to
20260727.0"). Прежний снапшот был взят 2026-08-04 ровно с той версии,
на которой тогда стоял апстрим; разрыв возник 2026-08-05 вместе с его
бампом.

За год апстрим-gvisor изменил ~14 000 строк в 292 файлах. Значимое для
нас — сетевой стек: tcp/connect.go (PMTU-discovery + исправление
начального RTT/RTO: раньше задержка ACK внутри стека завышала стартовый
таймаут на несколько RTT), tcp/snd.go, tcp/rcv.go, stack/conntrack.go,
stack/packet_buffer.go. Всего 30 файлов в TCP и 37 в stack.

Баг SPEC 048 апстрим НЕ исправил — проверено по коду новой версии:
handleConnecting по-прежнему проверяет состояние endpoint'а, но не ep.h,
а performHandshake так же зануляет h и отпускает мьютекс до Close().
Поэтому guard перенесён (12 строк) вместе со своим тестом (45 строк).

Red/green проверен на новой базе: без guard'а тест падает с той же
nil-паникой, что в полевом крашдампе; с ним зелёный.
This commit is contained in:
Leadaxe 2026-08-05 14:53:31 +03:00
parent ffebe42860
commit 117243aa02
293 changed files with 16413 additions and 2842 deletions

View file

@ -16,6 +16,7 @@ package linux
import (
"math"
"structs"
"time"
)
@ -86,7 +87,10 @@ const (
TFD_NONBLOCK = O_NONBLOCK
// TFD_TIMER_ABSTIME is a timerfd_settime flag.
TFD_TIMER_ABSTIME = 1
TFD_TIMER_ABSTIME = 1 << 0
// TFD_TIMER_CANCEL_ON_SET is a timerfd_settime flag.
TFD_TIMER_CANCEL_ON_SET = 1 << 1
)
// The safe number of seconds you can represent by int64.
@ -106,6 +110,7 @@ func NsecToTimeT(nsec int64) TimeT {
//
// +marshal slice:TimespecSlice
type Timespec struct {
_ structs.HostLayout
Sec int64
Nsec int64
}
@ -162,6 +167,7 @@ const SizeOfTimeval = 16
//
// +marshal slice:TimevalSlice
type Timeval struct {
_ structs.HostLayout
Sec int64
Usec int64
}
@ -201,10 +207,16 @@ func DurationToTimeval(dur time.Duration) Timeval {
//
// +marshal
type Itimerspec struct {
_ structs.HostLayout
Interval Timespec
Value Timespec
}
// Valid returns whether the itimerspec contains valid values.
func (its Itimerspec) Valid() bool {
return its.Interval.Valid() && its.Value.Valid()
}
// ItimerVal mimics the following struct in <sys/time.h>
//
// struct itimerval {
@ -214,6 +226,7 @@ type Itimerspec struct {
//
// +marshal
type ItimerVal struct {
_ structs.HostLayout
Interval Timeval
Value Timeval
}
@ -232,6 +245,7 @@ func ClockTFromDuration(d time.Duration) ClockT {
//
// +marshal
type Tms struct {
_ structs.HostLayout
UTime ClockT
STime ClockT
CUTime ClockT
@ -248,6 +262,7 @@ type TimerID int32
//
// +marshal
type StatxTimestamp struct {
_ structs.HostLayout
Sec int64
Nsec uint32
_ int32
@ -283,6 +298,7 @@ func (sxts StatxTimestamp) ToTime() time.Time {
//
// +marshal
type Utime struct {
_ structs.HostLayout
Actime int64
Modtime int64
}