Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

x/crypto/ssh: write errors should be returned immediately #57531

Open
willmo opened this issue Dec 31, 2022 · 1 comment
Open

x/crypto/ssh: write errors should be returned immediately #57531

willmo opened this issue Dec 31, 2022 · 1 comment
Labels
NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Milestone

Comments

@willmo
Copy link

willmo commented Dec 31, 2022

Apologies if this is a duplicate or not actually a bug.

What version of Go are you using (go version)?

$ go version
go version go1.18.4 linux/amd64

x/crypto master

Does this issue reproduce with the latest release?

Yes, this behavior hasn't changed since it was introduced in golang/crypto@2e74c77 .

What did you do?

Write to a channel of an SSH connection that's interrupted, e.g. by receiving a TCP RST.

What did you expect to see?

A write error is reported as soon as writing to the underlying net.Conn fails.

What did you see instead?

The error is reported only on subsequent writes. This is not a dire problem, but seems odd/unnecessary.

In particular, handshakeTransport.writePacket sets t.writeError but returns nil. This seems to have been introduced in the aforelinked golang/crypto@2e74c77 .

Is there a missing return err here? If so, I can submit a CL.

@gopherbot gopherbot added this to the Unreleased milestone Dec 31, 2022
@seankhliao seankhliao added the NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. label Dec 31, 2022
@seankhliao
Copy link
Member

cc @golang/security

@seankhliao seankhliao changed the title x/crypto/ssh: write errors should be returned immediately (?) x/crypto/ssh: write errors should be returned immediately Dec 31, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Projects
None yet
Development

No branches or pull requests

4 participants
@willmo @gopherbot @seankhliao and others