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:
parent
ffebe42860
commit
117243aa02
293 changed files with 16413 additions and 2842 deletions
|
|
@ -14,6 +14,11 @@
|
|||
|
||||
package linux
|
||||
|
||||
import (
|
||||
"encoding/binary"
|
||||
"structs"
|
||||
)
|
||||
|
||||
// Constants for extended attributes.
|
||||
const (
|
||||
XATTR_NAME_MAX = 255
|
||||
|
|
@ -37,3 +42,112 @@ const (
|
|||
XATTR_USER_PREFIX = "user."
|
||||
XATTR_USER_PREFIX_LEN = len(XATTR_USER_PREFIX)
|
||||
)
|
||||
|
||||
// Constants for POSIX ACL extended attributes.
|
||||
const (
|
||||
// Extended attribute names for POSIX ACLs.
|
||||
XATTR_NAME_POSIX_ACL_ACCESS = XATTR_SYSTEM_PREFIX + "posix_acl_access"
|
||||
XATTR_NAME_POSIX_ACL_DEFAULT = XATTR_SYSTEM_PREFIX + "posix_acl_default"
|
||||
|
||||
POSIX_ACL_XATTR_VERSION = 2
|
||||
|
||||
// ACL_UNDEFINED_ID is the ID for entries that do not contain a
|
||||
// named user or group.
|
||||
ACL_UNDEFINED_ID = 0xffffffff
|
||||
|
||||
// ACL entry tags.
|
||||
ACL_USER_OBJ = 0x01
|
||||
ACL_USER = 0x02
|
||||
ACL_GROUP_OBJ = 0x04
|
||||
ACL_GROUP = 0x08
|
||||
ACL_MASK = 0x10
|
||||
ACL_OTHER = 0x20
|
||||
|
||||
// ACL entry permission bits.
|
||||
ACL_READ = 0x04
|
||||
ACL_WRITE = 0x02
|
||||
ACL_EXECUTE = 0x01
|
||||
)
|
||||
|
||||
// PosixACLXattrEntry is a single entry in the userspace representation
|
||||
// of a POSIX ACL. It corresponds to Linux's struct posix_acl_xattr_entry.
|
||||
//
|
||||
// All fields in PosixACLXattrEntry are stored as little-endian.
|
||||
//
|
||||
// +marshal dynamic
|
||||
type PosixACLXattrEntry struct {
|
||||
_ structs.HostLayout
|
||||
Tag uint16
|
||||
Perm uint16
|
||||
ID uint32
|
||||
}
|
||||
|
||||
// SizeBytes implements marshal.Marshallable.SizeBytes.
|
||||
func (a *PosixACLXattrEntry) SizeBytes() int {
|
||||
return 8
|
||||
}
|
||||
|
||||
// MarshalBytes implements marshal.Marshallable.MarshalBytes.
|
||||
func (a *PosixACLXattrEntry) MarshalBytes(dst []byte) []byte {
|
||||
binary.LittleEndian.PutUint16(dst[0:], a.Tag)
|
||||
binary.LittleEndian.PutUint16(dst[2:], a.Perm)
|
||||
binary.LittleEndian.PutUint32(dst[4:], a.ID)
|
||||
|
||||
return dst[8:]
|
||||
}
|
||||
|
||||
// UnmarshalBytes implements marshal.Marshallable.UnmarshalBytes.
|
||||
func (a *PosixACLXattrEntry) UnmarshalBytes(src []byte) []byte {
|
||||
a.Tag = binary.LittleEndian.Uint16(src[0:])
|
||||
a.Perm = binary.LittleEndian.Uint16(src[2:])
|
||||
a.ID = binary.LittleEndian.Uint32(src[4:])
|
||||
|
||||
return src[8:]
|
||||
}
|
||||
|
||||
// PosixACLXattr is the userspace representation of a POSIX ACL.
|
||||
//
|
||||
// +marshal dynamic
|
||||
type PosixACLXattr struct {
|
||||
_ structs.HostLayout
|
||||
|
||||
// Version is the POSIX ACL version, stored as little-endian.
|
||||
Version uint32
|
||||
|
||||
// Entries contains the ACL entries.
|
||||
Entries []PosixACLXattrEntry `hostlayout:"ignore"`
|
||||
}
|
||||
|
||||
// posixACLXattrHeaderSize is the size in bytes of the header.
|
||||
const posixACLXattrHeaderSize = 4
|
||||
|
||||
// SizeBytes implements marshal.Marshallable.SizeBytes.
|
||||
func (a *PosixACLXattr) SizeBytes() int {
|
||||
return posixACLXattrHeaderSize + len(a.Entries)*(*PosixACLXattrEntry)(nil).SizeBytes()
|
||||
}
|
||||
|
||||
// MarshalBytes implements marshal.Marshallable.MarshalBytes.
|
||||
func (a *PosixACLXattr) MarshalBytes(dst []byte) []byte {
|
||||
binary.LittleEndian.PutUint32(dst, a.Version)
|
||||
|
||||
dst = dst[posixACLXattrHeaderSize:]
|
||||
for _, entry := range a.Entries {
|
||||
dst = entry.MarshalBytes(dst)
|
||||
}
|
||||
|
||||
return dst
|
||||
}
|
||||
|
||||
// UnmarshalBytes implements marshal.Marshallable.UnmarshalBytes.
|
||||
func (a *PosixACLXattr) UnmarshalBytes(src []byte) []byte {
|
||||
a.Version = binary.LittleEndian.Uint32(src)
|
||||
|
||||
src = src[posixACLXattrHeaderSize:]
|
||||
for len(src) >= (*PosixACLXattrEntry)(nil).SizeBytes() {
|
||||
var entry PosixACLXattrEntry
|
||||
src = entry.UnmarshalBytes(src)
|
||||
a.Entries = append(a.Entries, entry)
|
||||
}
|
||||
|
||||
return src
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue