Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(70)

Issue 6405064: code review 6405064: go.crypto/ssh: prevent channel writes after Close (Closed)

Can't Edit
Can't Publish+Mail
Start Review
Created:
11 years, 9 months ago by dave
Modified:
11 years, 8 months ago
Reviewers:
CC:
agl1, kardia, gpaul, golang-dev
Visibility:
Public.

Description

go.crypto/ssh: prevent channel writes after Close Fixes issue 3810. This change introduces an atomic boolean to guard the close of the clientChan. Previously the client code was quite lax with the ordering of the close messages and could allow window adjustment or EOF messages to leak after Close had been signaled. Consolidating the changes to the serverChan will be handled in a following CL.

Patch Set 1 #

Patch Set 2 : diff -r 86bed5e91c9d https://code.google.com/p/go.crypto #

Patch Set 3 : diff -r 86bed5e91c9d https://code.google.com/p/go.crypto #

Patch Set 4 : diff -r ff6d5d46978d https://code.google.com/p/go.crypto #

Patch Set 5 : diff -r ff6d5d46978d https://code.google.com/p/go.crypto #

Patch Set 6 : diff -r ff6d5d46978d https://code.google.com/p/go.crypto #

Patch Set 7 : diff -r ff6d5d46978d https://code.google.com/p/go.crypto #

Patch Set 8 : diff -r ff6d5d46978d https://code.google.com/p/go.crypto #

Total comments: 2

Patch Set 9 : code review 6405064: go.crypto/ssh: prevent channel writes after Close #

Patch Set 10 : diff -r 78aaaa8a7361 https://code.google.com/p/go.crypto #

Patch Set 11 : diff -r 7997ecacd006 https://code.google.com/p/go.crypto #

Patch Set 12 : diff -r 7997ecacd006 https://code.google.com/p/go.crypto #

Patch Set 13 : diff -r 7997ecacd006 https://code.google.com/p/go.crypto #

Patch Set 14 : diff -r 7997ecacd006 https://code.google.com/p/go.crypto #

Total comments: 3

Patch Set 15 : diff -r 7997ecacd006 https://code.google.com/p/go.crypto #

Patch Set 16 : diff -r 7997ecacd006 https://code.google.com/p/go.crypto #

Patch Set 17 : diff -r 7997ecacd006 https://code.google.com/p/go.crypto #

Patch Set 18 : diff -r 7997ecacd006 https://code.google.com/p/go.crypto #

Total comments: 2

Patch Set 19 : diff -r 7997ecacd006 https://code.google.com/p/go.crypto #

Unified diffs Side-by-side diffs Delta from patch set Stats (+89 lines, -34 lines) Patch
M ssh/channel.go View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 6 chunks +36 lines, -20 lines 0 comments Download
M ssh/client.go View 1 2 3 4 5 6 7 8 9 10 2 chunks +4 lines, -13 lines 0 comments Download
M ssh/session.go View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 1 chunk +1 line, -1 line 0 comments Download
M ssh/session_test.go View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 1 chunk +48 lines, -0 lines 0 comments Download

Messages

Total messages: 14
dave_cheney.net
Hello agl@golang.org, kardianos@gmail.com, gustav.paul@gmail.com (cc: golang-dev@googlegroups.com), I'd like you to review this change to https://code.google.com/p/go.crypto
11 years, 9 months ago (2012-07-21 07:05:52 UTC) #1
agl1
It's tough to dive into this change and understand whether it's correct, but I don't ...
11 years, 9 months ago (2012-07-21 14:04:06 UTC) #2
dave_cheney.net
Thank you for your comments. I can make this diff slightly smaller by not touching ...
11 years, 9 months ago (2012-07-22 01:57:39 UTC) #3
kardia
Moving the msg chan into the channel struct rubs me the wrong way, though I ...
11 years, 9 months ago (2012-07-23 05:43:02 UTC) #4
dave_cheney.net
> Moving the msg chan into the channel struct rubs me the wrong way, > ...
11 years, 9 months ago (2012-07-23 16:05:27 UTC) #5
dave_cheney.net
Hello agl@golang.org, kardianos@gmail.com, gustav.paul@gmail.com (cc: golang-dev@googlegroups.com), Please take another look.
11 years, 8 months ago (2012-08-22 10:46:41 UTC) #6
dave_cheney.net
Please take another look. I have refactored the CL to be only the minimum change ...
11 years, 8 months ago (2012-08-22 10:47:31 UTC) #7
kardia
I like how this removes redundant code in the client. http://codereview.appspot.com/6405064/diff/25001/ssh/channel.go File ssh/channel.go (right): http://codereview.appspot.com/6405064/diff/25001/ssh/channel.go#newcode122 ...
11 years, 8 months ago (2012-08-22 15:25:43 UTC) #8
dave_cheney.net
Thank you for your comments. I have restored the Close() -> io.EOF behaviour, which came ...
11 years, 8 months ago (2012-08-23 00:15:18 UTC) #9
dave_cheney.net
Hello agl@golang.org, kardianos@gmail.com, gustav.paul@gmail.com (cc: golang-dev@googlegroups.com), Please take another look.
11 years, 8 months ago (2012-08-23 00:15:57 UTC) #10
kardia
LGTM
11 years, 8 months ago (2012-08-23 00:21:34 UTC) #11
agl1
LGTM https://codereview.appspot.com/6405064/diff/25005/ssh/channel.go File ssh/channel.go (right): https://codereview.appspot.com/6405064/diff/25005/ssh/channel.go#newcode85 ssh/channel.go:85: isclosed uint32 // atomic bool, non zero if ...
11 years, 8 months ago (2012-08-23 16:17:29 UTC) #12
dave_cheney.net
*** Submitted as http://code.google.com/p/go/source/detail?r=951fbbb0a477&repo=crypto *** go.crypto/ssh: prevent channel writes after Close Fixes issue 3810. This ...
11 years, 8 months ago (2012-08-23 23:46:50 UTC) #13
dave_cheney.net
11 years, 8 months ago (2012-08-23 23:47:52 UTC) #14
@agl - sorry I failed to address your two comments. I will address
them in the follow up CL.

On Fri, Aug 24, 2012 at 9:46 AM,  <dave@cheney.net> wrote:
> *** Submitted as
> http://code.google.com/p/go/source/detail?r=951fbbb0a477&repo=crypto ***
>
> go.crypto/ssh: prevent channel writes after Close
>
> Fixes issue 3810.
>
> This change introduces an atomic boolean to guard the close
> of the clientChan. Previously the client code was quite
> lax with the ordering of the close messages and could allow
> window adjustment or EOF messages to leak after Close had
> been signaled.
>
> Consolidating the changes to the serverChan will be handled
> in a following CL.
>
> R=agl, kardianos, gustav.paul
> CC=golang-dev
> http://codereview.appspot.com/6405064
>
>
> http://codereview.appspot.com/6405064/
Sign in to reply to this message.

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b