From 71e6837e861e9db0624eb694ae629f9cc329baec Mon Sep 17 00:00:00 2001 From: Roman Perekhod <2403905@gmail.com> Date: Thu, 29 Oct 2026 13:51:15 +0100 Subject: [PATCH] chore: bump deps --- go.mod | 4 +- go.sum | 8 ++-- vendor/go.etcd.io/etcd/client/pkg/v3/LICENSE | 2 +- .../etcd/client/pkg/v3/fileutil/purge.go | 5 +++ .../etcd/client/pkg/v3/logutil/zap_journal.go | 4 ++ .../etcd/client/pkg/v3/transport/listener.go | 2 +- .../client/pkg/v3/transport/listener_opts.go | 2 +- .../client/pkg/v3/transport/listener_tls.go | 31 +++++++++++++ .../pkg/v3/transport/timeout_transport.go | 2 +- .../etcd/client/pkg/v3/types/set.go | 43 +++++++++++++++---- .../etcd/client/pkg/v3/types/urls.go | 1 - .../etcd/client/pkg/v3/verify/verify.go | 13 +++++- vendor/golang.org/x/net/html/parse.go | 23 +++++++++- vendor/golang.org/x/net/html/render.go | 23 +++++----- .../x/net/internal/socket/socket.go | 10 +++-- vendor/golang.org/x/net/ipv4/batch.go | 12 ++++++ vendor/golang.org/x/net/ipv4/control.go | 8 ++-- vendor/golang.org/x/net/ipv4/control_unix.go | 13 +++++- vendor/golang.org/x/net/ipv4/header.go | 3 ++ vendor/golang.org/x/net/ipv4/packet.go | 6 +++ vendor/golang.org/x/net/ipv4/payload_cmsg.go | 10 +++-- vendor/golang.org/x/net/ipv4/sys_bpf.go | 5 +++ vendor/golang.org/x/net/ipv4/sys_linux.go | 2 +- vendor/golang.org/x/net/ipv4/sys_solaris.go | 2 +- vendor/golang.org/x/net/ipv6/batch.go | 6 +++ vendor/golang.org/x/net/ipv6/control.go | 8 ++-- vendor/golang.org/x/net/ipv6/icmp_bsd.go | 9 ++++ vendor/golang.org/x/net/ipv6/icmp_linux.go | 9 ++++ vendor/golang.org/x/net/ipv6/icmp_solaris.go | 9 ++++ vendor/golang.org/x/net/ipv6/icmp_zos.go | 9 ++++ vendor/golang.org/x/net/ipv6/sys_bpf.go | 5 +++ vendor/modules.txt | 6 +-- 32 files changed, 238 insertions(+), 57 deletions(-) diff --git a/go.mod b/go.mod index a2d66c0f2af..2c8f7dd95e7 100644 --- a/go.mod +++ b/go.mod @@ -100,7 +100,7 @@ require ( golang.org/x/crypto v0.58.0 golang.org/x/exp v0.0.0-20260410095643-746e56fc9e2f golang.org/x/image v0.45.0 - golang.org/x/net v0.61.0 + golang.org/x/net v0.62.0 golang.org/x/oauth2 v0.36.0 golang.org/x/sync v0.24.0 golang.org/x/term v0.47.0 @@ -329,7 +329,7 @@ require ( github.com/yashtewari/glob-intersection v0.2.0 // indirect github.com/zeebo/xxh3 v1.1.0 // indirect go.etcd.io/etcd/api/v3 v3.6.11 // indirect - go.etcd.io/etcd/client/pkg/v3 v3.6.11 // indirect + go.etcd.io/etcd/client/pkg/v3 v3.7.3 // indirect go.etcd.io/etcd/client/v3 v3.6.11 // indirect go.opencensus.io v0.24.0 // indirect go.opentelemetry.io/auto/sdk v1.2.1 // indirect diff --git a/go.sum b/go.sum index a7bc45ea3f8..5f25911cc2c 100644 --- a/go.sum +++ b/go.sum @@ -950,8 +950,8 @@ go.etcd.io/bbolt v1.4.3 h1:dEadXpI6G79deX5prL3QRNP6JB8UxVkqo4UPnHaNXJo= go.etcd.io/bbolt v1.4.3/go.mod h1:tKQlpPaYCVFctUIgFKFnAlvbmB3tpy1vkTnDWohtc0E= go.etcd.io/etcd/api/v3 v3.6.11 h1:XFGTgrJ8nak3kB4NgMG8t7NT+lEeuuvKQAqUHKVgkWQ= go.etcd.io/etcd/api/v3 v3.6.11/go.mod h1:HYfTh0jyh+uFgp6gMbxJteIDYY97yMuYz85Rnw6Gy9o= -go.etcd.io/etcd/client/pkg/v3 v3.6.11 h1:e41mp315Yn3QMGPmEzCyLsMINgJXTY/dX8kM++1csxU= -go.etcd.io/etcd/client/pkg/v3 v3.6.11/go.mod h1:DysuMe/inqRyC/1tjRR6hReH/VV9Lufs27YKSKBWWJg= +go.etcd.io/etcd/client/pkg/v3 v3.7.3 h1:5zMwNu3ycrzCeA5NwOfQbxFRhqq974chq1DrYMua4QI= +go.etcd.io/etcd/client/pkg/v3 v3.7.3/go.mod h1:/OhzqYrF0U7d1NOk55VMyUQGbYD1WoIe4bJwxb47wOk= go.etcd.io/etcd/client/v3 v3.6.11 h1:LAByD96VmmeuairkvdAcE0RZnrmGz/q3ceeWePo9bwc= go.etcd.io/etcd/client/v3 v3.6.11/go.mod h1:vOTDMCo+fGPEClJqcFEFSqZ+8e7WKV7AyqJjX//HR2w= go.opencensus.io v0.21.0/go.mod h1:mSImk1erAIZhrmZN+AvHh14ztQfjbGwt4TtuofqLduU= @@ -1098,8 +1098,8 @@ golang.org/x/net v0.6.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= golang.org/x/net v0.10.0/go.mod h1:0qNGK6F8kojg2nk9dLZ2mShWaEBan6FAoqfSigmmuDg= golang.org/x/net v0.21.0/go.mod h1:bIjVDfnllIU7BJ2DNgfnXvpSvtn8VRwhlsaeUTyUS44= golang.org/x/net v0.23.0/go.mod h1:JKghWKKOSdJwpW2GEx0Ja7fmaKnMsbu+MWVZTokSYmg= -golang.org/x/net v0.61.0 h1:RR+6j/BTBCrggOLugxa+66R8FvoN6MHlzDlZIbN9YFw= -golang.org/x/net v0.61.0/go.mod h1:WgDCOTH8iwtB66T4/GfI94AHo/hhdb7Hah9NDseQfiI= +golang.org/x/net v0.62.0 h1:18ELalfM5+XNRwzM2nYqXsZQ9ByS1uhj2O/U7+5jqRY= +golang.org/x/net v0.62.0/go.mod h1:WgDCOTH8iwtB66T4/GfI94AHo/hhdb7Hah9NDseQfiI= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= diff --git a/vendor/go.etcd.io/etcd/client/pkg/v3/LICENSE b/vendor/go.etcd.io/etcd/client/pkg/v3/LICENSE index d6456956733..52fb9c29f2e 100644 --- a/vendor/go.etcd.io/etcd/client/pkg/v3/LICENSE +++ b/vendor/go.etcd.io/etcd/client/pkg/v3/LICENSE @@ -187,7 +187,7 @@ same "printed page" as the copyright notice for easier identification within third-party archives. - Copyright [yyyy] [name of copyright owner] + Copyright 2020 The etcd Authors Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/vendor/go.etcd.io/etcd/client/pkg/v3/fileutil/purge.go b/vendor/go.etcd.io/etcd/client/pkg/v3/fileutil/purge.go index 026ea03230f..e40bfd534f8 100644 --- a/vendor/go.etcd.io/etcd/client/pkg/v3/fileutil/purge.go +++ b/vendor/go.etcd.io/etcd/client/pkg/v3/fileutil/purge.go @@ -74,6 +74,11 @@ func purgeFile(lg *zap.Logger, dirname string, suffix string, max uint, interval } } if err = os.Remove(f); err != nil { + if flock { + if closeErr := l.Close(); closeErr != nil { + lg.Error("failed to unlock/close", zap.String("path", l.Name()), zap.Error(closeErr)) + } + } lg.Error("failed to remove file", zap.String("path", f), zap.Error(err)) errC <- err return diff --git a/vendor/go.etcd.io/etcd/client/pkg/v3/logutil/zap_journal.go b/vendor/go.etcd.io/etcd/client/pkg/v3/logutil/zap_journal.go index 06dc40dacd9..f269e2a234a 100644 --- a/vendor/go.etcd.io/etcd/client/pkg/v3/logutil/zap_journal.go +++ b/vendor/go.etcd.io/etcd/client/pkg/v3/logutil/zap_journal.go @@ -35,6 +35,10 @@ import ( // back to writing to the original writer. // The decode overhead is only <30µs per write. // Reference: https://github.com/coreos/pkg/blob/master/capnslog/journald_formatter.go +// +// Deprecated: NewJournalWriter will be removed in v3.8, so that client/pkg/v3 +// no longer depends on github.com/coreos/go-systemd/v22. Copy this file if you +// need the writer, or use github.com/coreos/go-systemd/v22/journal directly. func NewJournalWriter(wr io.Writer) (io.Writer, error) { return &journalWriter{Writer: wr}, systemd.DialJournal() } diff --git a/vendor/go.etcd.io/etcd/client/pkg/v3/transport/listener.go b/vendor/go.etcd.io/etcd/client/pkg/v3/transport/listener.go index 9c2d29ba998..659bb7adb17 100644 --- a/vendor/go.etcd.io/etcd/client/pkg/v3/transport/listener.go +++ b/vendor/go.etcd.io/etcd/client/pkg/v3/transport/listener.go @@ -39,7 +39,7 @@ import ( "go.etcd.io/etcd/client/pkg/v3/verify" ) -// NewListener creates a new listner. +// NewListener creates a new listener. func NewListener(addr, scheme string, tlsinfo *TLSInfo) (l net.Listener, err error) { return newListener(addr, scheme, WithTLSInfo(tlsinfo)) } diff --git a/vendor/go.etcd.io/etcd/client/pkg/v3/transport/listener_opts.go b/vendor/go.etcd.io/etcd/client/pkg/v3/transport/listener_opts.go index 7536f6aff46..cec7484e72d 100644 --- a/vendor/go.etcd.io/etcd/client/pkg/v3/transport/listener_opts.go +++ b/vendor/go.etcd.io/etcd/client/pkg/v3/transport/listener_opts.go @@ -53,7 +53,7 @@ func (lo *ListenerOptions) IsSocketOpts() bool { return lo.socketOpts.ReusePort || lo.socketOpts.ReuseAddress } -// IsTLS returns true if listner options includes TLSInfo. +// IsTLS returns true if listener options includes TLSInfo. func (lo *ListenerOptions) IsTLS() bool { if lo.tlsInfo == nil { return false diff --git a/vendor/go.etcd.io/etcd/client/pkg/v3/transport/listener_tls.go b/vendor/go.etcd.io/etcd/client/pkg/v3/transport/listener_tls.go index 2c94841625b..89ba0c76595 100644 --- a/vendor/go.etcd.io/etcd/client/pkg/v3/transport/listener_tls.go +++ b/vendor/go.etcd.io/etcd/client/pkg/v3/transport/listener_tls.go @@ -23,6 +23,12 @@ import ( "os" "strings" "sync" + "time" +) + +const ( + // tlsHandshakeTimeout bounds how long a single TLS handshake may block. + tlsHandshakeTimeout = 10 * time.Second ) // tlsListener overrides a TLS listener so it will reject client @@ -143,6 +149,7 @@ func (l *tlsListener) acceptLoop() { }() tlsConn := conn.(*tls.Conn) + _ = tlsConn.SetDeadline(time.Now().Add(tlsHandshakeTimeout)) herr := tlsConn.Handshake() pendingMu.Lock() delete(pending, conn) @@ -152,6 +159,7 @@ func (l *tlsListener) acceptLoop() { l.handshakeFailure(tlsConn, herr) return } + _ = tlsConn.SetDeadline(time.Time{}) if err := l.check(ctx, tlsConn); err != nil { l.handshakeFailure(tlsConn, err) return @@ -166,6 +174,29 @@ func (l *tlsListener) acceptLoop() { } } +// ConfigureCRLVerification appends a VerifyConnection hook to cfg that +// rejects any peer certificate whose serial number appears in the CRL file +// configured on info. It is a no-op when CRLFile is empty. Any existing +// VerifyConnection hook is called first and its error short-circuits. +func (info TLSInfo) ConfigureCRLVerification(cfg *tls.Config) { + if len(info.CRLFile) == 0 { + return + } + crlFile := info.CRLFile + prev := cfg.VerifyConnection + cfg.VerifyConnection = func(cs tls.ConnectionState) error { + if prev != nil { + if err := prev(cs); err != nil { + return err + } + } + if len(cs.PeerCertificates) == 0 { + return nil + } + return checkCRL(crlFile, cs.PeerCertificates) + } +} + func checkCRL(crlPath string, cert []*x509.Certificate) error { // TODO: cache crlBytes, err := os.ReadFile(crlPath) diff --git a/vendor/go.etcd.io/etcd/client/pkg/v3/transport/timeout_transport.go b/vendor/go.etcd.io/etcd/client/pkg/v3/transport/timeout_transport.go index ea16b4c0f86..6b6bc67156d 100644 --- a/vendor/go.etcd.io/etcd/client/pkg/v3/transport/timeout_transport.go +++ b/vendor/go.etcd.io/etcd/client/pkg/v3/transport/timeout_transport.go @@ -39,7 +39,7 @@ func NewTimeoutTransport(info TLSInfo, dialtimeoutd, rdtimeoutd, wtimeoutd time. tr.MaxIdleConnsPerHost = 1024 } - tr.Dial = (&rwTimeoutDialer{ + tr.Dial = (&rwTimeoutDialer{ //nolint:staticcheck // TODO: remove for a supported version Dialer: net.Dialer{ Timeout: dialtimeoutd, KeepAlive: 30 * time.Second, diff --git a/vendor/go.etcd.io/etcd/client/pkg/v3/types/set.go b/vendor/go.etcd.io/etcd/client/pkg/v3/types/set.go index 3e69c8d8b94..8c9d8773ef1 100644 --- a/vendor/go.etcd.io/etcd/client/pkg/v3/types/set.go +++ b/vendor/go.etcd.io/etcd/client/pkg/v3/types/set.go @@ -23,15 +23,23 @@ import ( type Set interface { Add(string) Remove(string) - Contains(string) bool + Contains(val ...string) bool Equals(Set) bool Length() int Values() []string Copy() Set Sub(Set) Set + + // ContainsAll returns whether the set contains all given values + // Deprecated: Use Contains instead. + ContainsAll(values []string) bool } -func NewUnsafeSet(values ...string) *unsafeSet { +type ThreadsafeSet interface { + Set +} + +func NewUnsafeSet(values ...string) Set { set := &unsafeSet{make(map[string]struct{})} for _, v := range values { set.Add(v) @@ -39,11 +47,13 @@ func NewUnsafeSet(values ...string) *unsafeSet { return set } -func NewThreadsafeSet(values ...string) *tsafeSet { +func NewThreadsafeSet(values ...string) ThreadsafeSet { us := NewUnsafeSet(values...) return &tsafeSet{us, sync.RWMutex{}} } +var _ Set = (*unsafeSet)(nil) + type unsafeSet struct { d map[string]struct{} } @@ -59,12 +69,17 @@ func (us *unsafeSet) Remove(value string) { } // Contains returns whether the set contains the given value -func (us *unsafeSet) Contains(value string) (exists bool) { - _, exists = us.d[value] - return exists +func (us *unsafeSet) Contains(values ...string) (exists bool) { + for _, value := range values { + if _, exists := us.d[value]; !exists { + return false + } + } + return true } // ContainsAll returns whether the set contains all given values +// Deprecated: Use Contains instead. func (us *unsafeSet) ContainsAll(values []string) bool { for _, s := range values { if !us.Contains(s) { @@ -122,8 +137,10 @@ func (us *unsafeSet) Sub(other Set) Set { return result } +var _ ThreadsafeSet = (*tsafeSet)(nil) + type tsafeSet struct { - us *unsafeSet + us Set m sync.RWMutex } @@ -139,10 +156,18 @@ func (ts *tsafeSet) Remove(value string) { ts.us.Remove(value) } -func (ts *tsafeSet) Contains(value string) (exists bool) { +func (ts *tsafeSet) Contains(values ...string) (exists bool) { ts.m.RLock() defer ts.m.RUnlock() - return ts.us.Contains(value) + return ts.us.Contains(values...) +} + +// ContainsAll returns whether the set contains all given values +// Deprecated: Use Contains instead. +func (ts *tsafeSet) ContainsAll(values []string) bool { + ts.m.RLock() + defer ts.m.RUnlock() + return ts.us.ContainsAll(values) } func (ts *tsafeSet) Equals(other Set) bool { diff --git a/vendor/go.etcd.io/etcd/client/pkg/v3/types/urls.go b/vendor/go.etcd.io/etcd/client/pkg/v3/types/urls.go index 49a38967e64..7dca16c0482 100644 --- a/vendor/go.etcd.io/etcd/client/pkg/v3/types/urls.go +++ b/vendor/go.etcd.io/etcd/client/pkg/v3/types/urls.go @@ -47,7 +47,6 @@ func NewURLs(strs []string) (URLs, error) { return nil, fmt.Errorf("URL must not contain a path: %s", in) } case "unix", "unixs": - break default: return nil, fmt.Errorf("URL scheme must be http, https, unix, or unixs: %s", in) } diff --git a/vendor/go.etcd.io/etcd/client/pkg/v3/verify/verify.go b/vendor/go.etcd.io/etcd/client/pkg/v3/verify/verify.go index a7b2097bed9..cb48d8ff02c 100644 --- a/vendor/go.etcd.io/etcd/client/pkg/v3/verify/verify.go +++ b/vendor/go.etcd.io/etcd/client/pkg/v3/verify/verify.go @@ -66,9 +66,18 @@ func DisableVerifications() func() { // Verify performs verification if the assertions are enabled. // In the default setup running in tests and skipped in the production code. -func Verify(f func()) { +func Verify(msg string, f VerifyFunc) { if IsVerificationEnabled(envVerifyValueAssert) { - f() + ok, details := f() + verifier(ok, msg, details) + } +} + +type VerifyFunc func() (condition bool, details map[string]any) + +func verifier(condition bool, msg string, details map[string]any) { + if !condition { + panic(fmt.Sprintf("%s. details: %v.", msg, details)) } } diff --git a/vendor/golang.org/x/net/html/parse.go b/vendor/golang.org/x/net/html/parse.go index 165b6108d40..a99cee66535 100644 --- a/vendor/golang.org/x/net/html/parse.go +++ b/vendor/golang.org/x/net/html/parse.go @@ -51,6 +51,9 @@ type parser struct { // context is the context element when parsing an HTML fragment // (section 12.4). context *Node + // textNodes holds buffers for TextNodes that have had multiple text + // tokens coalesced into them. + textNodes map[*Node][]byte } func (p *parser) top() *Node { @@ -292,7 +295,7 @@ func (p *parser) fosterParent(n *Node) { prev = parent.LastChild } if prev != nil && prev.Type == TextNode && n.Type == TextNode { - prev.Data += n.Data + p.appendText(prev, n.Data) return } @@ -316,7 +319,7 @@ func (p *parser) addText(text string) { t := p.top() if n := t.LastChild; n != nil && n.Type == TextNode { - n.Data += text + p.appendText(n, text) return } p.addChild(&Node{ @@ -325,6 +328,18 @@ func (p *parser) addText(text string) { }) } +func (p *parser) appendText(n *Node, text string) { + if p.textNodes == nil { + p.textNodes = make(map[*Node][]byte) + } + b, ok := p.textNodes[n] + if !ok { + b = []byte(n.Data) + n.Data = "" + } + p.textNodes[n] = append(b, text...) +} + func attrCompare(a, b Attribute) int { return cmp.Or( cmp.Compare(a.Namespace, b.Namespace), @@ -2242,6 +2257,10 @@ func (p *parser) parse() (err error) { } p.parseCurrentToken() } + for n, b := range p.textNodes { + n.Data = string(b) + } + p.textNodes = nil return nil } diff --git a/vendor/golang.org/x/net/html/render.go b/vendor/golang.org/x/net/html/render.go index 767eeae2503..f356d48b755 100644 --- a/vendor/golang.org/x/net/html/render.go +++ b/vendor/golang.org/x/net/html/render.go @@ -246,18 +246,17 @@ func childTextNodesAreLiteral(n *Node) bool { switch n.Data { case "iframe", "noembed", "noframes", "noscript", "plaintext", "script", "style", "xmp": - // We need to check if n is a node that was fostered from a HTML namespace - // into a non-HTML namespace (in which case, different rules apply to it). - // We do this by walking up the tree until we find a node with a non-empty - // namespace. If we find such a node, we also have to check if it's - // an HTML integration point. If it isn't, then the node we're currently - // looking at is foster-parented and we should return false. - for p := n.Parent; p != nil; p = p.Parent { - if p.Namespace != "" { - if !htmlIntegrationPoint(p) { - return false - } - break + // n's text is literal only if the parser would keep n in the HTML + // namespace when the output is re-parsed. An ancestor may have been + // fostered under a foreign element (such as an HTML under + // ) where the parser would instead create it, and its + // descendants, in that element's namespace. We walk up the whole tree + // and check that every transition out of a non-HTML namespace happens + // at an HTML integration point. This is stricter than the parser, so + // some text that would be safe literally is escaped. + for c, p := n, n.Parent; p != nil; c, p = p, p.Parent { + if p.Namespace != "" && p.Namespace != c.Namespace && !htmlIntegrationPoint(p) { + return false } } diff --git a/vendor/golang.org/x/net/internal/socket/socket.go b/vendor/golang.org/x/net/internal/socket/socket.go index fb7fa1e00ae..fb8a20c4d7a 100644 --- a/vendor/golang.org/x/net/internal/socket/socket.go +++ b/vendor/golang.org/x/net/internal/socket/socket.go @@ -129,7 +129,8 @@ func (m ControlMessage) Next(dataLen int) ControlMessage { // MarshalHeader marshals the header fields of the control message at // the head on m. func (m ControlMessage) MarshalHeader(lvl, typ, dataLen int) error { - if len(m) < controlHeaderLen() { + l := controlHeaderLen() + if l <= 0 || len(m) < l { return errors.New("short message") } h := (*cmsghdr)(unsafe.Pointer(&m[0])) @@ -141,7 +142,7 @@ func (m ControlMessage) MarshalHeader(lvl, typ, dataLen int) error { // message at the head on m. func (m ControlMessage) ParseHeader() (lvl, typ, dataLen int, err error) { l := controlHeaderLen() - if len(m) < l { + if l <= 0 || len(m) < l { return 0, 0, 0, errors.New("short message") } h := (*cmsghdr)(unsafe.Pointer(&m[0])) @@ -152,7 +153,7 @@ func (m ControlMessage) ParseHeader() (lvl, typ, dataLen int, err error) { // the next control message. func (m ControlMessage) Marshal(lvl, typ int, data []byte) (ControlMessage, error) { l := len(data) - if len(m) < ControlMessageSpace(l) { + if controlHeaderLen() <= 0 || len(m) < ControlMessageSpace(l) { return nil, errors.New("short message") } h := (*cmsghdr)(unsafe.Pointer(&m[0])) @@ -167,6 +168,9 @@ func (m ControlMessage) Marshal(lvl, typ int, data []byte) (ControlMessage, erro // // Parse works for both standard and compatible messages. func (m ControlMessage) Parse() ([]ControlMessage, error) { + if controlHeaderLen() <= 0 { + return nil, nil + } var ms []ControlMessage for len(m) >= controlHeaderLen() { h := (*cmsghdr)(unsafe.Pointer(&m[0])) diff --git a/vendor/golang.org/x/net/ipv4/batch.go b/vendor/golang.org/x/net/ipv4/batch.go index 1a3a4fc0c10..50e5c69ee4a 100644 --- a/vendor/golang.org/x/net/ipv4/batch.go +++ b/vendor/golang.org/x/net/ipv4/batch.go @@ -75,6 +75,9 @@ func (c *payloadHandler) ReadBatch(ms []Message, flags int) (int, error) { if !c.ok() { return 0, errInvalidConn } + if len(ms) == 0 { + return 0, nil + } switch runtime.GOOS { case "linux": n, err := c.RecvMsgs([]socket.Message(ms), flags) @@ -109,6 +112,9 @@ func (c *payloadHandler) WriteBatch(ms []Message, flags int) (int, error) { if !c.ok() { return 0, errInvalidConn } + if len(ms) == 0 { + return 0, nil + } switch runtime.GOOS { case "linux": n, err := c.SendMsgs([]socket.Message(ms), flags) @@ -141,6 +147,9 @@ func (c *packetHandler) ReadBatch(ms []Message, flags int) (int, error) { if !c.ok() { return 0, errInvalidConn } + if len(ms) == 0 { + return 0, nil + } switch runtime.GOOS { case "linux": n, err := c.RecvMsgs([]socket.Message(ms), flags) @@ -175,6 +184,9 @@ func (c *packetHandler) WriteBatch(ms []Message, flags int) (int, error) { if !c.ok() { return 0, errInvalidConn } + if len(ms) == 0 { + return 0, nil + } switch runtime.GOOS { case "linux": n, err := c.SendMsgs([]socket.Message(ms), flags) diff --git a/vendor/golang.org/x/net/ipv4/control.go b/vendor/golang.org/x/net/ipv4/control.go index a2b02ca95b9..e269a5b5398 100644 --- a/vendor/golang.org/x/net/ipv4/control.go +++ b/vendor/golang.org/x/net/ipv4/control.go @@ -84,13 +84,13 @@ func (cm *ControlMessage) Parse(b []byte) error { continue } switch { - case typ == ctlOpts[ctlTTL].name && l >= ctlOpts[ctlTTL].length: + case ctlOpts[ctlTTL].name > 0 && typ == ctlOpts[ctlTTL].name && l >= ctlOpts[ctlTTL].length: ctlOpts[ctlTTL].parse(cm, m.Data(l)) - case typ == ctlOpts[ctlDst].name && l >= ctlOpts[ctlDst].length: + case ctlOpts[ctlDst].name > 0 && typ == ctlOpts[ctlDst].name && l >= ctlOpts[ctlDst].length: ctlOpts[ctlDst].parse(cm, m.Data(l)) - case typ == ctlOpts[ctlInterface].name && l >= ctlOpts[ctlInterface].length: + case ctlOpts[ctlInterface].name > 0 && typ == ctlOpts[ctlInterface].name && l >= ctlOpts[ctlInterface].length: ctlOpts[ctlInterface].parse(cm, m.Data(l)) - case typ == ctlOpts[ctlPacketInfo].name && l >= ctlOpts[ctlPacketInfo].length: + case ctlOpts[ctlPacketInfo].name > 0 && typ == ctlOpts[ctlPacketInfo].name && l >= ctlOpts[ctlPacketInfo].length: ctlOpts[ctlPacketInfo].parse(cm, m.Data(l)) } } diff --git a/vendor/golang.org/x/net/ipv4/control_unix.go b/vendor/golang.org/x/net/ipv4/control_unix.go index 2e765548f3a..00f0439adad 100644 --- a/vendor/golang.org/x/net/ipv4/control_unix.go +++ b/vendor/golang.org/x/net/ipv4/control_unix.go @@ -7,7 +7,8 @@ package ipv4 import ( - "unsafe" + "encoding/binary" + "runtime" "golang.org/x/net/internal/iana" "golang.org/x/net/internal/socket" @@ -66,10 +67,18 @@ func setControlMessage(c *socket.Conn, opt *rawOpt, cf ControlFlags, on bool) er func marshalTTL(b []byte, cm *ControlMessage) []byte { m := socket.ControlMessage(b) + if runtime.GOOS == "linux" { + m.MarshalHeader(iana.ProtocolIP, unix.IP_TTL, 4) + return m.Next(4) + } m.MarshalHeader(iana.ProtocolIP, unix.IP_RECVTTL, 1) return m.Next(1) } func parseTTL(cm *ControlMessage, b []byte) { - cm.TTL = int(*(*byte)(unsafe.Pointer(&b[:1][0]))) + if runtime.GOOS == "linux" { + cm.TTL = int(binary.NativeEndian.Uint32(b[:4])) + return + } + cm.TTL = int(b[0]) } diff --git a/vendor/golang.org/x/net/ipv4/header.go b/vendor/golang.org/x/net/ipv4/header.go index ee6edae14b9..f92a71c4ade 100644 --- a/vendor/golang.org/x/net/ipv4/header.go +++ b/vendor/golang.org/x/net/ipv4/header.go @@ -111,6 +111,9 @@ func (h *Header) Parse(b []byte) error { return errHeaderTooShort } hdrlen := int(b[0]&0x0f) << 2 + if hdrlen < HeaderLen { + return errHeaderTooShort + } if len(b) < hdrlen { return errExtHeaderTooShort } diff --git a/vendor/golang.org/x/net/ipv4/packet.go b/vendor/golang.org/x/net/ipv4/packet.go index 7d784e06dd0..9cfdf7c04c9 100644 --- a/vendor/golang.org/x/net/ipv4/packet.go +++ b/vendor/golang.org/x/net/ipv4/packet.go @@ -65,6 +65,12 @@ func slicePacket(b []byte) (h, p []byte, err error) { return nil, nil, errHeaderTooShort } hdrlen := int(b[0]&0x0f) << 2 + if hdrlen < HeaderLen { + return nil, nil, errHeaderTooShort + } + if len(b) < hdrlen { + return nil, nil, errExtHeaderTooShort + } return b[:hdrlen], b[hdrlen:], nil } diff --git a/vendor/golang.org/x/net/ipv4/payload_cmsg.go b/vendor/golang.org/x/net/ipv4/payload_cmsg.go index 91c685e8fca..36b115269f2 100644 --- a/vendor/golang.org/x/net/ipv4/payload_cmsg.go +++ b/vendor/golang.org/x/net/ipv4/payload_cmsg.go @@ -38,13 +38,17 @@ func (c *payloadHandler) ReadFrom(b []byte) (n int, cm *ControlMessage, src net. return 0, nil, nil, &net.OpError{Op: "read", Net: c.PacketConn.LocalAddr().Network(), Source: c.PacketConn.LocalAddr(), Err: err} } hdrlen := int(h[0]&0x0f) << 2 + if m.N < HeaderLen || hdrlen < HeaderLen { + return 0, nil, nil, &net.OpError{Op: "read", Net: c.PacketConn.LocalAddr().Network(), Source: c.PacketConn.LocalAddr(), Err: errHeaderTooShort} + } + if m.N < hdrlen { + return 0, nil, nil, &net.OpError{Op: "read", Net: c.PacketConn.LocalAddr().Network(), Source: c.PacketConn.LocalAddr(), Err: errExtHeaderTooShort} + } if hdrlen > len(h) { d := hdrlen - len(h) copy(b, b[d:]) - m.N -= d - } else { - m.N -= hdrlen } + m.N -= hdrlen default: return 0, nil, nil, &net.OpError{Op: "read", Net: c.PacketConn.LocalAddr().Network(), Source: c.PacketConn.LocalAddr(), Err: errInvalidConnType} } diff --git a/vendor/golang.org/x/net/ipv4/sys_bpf.go b/vendor/golang.org/x/net/ipv4/sys_bpf.go index 1b4780df413..b8d11fe39eb 100644 --- a/vendor/golang.org/x/net/ipv4/sys_bpf.go +++ b/vendor/golang.org/x/net/ipv4/sys_bpf.go @@ -7,6 +7,8 @@ package ipv4 import ( + "errors" + "math" "unsafe" "golang.org/x/net/bpf" @@ -15,6 +17,9 @@ import ( ) func (so *sockOpt) setAttachFilter(c *socket.Conn, f []bpf.RawInstruction) error { + if len(f) == 0 || len(f) > math.MaxUint16 { + return errors.New("invalid filter") + } prog := unix.SockFprog{ Len: uint16(len(f)), Filter: (*unix.SockFilter)(unsafe.Pointer(&f[0])), diff --git a/vendor/golang.org/x/net/ipv4/sys_linux.go b/vendor/golang.org/x/net/ipv4/sys_linux.go index 4588a5f3e2e..d04824641bd 100644 --- a/vendor/golang.org/x/net/ipv4/sys_linux.go +++ b/vendor/golang.org/x/net/ipv4/sys_linux.go @@ -17,7 +17,7 @@ import ( var ( ctlOpts = [ctlMax]ctlOpt{ - ctlTTL: {unix.IP_TTL, 1, marshalTTL, parseTTL}, + ctlTTL: {unix.IP_TTL, 4, marshalTTL, parseTTL}, ctlPacketInfo: {unix.IP_PKTINFO, sizeofInetPktinfo, marshalPacketInfo, parsePacketInfo}, } diff --git a/vendor/golang.org/x/net/ipv4/sys_solaris.go b/vendor/golang.org/x/net/ipv4/sys_solaris.go index 0bb9f3e3643..4b08ab9a431 100644 --- a/vendor/golang.org/x/net/ipv4/sys_solaris.go +++ b/vendor/golang.org/x/net/ipv4/sys_solaris.go @@ -19,7 +19,7 @@ const sockoptReceiveInterface = unix.IP_RECVIF var ( ctlOpts = [ctlMax]ctlOpt{ - ctlTTL: {unix.IP_RECVTTL, 4, marshalTTL, parseTTL}, + ctlTTL: {unix.IP_RECVTTL, 1, marshalTTL, parseTTL}, ctlPacketInfo: {unix.IP_PKTINFO, sizeofInetPktinfo, marshalPacketInfo, parsePacketInfo}, } diff --git a/vendor/golang.org/x/net/ipv6/batch.go b/vendor/golang.org/x/net/ipv6/batch.go index 2ccb9849c78..3920152312d 100644 --- a/vendor/golang.org/x/net/ipv6/batch.go +++ b/vendor/golang.org/x/net/ipv6/batch.go @@ -66,6 +66,9 @@ func (c *payloadHandler) ReadBatch(ms []Message, flags int) (int, error) { if !c.ok() { return 0, errInvalidConn } + if len(ms) == 0 { + return 0, nil + } switch runtime.GOOS { case "linux": n, err := c.RecvMsgs([]socket.Message(ms), flags) @@ -97,6 +100,9 @@ func (c *payloadHandler) WriteBatch(ms []Message, flags int) (int, error) { if !c.ok() { return 0, errInvalidConn } + if len(ms) == 0 { + return 0, nil + } switch runtime.GOOS { case "linux": n, err := c.SendMsgs([]socket.Message(ms), flags) diff --git a/vendor/golang.org/x/net/ipv6/control.go b/vendor/golang.org/x/net/ipv6/control.go index 2da644413b4..1f77eabf87f 100644 --- a/vendor/golang.org/x/net/ipv6/control.go +++ b/vendor/golang.org/x/net/ipv6/control.go @@ -130,13 +130,13 @@ func (cm *ControlMessage) Parse(b []byte) error { continue } switch { - case typ == ctlOpts[ctlTrafficClass].name && l >= ctlOpts[ctlTrafficClass].length: + case ctlOpts[ctlTrafficClass].name > 0 && typ == ctlOpts[ctlTrafficClass].name && l >= ctlOpts[ctlTrafficClass].length: ctlOpts[ctlTrafficClass].parse(cm, m.Data(l)) - case typ == ctlOpts[ctlHopLimit].name && l >= ctlOpts[ctlHopLimit].length: + case ctlOpts[ctlHopLimit].name > 0 && typ == ctlOpts[ctlHopLimit].name && l >= ctlOpts[ctlHopLimit].length: ctlOpts[ctlHopLimit].parse(cm, m.Data(l)) - case typ == ctlOpts[ctlPacketInfo].name && l >= ctlOpts[ctlPacketInfo].length: + case ctlOpts[ctlPacketInfo].name > 0 && typ == ctlOpts[ctlPacketInfo].name && l >= ctlOpts[ctlPacketInfo].length: ctlOpts[ctlPacketInfo].parse(cm, m.Data(l)) - case typ == ctlOpts[ctlPathMTU].name && l >= ctlOpts[ctlPathMTU].length: + case ctlOpts[ctlPathMTU].name > 0 && typ == ctlOpts[ctlPathMTU].name && l >= ctlOpts[ctlPathMTU].length: ctlOpts[ctlPathMTU].parse(cm, m.Data(l)) } } diff --git a/vendor/golang.org/x/net/ipv6/icmp_bsd.go b/vendor/golang.org/x/net/ipv6/icmp_bsd.go index 2814534a0b2..b251cb96789 100644 --- a/vendor/golang.org/x/net/ipv6/icmp_bsd.go +++ b/vendor/golang.org/x/net/ipv6/icmp_bsd.go @@ -7,10 +7,16 @@ package ipv6 func (f *icmpv6Filter) accept(typ ICMPType) { + if typ < 0 || int(typ>>5) >= len(f.Filt) { + return + } f.Filt[typ>>5] |= 1 << (uint32(typ) & 31) } func (f *icmpv6Filter) block(typ ICMPType) { + if typ < 0 || int(typ>>5) >= len(f.Filt) { + return + } f.Filt[typ>>5] &^= 1 << (uint32(typ) & 31) } @@ -25,5 +31,8 @@ func (f *icmpv6Filter) setAll(block bool) { } func (f *icmpv6Filter) willBlock(typ ICMPType) bool { + if typ < 0 || int(typ>>5) >= len(f.Filt) { + return false + } return f.Filt[typ>>5]&(1<<(uint32(typ)&31)) == 0 } diff --git a/vendor/golang.org/x/net/ipv6/icmp_linux.go b/vendor/golang.org/x/net/ipv6/icmp_linux.go index 647f6b44fff..74bc23ae8c7 100644 --- a/vendor/golang.org/x/net/ipv6/icmp_linux.go +++ b/vendor/golang.org/x/net/ipv6/icmp_linux.go @@ -5,10 +5,16 @@ package ipv6 func (f *icmpv6Filter) accept(typ ICMPType) { + if typ < 0 || int(typ>>5) >= len(f.Data) { + return + } f.Data[typ>>5] &^= 1 << (uint32(typ) & 31) } func (f *icmpv6Filter) block(typ ICMPType) { + if typ < 0 || int(typ>>5) >= len(f.Data) { + return + } f.Data[typ>>5] |= 1 << (uint32(typ) & 31) } @@ -23,5 +29,8 @@ func (f *icmpv6Filter) setAll(block bool) { } func (f *icmpv6Filter) willBlock(typ ICMPType) bool { + if typ < 0 || int(typ>>5) >= len(f.Data) { + return false + } return f.Data[typ>>5]&(1<<(uint32(typ)&31)) != 0 } diff --git a/vendor/golang.org/x/net/ipv6/icmp_solaris.go b/vendor/golang.org/x/net/ipv6/icmp_solaris.go index 7c23bb1cf6f..b15ac07e347 100644 --- a/vendor/golang.org/x/net/ipv6/icmp_solaris.go +++ b/vendor/golang.org/x/net/ipv6/icmp_solaris.go @@ -5,10 +5,16 @@ package ipv6 func (f *icmpv6Filter) accept(typ ICMPType) { + if typ < 0 || int(typ>>5) >= len(f.X__icmp6_filt) { + return + } f.X__icmp6_filt[typ>>5] |= 1 << (uint32(typ) & 31) } func (f *icmpv6Filter) block(typ ICMPType) { + if typ < 0 || int(typ>>5) >= len(f.X__icmp6_filt) { + return + } f.X__icmp6_filt[typ>>5] &^= 1 << (uint32(typ) & 31) } @@ -23,5 +29,8 @@ func (f *icmpv6Filter) setAll(block bool) { } func (f *icmpv6Filter) willBlock(typ ICMPType) bool { + if typ < 0 || int(typ>>5) >= len(f.X__icmp6_filt) { + return false + } return f.X__icmp6_filt[typ>>5]&(1<<(uint32(typ)&31)) == 0 } diff --git a/vendor/golang.org/x/net/ipv6/icmp_zos.go b/vendor/golang.org/x/net/ipv6/icmp_zos.go index ddf8f093fc4..9ba3d22811e 100644 --- a/vendor/golang.org/x/net/ipv6/icmp_zos.go +++ b/vendor/golang.org/x/net/ipv6/icmp_zos.go @@ -5,11 +5,17 @@ package ipv6 func (f *icmpv6Filter) accept(typ ICMPType) { + if typ < 0 || int(typ>>5) >= len(f.Filt) { + return + } f.Filt[typ>>5] |= 1 << (uint32(typ) & 31) } func (f *icmpv6Filter) block(typ ICMPType) { + if typ < 0 || int(typ>>5) >= len(f.Filt) { + return + } f.Filt[typ>>5] &^= 1 << (uint32(typ) & 31) } @@ -25,5 +31,8 @@ func (f *icmpv6Filter) setAll(block bool) { } func (f *icmpv6Filter) willBlock(typ ICMPType) bool { + if typ < 0 || int(typ>>5) >= len(f.Filt) { + return false + } return f.Filt[typ>>5]&(1<<(uint32(typ)&31)) == 0 } diff --git a/vendor/golang.org/x/net/ipv6/sys_bpf.go b/vendor/golang.org/x/net/ipv6/sys_bpf.go index e39f75f49fa..4b7caec870c 100644 --- a/vendor/golang.org/x/net/ipv6/sys_bpf.go +++ b/vendor/golang.org/x/net/ipv6/sys_bpf.go @@ -7,6 +7,8 @@ package ipv6 import ( + "errors" + "math" "unsafe" "golang.org/x/net/bpf" @@ -15,6 +17,9 @@ import ( ) func (so *sockOpt) setAttachFilter(c *socket.Conn, f []bpf.RawInstruction) error { + if len(f) == 0 || len(f) > math.MaxUint16 { + return errors.New("invalid filter") + } prog := unix.SockFprog{ Len: uint16(len(f)), Filter: (*unix.SockFilter)(unsafe.Pointer(&f[0])), diff --git a/vendor/modules.txt b/vendor/modules.txt index 2aea6ec6f56..79b97e71a3f 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -2105,8 +2105,8 @@ go.etcd.io/etcd/api/v3/mvccpb go.etcd.io/etcd/api/v3/v3rpc/rpctypes go.etcd.io/etcd/api/v3/version go.etcd.io/etcd/api/v3/versionpb -# go.etcd.io/etcd/client/pkg/v3 v3.6.11 -## explicit; go 1.25.0 +# go.etcd.io/etcd/client/pkg/v3 v3.7.3 +## explicit; go 1.26.0 go.etcd.io/etcd/client/pkg/v3/fileutil go.etcd.io/etcd/client/pkg/v3/logutil go.etcd.io/etcd/client/pkg/v3/systemd @@ -2308,7 +2308,7 @@ golang.org/x/image/webp golang.org/x/mod/internal/lazyregexp golang.org/x/mod/module golang.org/x/mod/semver -# golang.org/x/net v0.61.0 +# golang.org/x/net v0.62.0 ## explicit; go 1.26.0 golang.org/x/net/bpf golang.org/x/net/context