Commit Graph
11766 Commits
Author SHA1 Message Date
James Tucker 7dbc80ab71 ssh/tailssh: hand the agent forwarding dir to the user, remove it on session end
The agent forwarding socket's temp directory was left root-owned and
chmod 0755, letting every local user reach other users' agent sockets.
Chown the directory to the session user and keep it 0700 (the socket is
already 0600 and chowned first), like sshd's agent forwarding, and
remove the directory when the session ends instead of only closing the
listener.

Updates tailscale/corp#50380

Signed-off-by: James Tucker <[email protected]>
2026-10-24 13:52:38 -07:00
James Tucker 4777494982 ssh/tailssh: pin rejection-banner content to policy-derived facts
A policy rejection names the requested sshUser: that name is the
client's own request and reflects only tailnet policy (the client's
own ACL view), never a local-host fact, so naming it leaks nothing.
What a client-visible rejection must never depend on is server-side
local-user information: local-user lookup failures send one fixed
message for every failure cause, with the underlying error logged
server-side only, so the client cannot tell "no such local user"
from any other lookup failure and no banner is a
username-existence oracle.

Pin both properties in TestSSHAuthFlow: the user-mismatch cases,
including a rule whose "=" mapping forces a local lookup of a user
that does not exist, all name the requested user identically, and an
accept rule whose mapped local user fails lookup gets the fixed
lookup-failure banner.

Updates tailscale/corp#50380

Signed-off-by: James Tucker <[email protected]>
2026-10-24 13:52:26 -07:00
James Tucker 3c13466645 ssh/tailssh: write private host keys with 0600 permissions
Private host keys are only ever read by tailscaled itself; writing them
0700 needlessly allows group/other to walk into the key directory.
Use 0600, and pin it in TestSSHKeyGen.

Updates tailscale/corp#50380

Signed-off-by: James Tucker <[email protected]>
2026-10-24 13:30:41 -07:00
James Tucker d90ffb62af ssh/tailssh: treat numerically-zero uids as root in isRootUser
An NSS uid like "00" passed the string != "0" check but parses to 0 in
the incubator, so a session could bypass non-root checks and run as
root. Compare the uid numerically instead; non-numeric uids keep the
previous behavior.

Updates tailscale/corp#50380

Signed-off-by: James Tucker <[email protected]>
2026-10-24 13:23:22 -07:00
James Tucker 3e61adf832 util/osuser: validate 'id' input, reject corrupt getent passwd output
Before invoking 'id -Gz <user>', apply the same input validation as the
getent path (checkGetentInput), so a crafted username like '-u' can't be
interpreted as an option by the id command.

parseGetentUser now rejects multi-line (multiple or corrupted records)
output and validates the username and shell fields (no leading dashes,
control characters, or invalid UTF-8), the fields that are used to look
up and run a session. Also add the missing leading-dash regression test
for the 'id' call path.

The passwd format has no escaping — gecos sub-fields are comma-separated
— so an eighth colon-separated field means a stray colon in some field,
shifting every field after it: home parses as a gecos fragment and the
shell as the real home directory. Short records keep the existing
treatment (padded, with the default-shell fallback); over-long records
now fail closed like the other corrupt-output cases.

Updates tailscale/corp#50380

Signed-off-by: James Tucker <[email protected]>
2026-10-24 13:05:02 -07:00
James Tucker ec40639b05 ssh/tailssh: extend dangerous env var denylist, re-check child-side
GCONV_PATH, LOCPATH, NLSPATH, HOSTALIASES and RES_OPTIONS can make
privileged processes (root su/login environments built from forwarded
vars) load attacker-controlled files or redirect resolver lookups; add
them to the isDangerousEnvVar denylist, and apply the same check in the
incubator child when it re-filters the inherited forwarded-env payload
(old parents may not have filtered them).

Updates tailscale/corp#50380

Signed-off-by: James Tucker <[email protected]>
2026-10-24 12:41:58 -07:00
James Tucker a819ec0753 ssh/tailssh: make acceptEnv pattern matching linear time
matchAcceptEnvPattern recursively retried each '*' suffix, which is
exponential in the number of '*'s in an acceptEnv pattern (2.7s observed
on a 400-byte crafted variable name). Replace it with an iterative
matcher that only backtracks to the most recent '*', preserving the
exact OpenSSH-style glob semantics. Cross-check it against a naive
backtracking reference over random inputs, and pin the crafted
backtracking case as a timing regression test.

Updates tailscale/corp#50380

Signed-off-by: James Tucker <[email protected]>
2026-10-24 12:13:05 -07:00
James Tucker 6ce8b89912 ssh/tailssh: record the raw client command in session recordings
The CastHeader recorded a shell-parsed reconstruction of the session
command, but the command is passed to the user's shell verbatim, and the
shell lexer silently drops unbalanced quotes. A spoofed command could
therefore make the recording differ from what the shell actually ran.
Record ss.RawCommand() instead.

Updates tailscale/corp#50380

Signed-off-by: James Tucker <[email protected]>
2026-10-24 11:32:32 -07:00
Brad Fitzpatrick a6cffd0a6d drive/driveimpl/compositedav: don't run ttlcache cleanup goroutines
StatCache started each ttlcache with "go cache.Start()" and stopped
them in StatCache.stop. But ttlcache caches begin in the stopped
state, so if stop ran before the Start goroutine was scheduled,
Stop was a no-op and Start then ran forever, leaking a goroutine.
That made tests using tstest.ResourceCheck flaky:

    goroutine github.com/jellydator/ttlcache/v3.(*Cache[...]).Start

Rather than synchronize with Start, drop the background goroutine
entirely. Cache.Get already ignores expired items, so the goroutine
only existed to free memory. Instead, call DeleteExpired on each
write, which is cheap: it pops expired entries from the front of the
expiration heap and stops at the first unexpired one. With no
goroutines, StatCache.stop is no longer needed, so remove it.

Fixes #21824
Updates tailscale/corp#49459

Change-Id: Ib438fcd45296be79528613c5f5687725c38a137d
Signed-off-by: Brad Fitzpatrick <[email protected]>
2026-10-23 20:41:40 -04:00
James Tucker ae4ab7e7d5 net/netmon,net/netns: cache Windows default interface indices
Windows socket setup enumerates adapters and the routing table through
GetWindowsDefault for every netns socket. These calls can be expensive,
particularly on systems where security software adds syscall latency.

Cache nonzero default interface indices per monitor and address family,
and use them from netns controlC. Invalidate on native route, address,
and IP interface change notifications.

Coalesce concurrent lookups and retry results invalidated during lookup.
Bound lookup and wait attempts; once the budget is exhausted, fall back
to a single uncached lookup rather than failing socket setup, erring
toward a possibly stale interface index over no socket at all. Perform
fresh lookups for zero indices and errors, and retain the existing
unbound-socket fallback for a fresh zero result.

Use uncached lookups after monitor shutdown or when interface-change
notification registration fails.

Test cache reuse, independent address families, notification invalidation,
concurrent fills, invalidation during lookup, route restoration after a
zero result, churn and wait-budget fallbacks, and shutdown.

Fixes #21885

Signed-off-by: James Tucker <[email protected]>
2026-10-23 17:50:52 -04:00
Alex Chan dd50731b7b util/set: provide a size hint when calling Set.Of
We already do this for `Set.OfSliceView`.

Updates #cleanup

Change-Id: I6ce3022ddabae2a0891e76ca45f3a7c601627a02
Signed-off-by: Alex Chan <[email protected]>
2026-10-23 17:28:23 -04:00
Alex Chan 2ddef398f9 types/ipproto: fix a typo in a doc comment
Updates #cleanup

Change-Id: I5d046c6997770602336bda49d7a6fab41f76401c
Signed-off-by: Alex Chan <[email protected]>
2026-10-23 17:10:21 -04:00
kari-ts 00650c0b3b ipn, ipn/local: expose hidden device gui gui_visibility (#21822)
This interprets HiddenNetworkDevices per watch session and sends GUI visibility metadata for peers (without filtering them). We refresh the visibility snapshot when policy or peer membership changes.

Updates tailscale/corp#44104

Signed-off-by: kari-ts <[email protected]>
2026-10-23 11:45:38 -07:00
Brad Fitzpatrick f8ad538a3b words: add a missing scale
Updates #words

Change-Id: Iff0c568fa4ffe2c2972521d5bf21dbdbe8af3a80
Signed-off-by: Brad Fitzpatrick <[email protected]>
2026-10-22 10:52:43 -04:00
Simon Law 37fc7a7a72 format using go fmt version 1.27.2 (#21838)
Updates #cleanup

Change-Id: I3b0987b431fa4c601b90a2763ce73eb24a7713ce

Signed-off-by: Simon Law <[email protected]>
2026-10-21 23:17:21 -07:00
Brad Fitzpatrick 47743a8b9a .github/workflows: only run tailcat check on PRs to main
Release branches don't need the heads-up about tailcat breakage.

Updates #cleanup

Change-Id: I132880827880f6b80cf4df34ac7e16dbe0b41eb4
Signed-off-by: Brad Fitzpatrick <[email protected]>
2026-10-20 09:24:49 -07:00
Nick Khyl eaf3fc8daf net/dns: don't make quad-100 the primary resolver on Windows when hosts are unrouted
In #20775 (and the follow-up in #21471), we started installing quad-100
as the OS's primary resolver whenever cfg has hosts not covered by a split
DNS route, so that sandboxed macOS clients could still answer them.

However, that check was added to the generic split DNS gate rather than
to the Apple-specific one, so it also applies on Windows, where dcfg.Hosts
always carries every node's records and MagicDNSHostsUnrouted is set
whenever MagicDNS is disabled. As a result, a Windows node with MagicDNS
off and at least one split DNS route (or with MagicDNS on and a peer shared
in from another tailnet) gets a catch-all NRPT rule pointing at quad-100,
and all DNS traffic on the device is proxied through it instead of only
the configured suffixes.

The check is redundant for Apple platforms: iOS never takes the scoped
path there, and sandboxed macOS only does so via scopeApple, which already
requires !cfg.requiresPrimaryResolver(). This removes it from the generic
gate, restoring the pre-1.104 behavior on Windows, and adds tests.

Updates tailscale/corp#45534
Fixes #21863

Signed-off-by: Nick Khyl <[email protected]>
2026-10-20 09:21:11 -04:00
Dep Updater ef596ebd34 go.toolchain.rev: bump Go toolchain
* Go toolchain: https://github.com/tailscale/go/compare/186053ab2af2ef8fc43f3c1d1150216e89d4aff0...7ef7b403648ac3a9481a6e88e8b894eff50b0167

Triggered by @bradfitz via the bumpdep workflow.

Updates tailscale/corp#50253

Signed-off-by: Dep Updater <[email protected]>
2026-10-20 05:35:13 -07:00
Patrick O'Doherty db03d4e19d clientupdate: use a per-update Linux download directory (#21853)
Create a fresh directory for each Linux tarball download and remove it
after unpacking or a failed download. Continue to prefer the user cache
directory and use the temporary directory when the cache path is
unavailable.

Fixes tailscale/corp#50119
Fixes tailscale/corp#48680

Change-Id: Iebe13d922f8fa691f26fe17d908b295b7153aadb

Credit: Winfunc

Signed-off-by: Patrick O'Doherty <[email protected]>
2026-10-19 15:34:25 -07:00
License Updater 374d505a99 licenses: update license notices
Signed-off-by: License Updater <[email protected]>
2026-10-19 10:18:56 -07:00
Joe Tsai e3c3ef18a5 util/unitconv: add new package (#20868)
Package unitconv implements string conversion functionality
for unit prefixes such as those from the SI and IEC standards.
It is catered towards printing of values for human consumption.

This exists to support open-sourcing JSON migration tooling.

Updates #20220
Updates tailscale/corp#791

Signed-off-by: Joe Tsai <[email protected]>
2026-10-16 18:02:33 -07:00
Sachin NeneandClaude Opus 5 af08ffa4d2 ssh/tailssh: dup the pty master with F_DUPFD_CLOEXEC (#21342)
launchProcess duplicated the pty master with syscall.Dup, which is a
plain dup(2) and does not set FD_CLOEXEC. The original master from
pty.Open is CLOEXEC (os.OpenFile), but the dup is not, and it stays
open in tailscaled until the session's stdout copier closes it.

Because child processes are started with os/exec, which relies on
FD_CLOEXEC to drop fds, every other SSH session started while this one
is alive inherits the dup'd master. It then survives the incubator's
exec into login, the user's shell, and everything the shell runs.

When the original session disconnects, tailscaled closes its own copies
but the leaked copies in other sessions' process trees keep the pty
open: the slave never hangs up, nobody reads the master, and any process
writing to that tty blocks forever once the buffer fills. On a host with
a long-lived tmux server this shows up as every tmux command hanging,
with the server stuck in n_tty_write on a dead client's tty.

Use F_DUPFD_CLOEXEC so the dup is never inherited across exec.

Fixes #21343

Signed-off-by: Sachin Nene <[email protected]>
Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
2026-10-16 17:45:34 -07:00
Patrick O'Doherty 3cc10b9056 go.mod: bump aws-sdk-go dependencies (#21814)
Bump aws-sdk-go and related dependencies so that we can drop our
aws-vault fork in tailscale/corp.

Updates #cleanup

Change-Id: I9b73a8d637eb9e9e57c508797ad0fe91c4391e0c

Signed-off-by: Patrick O'Doherty <[email protected]>
2026-10-16 10:53:58 -07:00
Francois Marier 48ac67151e tstest/natlab/vnet: send "unsupported version" NAT-PMP/PCP responses
When receiving a PCP request, a NAT-PMP-only server must reply with
an unsupported version response. Same for a PCP-only server
receiving a NAT-PMP request.

The tailscale client sends both a NAT-PMP and a PCP request when
probing for portmapping support and it correctly handle any
unsupported version response it receives.

Updates #21713

Change-Id: I0ec8b4a6c1de14bcc64b82f1988cde7fc01f5747
Signed-off-by: Francois Marier <[email protected]>
2026-10-16 10:13:52 -07:00
Michael Ben-Ami e310c02787 ipn/ipnext: add NodeBackend.NodeBy{Addr,ID}
The immediate use case is feature/conn25 identifying the connector peer
node that responds to a DoH request.

Updates tailscale/corp#46169

Signed-off-by: Michael Ben-Ami <[email protected]>
2026-10-16 12:45:54 -04:00
chaosinthecrd e915ebc42a control/controlclient,ipn/ipnlocal,tstest/integration: test node removal
Adds tests that only a 404 map response wraps ErrNodeRemoved, that the
node-removed warning and NeedsLogin state are cleared by a new netmap or
a profile switch, and that a node restarted after it was deleted shows
the warning and reaches NeedsLogin.

Updates #18700

Signed-off-by: chaosinthecrd <[email protected]>
2026-10-16 16:40:31 +01:00
chaosinthecrd 0f3c767d17 control/controlclient,ipn/ipnlocal,tsconst: go to NeedsLogin on node removal
When a node is deleted, control answers its map requests with a 404 and
the client keeps retrying in its current state, so watchers like
containerboot can't tell a deleted node from a lost connection. This
wraps that error in ErrNodeRemoved, and LocalBackend then moves to
NeedsLogin and sets a node-removed health warning, both cleared on the
next netmap or profile switch. It repurposes #18701 as a stopgap until a
broader fix, such as structured errors from control, exists.

Updates #18700

Signed-off-by: chaosinthecrd <[email protected]>
2026-10-16 16:40:31 +01:00
Vivek Singh cfa83f7efe cmd/tailscale/cli: use the tcp scheme for tls-terminated-tcp set-config targets (#21789)
runServeSetConfig built every non-file, non-unix endpoint target as
"<protocol>://<host:port>", so a tls-terminated-tcp endpoint produced the
target tls-terminated-tcp://host:port. applyTCPServe accepts only the tcp
and unix target schemes, and it takes TLS termination from the serve type
rather than from the target. Every such endpoint therefore failed with
"unable to expand target". The flag form already works because it passes
--tls-terminated-tcp=<port> together with a tcp://host:port target.

Build the target with the tcp scheme whenever the serve type is TCP or
TLS-terminated TCP. Plain tcp endpoints already used that scheme, so only
tls-terminated-tcp endpoints change. https+insecure needs no mapping, since
the web path accepts it as a target scheme, and unix targets skip scheme
construction entirely.

Fixes #21786

Signed-off-by: Vivek1898 <[email protected]>
2026-10-16 08:38:27 -07:00
Alex Valiushko e9d5cdc323 net/sockopts,net/udprelay: implement BindUDPGroup (#21783)
We're going to add a second SO_REUSEPORT use in the codebase. Extract
and generalize udprelay mechanism for future reuse. Also address the
Linux flaw of allowing same UID groups to merge if the ephemeral port
selection collides.

Exposes public SetReusePort, RawConn and ControlFunc signatures for
shared use.

Updates tailscale/corp#48168
Fixes tailscale/corp#49297

Signed-off-by: Alex Valiushko <[email protected]>
Change-Id: Iba33142877513d72123c51cf1bcc33cf6a6a6964
2026-10-15 18:04:10 -07:00
Evan LowryandZach Buchheit a04b6b1682 cmd/tailscale/cli: fix bare "up" hang on a running node with tags (#21798)
On a running node with AdvertiseTags set, a bare "tailscale up" never
returned. updatePrefs compared the stored tags with the flag-derived
prefs, which have no tags since no flags were given, concluded that
the tags had changed, and skipped the justEdit path. runUp then sent
the simple up's WantRunning=true edit, a no-op on a running node, and
waited on the IPN bus for a running state that was never sent.

A simple up keeps the current settings, so don't treat its missing
tags as a change.

Fixes #21774

RELNOTE: Fix "tailscale up" with no flags hanging on a running node with advertised tags.

Signed-off-by: Evan Lowry <[email protected]>
Co-authored-by: Zach Buchheit <[email protected]>
2026-10-15 18:01:11 -03:00
Brendan Creane a0a79982d4 feature/acme,tstest/acmetest: report the authorization error when an ACME order fails (#21790)
When validation fails, WaitOrder returns only the order's status, so
tailscale cert printed "acme: order ... status: invalid" with no reason.
The CA's reason is on the authorization's challenge. Wait on each
authorization before the order and return that error instead.

To test this, move natlab's fake ACME CA to tstest/acmetest, where unit
tests can import it, and teach it tls-alpn-01, a validation hook, and
the "invalid" state a CA reports when validation fails.

Updates #21759

Signed-off-by: Brendan Creane <[email protected]>
2026-10-15 07:45:30 -07:00
Joe Tsai b83f28ebfb util/bufpool: add a general purpose pool of buffers (#20867)
A naive sync.Pool that stores dynamically sized []byte
is incorrect since the Pool assumes that each stored item
carries approximately the same memory cost.

Different cost items should be stored in different pools.
The bufpool tracks buffer pools by powers of two
and provides a Buffer type that mimics the API of bytes.Buffer.

This is a performance optimization. Avoid using this unless
there is a clear performance gain for doing so.
Incorrect use can lead to widespread data corruption
(as is already the case with any incorrect sync.Pool use).

Updates tailscale/corp#21363

Signed-off-by: Joe Tsai <[email protected]>
2026-10-14 15:56:12 -07:00
kari-ts 5f47f9ce49 client/local, cmd/tailscale/cli: reload syspolicy for current user (#21712)
This makes the syspolicy cli use the caller's user scope instead of the
generic user scope. In tailscale/tailscale#21701, we made the LocalAPI
policy endpoint resolve unscoped policy requests to the connected user's
policy. However, the cli serialized setting.DefaultScope() as
/policy/User, which selected the general user policy and not the User(SID) policy used by
IPN watchers.

This was tested by changing the AlwaysOn policy and verifying that the
User(SID) policy was reloaded and the gui's IPN policy change callbacks
fired.

Updates tailscale/corp#41463

Signed-off-by: kari <[email protected]>
2026-10-14 09:15:08 -07:00
David Bond fd1cc09139 k8s-operator/reconciler/peerrelay: add NET_ADMIN to peer relay pods (#21762)
The relay server force-sets its UDP socket buffer sizes. The kernel
requires the NET_ADMIN capability for this. Without it, tailscaled logs
a warning and uses the kernel defaults. Dogfooding showed lower
throughput and more dropped packets in that state.

This commit adds NET_ADMIN to the tailscaled container in peer relay
StatefulSets. A ProxyClass that sets a security context on the
Tailscale container replaces the default, as for other proxy types.

Fixes #21745

Change-Id: Ic84e243d7e6184afa4d0bb0c38c4be8eb899261b

Signed-off-by: David Bond <[email protected]>
2026-10-14 11:43:53 +01:00
yaruk-byte f61c868527 tstest/integration: add tests for DNS, routing and incoming connections (#21517)
Updates #21489

Signed-off-by: Yaruk Asghar <[email protected]>
2026-10-14 00:43:00 -07:00
Patrick O'Doherty a6a4c25c26 go.mod: bump oras.land/oras-go/v2 to v2.6.2 (#21784)
Bump the oras.land/oras-go/v2 indirect dependency from v2.6.1 to v2.6.2,
which contains the fixes for both govulncheck symbol findings on main

Updates #cleanup
Change-Id: Ibb4aa08823d900a6b8f7f9440a64fb4ce4bfe659
Signed-off-by: Patrick O'Doherty <[email protected]>
2026-10-13 16:57:13 -07:00
License Updater bbe697b645 licenses: update license notices
Signed-off-by: License Updater <[email protected]>
2026-10-13 16:02:43 -07:00
James Tucker fb79793d99 net/tstun,feature/conn25: test inbound replies against a full injection queue
Add regression guards for the inbound reply paths (TSMP pong, TSMP
connection reject, and the conn25 unmapped Transit IP reject) that were
made nonblocking via TryInjectOutbound: with the injection queue full
and its reader not draining (as when the reader is blocked behind
wireguard-go's device.peers lock held by RemovePeer), generating a
reply must drop rather than block, because the replying goroutine
must complete for the peer teardown to finish. A blocking injection
there deadlocks peer removal against inbound packet processing, as in
tailscale/corp#45544.

The tests run in synctest bubbles: the full queue is the only blocking
operation on these paths, so after synctest.Wait the reply either
completed or is provably stuck on the queue, and no timeout-based
failure is needed. A regressed, blocking sender is unblocked by
closing the Wrapper before the test fails, so the bubble settles.

Updates tailscale/corp#45544
Updates #21631

Signed-off-by: James Tucker <[email protected]>
2026-10-13 15:55:43 -07:00
James Tucker c606e83fb2 net/tstun,feature/conn25: make ErrInjectionQueueFull detectable as ENOBUFS
Export ErrInjectionQueueFull, returned by TryInjectOutbound when a full
injection queue forced a packet drop, and define it to wrap
syscall.ENOBUFS on platforms that define that errno. Callers can now
test for buffer exhaustion generically with errors.Is(err,
syscall.ENOBUFS) instead of knowing about tstun's error type. plan9 and
tamago have no ENOBUFS in their syscall packages, so there the error is
a plain sentinel; code that must build on those platforms (or on all
platforms, like feature/conn25) can still match the exported sentinel.

Also stop conn25 from logging queue-full TSMP rejections: those drops
are expected under saturation and are already counted as reason="queue_full"
in the outbound usermetric.

Signed-off-by: James Tucker <[email protected]>
2026-10-13 15:55:43 -07:00
James Tucker 3c0508fa28 net/tstun,wgengine/netstack: avoid deadlocks on full outbound queues
Make link queue writes nonblocking: gVisor can generate replies on the
reader needed to drain the queue. A full queue drops only the rejected
packet and reports ErrNoBufferSpace, which gVisor counts and TCP handles
by arming its retransmit timer. UDP sockets do not see the error unless
IP_RECVERR is set, matching Linux. Count WireGuard-bound drops as
reason="queue_full" in tailscaled_outbound_dropped_packets_total, and
per-queue drops in debug and client metrics.

Add Wrapper.TryInjectOutbound for best-effort replies generated while
processing packets (TSMP rejects and pongs, conn25 rejects, fake-mode
echo replies), so those paths drop instead of stalling behind the
injection queue's reader. Its drops are also counted as queue_full.

Make outbound injection waits cancellable and close link queues before
abort-generated replies. Stop the WireGuard injection pump on ErrClosed.
Release injected packets still queued at Close, outside closeOnce to
allow reentrant release callbacks; a sender whose send races with Close
releases the packet itself. Release temporary capture buffers.

Copy injected payload views directly into the WireGuard slab, avoiding
an intermediate allocation and copy.

Test queue saturation, multiqueue progress, cancellation, concurrent
shutdown, reference ownership, fragmented payloads, and GSO.

Performance versus the parent commit, on a 4-core Xeon 6975P-C:

  inject+read 64B / 1280B       245ns / 479ns -> 187ns / 195ns, 0 allocs
  4 injectors, 1 reader         843ns -> 451ns
  64KiB GSO inject+split        10.9us -> 4.4us, 64KiB/op -> 0
  link queue write+read         81.4ns -> 81.5ns
  tsnet TCP, 1 / 8 streams      448 / 580 MB/s -> 492 / 674 MB/s

BenchmarkTCPQueueBottleneck shows that dropping on full queues keeps
throughput at the bottleneck rate (117 MB/s at 100k packets/s, as with
blocking writes), at the cost of more retransmits with many streams.

Fixes #21631
Updates #21638
Updates #21632
Updates #21639

Signed-off-by: James Tucker <[email protected]>
2026-10-13 15:55:43 -07:00
toppk 8b94ec2d96 wgengine/magicsock: log initial contacts at verbose level (#21766)
Repeated CallMeMaybe messages over DERP can each log a new contact for
the same peer, flooding stderr. Mark the DERP, direct, and control-netmap
latency messages [v1] so they remain in diagnostic uploads but only
reach stderr with --verbose=1.

Updates #12639
Updates #21765

Change-Id: Ic7ee47c699e5698f61358a72c6fd7776e1caf8dc
Signed-off-by: kenneth topp <[email protected]>
2026-10-13 15:32:58 -07:00
Adriano Sela Aviles 40d0abcffb cmd/tsidp: replace deprecated go-jose library
Updates tailscale/corp#49953

Signed-off-by: Adriano Sela Aviles <[email protected]>
2026-10-13 15:18:09 -07:00
Mazdak Nasab aaaaa97189 feature/conn25: lock mu in lookupTransitIPsByConnKey
Lock mutex in lookupTransitIPsByConnKey right
before critical section, rather than in the caller.

Updates #cleanup

Change-Id: I8ee8950dce056e1945d4356d82f0bffbc6688624
Signed-off-by: Mazdak Nasab <[email protected]>
2026-10-13 13:26:43 -07:00
Jonathan Nobels 5cc8aa7f07 net/dns: flush stale MagicDNS NXDOMAINs on Apple platforms (#21584)
Updates tailscale/corp#49775

Track authoritative NXDOMAINs for at least 60 seconds on macOS and iOS (where our short SOA ttls are not properly respected), and flush when a cached name becomes resolvable. Compile a no-op tracker elsewhere and avoid duplicate VPN reconfiguration on link changes.
2026-10-13 15:48:31 -04:00
Brendan Creane 4f86936ef0 ipn/ipnlocal: resolve auto exit node on first netcheck report (#21775)
On a fresh install the first netmap arrives before the first netcheck
report, so auto exit node resolution installed the blackhole
ipn.UnresolvedExitNodeID and nothing re-resolved it once the report
arrived. Refresh in setNetInfo while the exit node is still unresolved.

Fixes #18199

Signed-off-by: Brendan Creane <[email protected]>
2026-10-13 10:24:12 -07:00
François Marier 53c3957233 tstest/natlab/{vmtest,vnet}: add basic PCP support (#21730)
This implements enough of PCP to establish direct connections
with a node behind a hard NAT.

Updates #21713

Change-Id: I44b955e9b8ecce80ddc49afdfb01eb49c8d56f8c
Signed-off-by: Francois Marier <[email protected]>
2026-10-13 08:51:12 -07:00
Brendan Creane 3bb8a906c2 feature/acme: only refresh certs for HTTPS serve entries (#21736)
The cert refresh loop treated every Web entry in the ServeConfig as
HTTPS, so a node serving only plain HTTP fetched and renewed a Let's
Encrypt cert for its name. Check the port's TCP handler for HTTPS
before considering a Web entry, for node and Service entries alike.

Fixes #21693

Signed-off-by: Brendan Creane <[email protected]>
2026-10-10 09:53:11 -07:00
David Bond 373db59dae cmd/k8s-operator,k8s-operator: support dual-stack PeerRelay load balancers (#21663)
The reconciler forced the AWS load balancer address type to ipv4, so on
an IPv6 EKS cluster, where pod targets are IPv6, no Network Load
Balancer was ever provisioned.

Make the address type a default that spec.service.annotations can
override, defaulting IPv6 source NAT on when dualstack is requested.
Resolve load balancer hostnames for both address families and requeue
ready PeerRelays every five minutes, since DNS records for a new load
balancer arrive over several minutes. Add spec.service.ipFamilyPolicy
and ipFamilies so dual-stack GKE and AKS clusters can request a
dual-stack load balancer too.

Shorten the PeerRelay field descriptions and link to the PeerRelay docs
for the detail.

Fixes #21399

Change-Id: Idf22eb02f8ed9a46ff4abea8d4faef4b8c12c111

Signed-off-by: David Bond <[email protected]>
2026-10-10 10:05:23 +01:00
Francois Marier 87ec06810d tstest/natlab/vmtest: give LANPing attempts more than 5s
TTA's /ping runs four pings, taking 3-4s. The 5s timeout wasn't
enough for slow VMs using TCG.

Updates #cleanup

Change-Id: I70006f4c07b776d58619e0ef75c91d0d65b13fff
Signed-off-by: Francois Marier <[email protected]>
2026-10-09 17:02:41 -07:00
yaruk-byte fbb662f230 .github: run the Windows tests nightly (#21731)
Updates #21489

Signed-off-by: Yaruk Asghar <[email protected]>
2026-10-09 15:40:52 -07:00