• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

charmbracelet / ssh / 31200172697
63%
master: 63%

Build:
Build:
LAST BUILD BRANCH: ci/sync-dependabot-config
DEFAULT BRANCH: master
Ran 07 Aug 2026 05:00PM UTC
Jobs 1
Files 12
Run time 1min
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

07 Aug 2026 04:58PM UTC coverage: 63.103% (+0.8%) from 62.331%
31200172697

Pull #56

github

taciturnaxolotl
fix: guard handshakeDeadline against concurrent access

handleConn clears the handshake deadline once gossh.NewServerConn returns:

	sshConn, chans, reqs, err := gossh.NewServerConn(conn, srv.config(ctx))
	...
	conn.handshakeDeadline = time.Time{}

By that point NewServerConn has started the crypto/ssh read loop, which
calls serverConn.Read on every packet, and Read consults handshakeDeadline
through updateDeadline whenever IdleTimeout is set. The write and those
reads are unsynchronized, so -race reports a data race on connections that
set both HandshakeTimeout and IdleTimeout.

The window is narrow and post-authentication, so the practical effect is
limited: the handshake deadline has already done its job by the time the
racing write lands, and it cannot widen the pre-auth window. What can go
wrong is deadline bookkeeping, either a stale read leaving a deadline the
connection should have shed, or a torn read handing SetDeadline a garbage
time.Time.

Guard the field with a mutex and route every access through
setHandshakeDeadline, clearHandshakeDeadline, and a locked read in
updateDeadline, so no raw access to it remains. idleTimeout and
maxDeadline are set before the handshake begins and never mutated after,
so they stay lock-free.

The test reproduces the access pattern directly rather than through a live
handshake; driving it via real connections only caught the race about a
third of the time, while the direct version reports it on every run
without this fix and none with it.
Pull Request #56: fix: guard handshakeDeadline against concurrent access

21 of 21 new or added lines in 2 files covered. (100.0%)

850 of 1347 relevant lines covered (63.1%)

663.81 hits per line

Jobs
ID Job ID Ran Files Coverage
1 31200172697.1 07 Aug 2026 04:59PM UTC 12
63.1
GitHub Action Run
Source Files on build 31200172697
  • Tree
  • List 12
  • Changed 2
  • Source Changed 0
  • Coverage Changed 2
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • Pull Request #56
  • PR Base - master (#30653009150)
  • Delete
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE TRIAL · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc